#circuitpython-dev
1 messages Β· Page 394 of 1
I do have standard grep on this machine too.
oh yes that actually is more like what kattni literally asked for
Ah nice, ok
-v is the inVerse I guess
Thanks @onyx hinge and @lone axle!
@crude blaze just pushed speed ups to my branch
@onyx hinge when you are back to your desk: https://forums.adafruit.com/viewtopic.php?f=60&t=184470
Thank you! Are you still waiting to hear about the flash?
Yes, I did ask this morning that question specifically. With timezone differences, I would expect an answer overnight. They were pretty quick with the PID. How large is the 25x16? Most seems to use the 25x64 or 25x128 which is obviously larger.
Will a x16 be a potential issue?
I'm using CircuitPython by uploading it on the Raspberry Pi Pico board.
I tried to make a uf2 file according to the contents in the guide.(https://learn.adafruit.com/building-cir ... cuitpython)
I want to create a uf2 file with added network functionality. Is there a way to get and use the Adafruit_wiznet5k file provided by Bundle?
Just as Adafruit_bus_device is ported, I would like to add a wiznet5k library.
Instead of adding a library to the lib file, we try to implement...
MengDu indicated that it's a P25Q16H-UXH-IR.
This is different than the schematic which indicates a GD25 device.
@tannewt Should we update EXTERNAL_FLASH_DEVICES to match? Is this device available in the flash config repo? (where is that?))
I think all the flash definitions are in https://github.com/adafruit/nvm.toml
responded.
@onyx hinge What does the code in the tests/circuitpython-manual/audiopwmio do? It references D13, which not all boards have, but it is obviously not related to the LED.
I'm assuming leave it alone.
Also you import math in two of them and it's not used.
I say "you", I only assume it was you.
@idle owl It is using D13 as the audio output pin. If you hook up an audio amplifier to it you'd hear audio, but if D13 is an LED you can also "see" the sound intensity in the LED's brightness.
Looks like it was actually Lucian
looks like it was actually Scott, moved into the current location buy Lucian
fair enough. One said "jeplayer" so I assumed incorrectly.
I'll leave it alone I guess.
you can remove the import math though! good catch.
Ah ok
at least one example is using math.sin maybe the same imports were blindly copied to all examples.
Might have been yeah.
I have a question about one more.
The PWMOut page has three examples of PWM, all use D13, but I don't believe they're all LED-specific. Though I also don't know PWM well enough to know whether all examples would affect an LED anyway.
The first example should clearly be board.LED. The other two.... not so clear.
Basically I'm not sure how frequency affects an LED
//|
//| import pwmio
//| import board
//|
//| pwm = pwmio.PWMOut(board.D13, frequency=50)
//| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at 50hz
//|
//| Variable frequency (usually tones)::
//|
//| import pwmio
//| import board
//| import time
//|
//| pwm = pwmio.PWMOut(board.D13, duty_cycle=2 ** 15, frequency=440, variable_frequency=True)
//| time.sleep(0.2)
//| pwm.frequency = 880
//| time.sleep(0.1)```
These two examples.
Actually w/o a while True the first example isn't really doing anything.
MengDu indicated that it's a P25Q16H-UXH-IR. This is different than the schematic which indicates a GD25 device. @tannewt Should we update EXTERNAL_FLASH_DEVICES to match?
Yup!
Is this device available in the flash config repo? (where is that?))
Repo is here: https://github.com/adafruit/nvm.toml/tree/main/flash This is a new manufacturer so it'll definitely need to be added.
Why do you want the Wiznet library in the uf2? That will make it harder to update.
You'll need to submodule the library into the CircuitPython repo and then add it as frozen to the board. Here is an example: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/mpconfigboard.mk#L23
@gilded cradle the bond button isn't doing anything for me
Does the console say anything? Sometimes it takes a bit of playing around with to get working consistently and once it does, it's usually pretty solid.
yeah
It probably should pop up a message in that case and I figured stuff like that would be in the next round of updates.
is it possible to connect to an existing device?
What do you mean by existing device?
one that has been bonded already
If it has already been bonded, hitting connect should make the bond button appear. Maybe we need to add auto bonding next since it's not anything the user really needs to do..
ah, I'm crashing
yeah
π will look now
Cool that you were able to reproduce the issue.
Hopefully an easy fix.
usually is
So the other two examples, when updated to include while True both affect the LED, even if they're not designed to. so I guess I'll change the pin to board.LED and call it a day.
Actually I think the tone example would play a tone without the while True if a speaker were connected.
Ugh.
How do I build the docs for CircuitPython? I only know how to do it for libraries, and that command did not work.
I mean mostly I changed pin names, but I added an example as well, so maybe worth test building? Or shrug.
@idle owl at the top level you can do make html
Ah ok
@gilded cradle the issue is that the listdir entry struct is larger (28) than ble packet size (20)
I'll have to split it across packets
Hmm, ok. I wonder why it only crashed on mobile?
@tulip sleet PR submitted. https://github.com/adafruit/circuitpython/pull/5523
Makes sense
it'd be nice to have a modal pop up when usb is preventing ble writes
Yeah, that's actually on my list. I just wanted to get these changes added first.
Actually it was the only item left on my list.
sync starting at 0 to 48
script.js:533 0 'import time\ntime.sleep(8)\n\nprint("hello world")\n'
script.js:537 write
script.js:336 DOMException: GATT operation failed for unknown reason. undefined
script.js:522 sync starting at 48 to 48
script.js:533 48 ''
script.js:537 write
script.js:522 sync starting at 48 to 48
script.js:533 48 ''
script.js:537 write
script.js:522 sync starting at 48 to 49
script.js:533 48 '\n'
script.js:537 write
@gilded cradle what board are you testing with? I'll give you a uf2 for it
The issue is that the listdir entry struct is now 28 bytes with the uint64_t timestamp that was added. BLE packets will be 20 bytes at their smallest. The crash was due to packet buffer raising an exception when trying to write a 28 byte packet over a connection with a 20 byte packet size (MTU.)
I'm using a CLUE for most of my testing, though I did try out the LED glasses too.
clue
thanks
when the MTU of the BLE connection is smaller than the 28 bytes of
the header. (The smallest possible MTU is 20.)
Fixes #5511
@slender iron do you think packet_buffer_write() should do the splitting itself?
Ok, couldn't get it to connect. I just figured out how to use the remote Chrome Dev Tools (which is really cool), so I can see the output the device's console. Looks like there's some cleaning up to do from the packet split, but at least this gets me unstuck.
I have some github stuff to do and then I'll head back to the Code Editor stuff.
@tulip sleet I thought about it. maybe it should be a kwarg. /shrug
@gilded cradle sounds good. this fix is a good reason for us to do 7.1
Yeah
Finally got an M1 MacBook Pro (present from family for my birthday next week) so if anyone has M1 related bugs with building circuitpython or with circuitpython devices connected I can hopefully be of help π
π It passed!
Happy b-day!
Itβs next week but thank you π
Today might as well have been my birthday because lots of small little rays of sunshine
@tulip sleet Did you rewrite this: https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#i-have-to-continue-using-an-older-version-of-circuitpython-where-can-i-find-compatible-libraries-3039092-3 or this: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#i-have-to-continue-using-circuitpython-5-dot-x-or-earlier-where-can-i-find-compatible-libraries-3039095-4
Going to make the one you rewrote the canonical one.
yeah, I did
rewriting that kind of started me on the "maybe revise this guide" path
anmd then discovered the other one
Ok that's what I wanted to know
Going to remove it from there, and put it only in the FAQ, but wanted to know which one to copy - it will be that one.
I see me in the history for that page. I will check the other page
The one in Troubleshooting looks nicer, so it is likely the one you did
I think that is true. I was editing something else in Troubleshooting. But my paw prints are on both pages recently
Do CPX/CPB use the LEDs as CircuitPython status LEDs in 7.0.0?
yep
Ah nice ok. Thanks
Whee the docs built and deployed.
For some reason, CircuitPython RTD is defaulting to 7x when you go to the main link. Is there some reason we did this deliberately? If not, I'll update it so it defaults to latest.
<@&356864093652516868> https://www.adafruit.com/product/5291
I ordered mine earlier today.
I would love one but ugh other money priorities:(
that will be pretty sweet with CircuitPython on it π
Thanks. Ordered. Dreaming of some stand-alone CircuitPython projects for it.
@tulip sleet The "Gemma M0, Trinket M0" erase file would work on QT Py M0 and the SAMD21 Trinkeys, right?
And it would make more sense to specify "SAMD21 Non-Express boards" ... or do we not have any other non-express boards anyway.... I'm now second guessing.
Still better to specify.
I mean, I'm pushing for using the storage method, but obviously we still list the old way with the erase files. So if it works on more boards, it might as well say so.
it should, yes, and I agree about "non-express boards"
OK thanks
@tulip sleet Any idea if we're still shipping tinyboards with the Windows 7 driver? I haven't ordered one in ages. I might have a QT Py M0 still in a bag somewhere... But not a Trinket or GEMMA.
i doubt if it's changed
Not even sure we're shipping those with CP at all.
Alright, I'll leave that sentence in there
Thanks!
@tulip sleet One more question then I'm wrapping up for dinner - Should I move the details in the Windows 7/8 bit in this section to the Windows 7/8 page and link to it? Or leave it where it is? Feels like it would be better housed on the separate page, but you'd know better. https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#bootloader-boardnameboot-drive-not-present-2978448-5
Basically I would move the "uninstall old versions" bit and the screenshots to the new page if you think that makes sense
I'd say move it and put a link in the original troubleshooting page
Right on, ok. That's what I was thinking.
Thank you for your help with this! I have some idea how I'm going to do the CircuitPython Documentation page, but I'm still fuzzy on the How Do I Learn Python? page, so I may be pinging you tomorrow about that.
Have a lovely evening!
thanks, g'night!
β¦. and all 400 of them are gone lol π
straight into drawers, to never see the light of day again
I was so close to buying one a few times today but realized I had no immediate use for it and it would just sit
I have an immediate use (I got the hyperpixel display today), but I will wait until I can order it with shipping costing less than the board itself
ugh yeah that isn't fun either
added it to my already full basket at Pimoroni, I have a Pi zero project that could benefit from an upgrade in processing power, and a use for the old one, so I'm really happy with that
Zack Freedman's latest video is about a modular keyboard, running Circuitpython -- pretty neat!
https://www.youtube.com/watch?v=Fg0V5M0llaE
https://github.com/zackfreedman/mirage
The goal: the most hackable mechanical keyboard. The result: trolling the pants off /r/mk.
This episode is sponsored by NextPCB! Visit https://bit.ly/3ATzxtV for massive discounts on high-quality PCB's. They made the boards for this episode!
My latest project is a low-profile mechanical keyboard, with three clickable displays, CircuitPython fir...
Sorry for the delay.
I've been having a lot of trouble getting the stm32 port to work right on my h743zi2 nucleo board..
Every time I try to load the hello-world model the board reset's.
I've just been through a deep dive on how a bare metal port works and how to debug on on the hardware in visual studio code but to no avail.
In Java you can set breakpoints on Exceptions and the IDE will pause when the error occurs and then you can see via the back trace where it originate...
I've written a keyboard handler for the Keyboard Featherwing and I've been trying to figure out if there's a way to generate a keyboard interrupt (ctrl-C) programmatically from a key press (that seems unlikely to me) or more likely from a button press on a gpio pin.
My code is essentially an operating shell for the microcontroller flash, allowing me to launch various python scripts by typing in their names. If a script misbehaves, I have no way to interrupt it without powercycling the micr...
The MKR Zero has a pretty small internal flash, so reducing the size of the core CircuitPython build is ideal. Rainbowio has been removed from some other SAM21 boards without external flash, so doing that here, too.
We didn't remove this on MKR Zero before, because it wasn't necessary to get it to fit with all translations. We are not seeing build failures right now with this board without the removal. What necessitated this for you? Thanks.
We hope to turn rainbowio back on, on the boards where we turned it off, after some space saving happens. Turning it off was only for expediency to get the release out.
@dhalbert I was in the process of making a custom build (to fit audiobusio and audioio onto the MKR Zero for I2S) and I noticed that it rainbowio had been removed from several of the other SAM21 boards. I've been using a couple of these boards for messing with some I2C stuff as well, and there hasn't been a lot of space for libraries.
That said, I can see why you'd want to get rainbowio back on all boards for baseline consistency in CP.
I'll close this one.
NP - In 8.0.0 we will be able to remove some things, such as OneWire being in both onewireio (new location) and busio (old location), and that should free up the space we need.
rainbowio was disabled for size reasons on a few small-build boards that had many pins. After the 8.0.0 API revisions, we might be able to restore it.
Thank you! We generally accept translation improvements via weblate https://hosted.weblate.org/projects/circuitpython/main/ and encourage you to consider using it in the future.
I've been having a lot of trouble getting the stm32 port to work right on my h743zi2 nucleo board..
Every time I try to load the hello-world model the board reset's.
I've just been through a deep dive on how a bare metal port works and how to debug on on the hardware in visual studio code but to no avail.
That sounds really frustrating! I can help you get a backtrace when you are ready to circle back to it. I wrote a guide about my process here: https://learn.adafruit.com/d...
@slender iron I wonβt be around today, but Iβll push deep dive notes to the repo next week or this weekend. At some point, Iβll make some suggestions about how to fully automate that, just need to find the time. Until then, happy to do it manually.
@gilded cradle The listdir struct is sent over two packets now if the MTU is < 28 bytes
the full struct is 28 bytes and will be split into 16 and 12 byte packets
Right @slender iron, but after around 632 bytes returned, the payload goes back to a smaller value, but the i count is higher than before
So it appears to be coming back in chunks. I just wanted to confirm. This may be a mobile only thing as well.
@gilded cradle sorry I missed the second ping. what command are you referring to?
the data non-head parts were always split amongst multiple underlying packets
The listDir command. Before, the payload would continually append packets and grow until it had all the data. Now that payload seems to reset after it builds up to a certain number of bytes. This probably was always the case, but I'm only noticing it because I'm debugging through a mobile device now. It's probably similar to how we didn't see the 20 byte limit until we did it over mobile.
hrm, it should return everything still
Yeah, it's probably because the bluetooth stack is a bit different.
It's just broken up more
ya, it looks like mobile is transferring at 20 bytes at a time
@gilded cradle Hey so I want to switch the PyPI deployment to use an API key instead of the username and password. It involves using __token__ as the username and the API key as the password. Should I update the Adafruit org secrets and do a test release on a library and see if it works? I don't know how else to test it really. I can always put it back to the current values if it fails.
Sounds like a good strategy to me.
Keen.
I've been digging and now I think it's actually a bug in that the processListDir is returning before it should for whatever reason, but same behavior as before. This should make things simpler.
so it is a js bug?
Yeah, I think so
Payload was resetting because readFile swooped in too early, which meant the promise from process listDir was being resolved too early.
Done and done. It worked.
Awesome
@jaunty juniper Please describe the Community Bundle to me in a few sentences. (I'm adding it to this guide, and am struggling to describe it well.)
Here is what I have so far ```The CircuitPython Community Library Bundle is made up of libraries written and provided by members of the CircuitPython community.
These libraries are maintained by their authors and are not supported by Adafruit. As you would with any library, if you run into problems, feel free to file an issue on the GitHub repo for the library. Bear in mind, though, that most of these libraries are supported by a single person and you should be patient about receiving a response.```
It is not enough. π
I want to clarify the difference, but also give the Community Bundle its own space. So I don't want the entire description to be "Here's how this isn't the Adafruit Bundle."
Is is possible that it's sending the header an extra time after it sends everything? There seems to be an extra 28 bytes that it wasn't expecting.
I think the writeup @idle owl only thought (and not sure if its needed) to say that the community bundle being libraries the community wrote that they didn't find in Adafruit libraries or was to help on their own projects... something to that affect
Ah good call.
did you intend to ping me ? I'm sorry, I have no idea about that
@gilded cradle that is deliberate so that empty directories get a response
The server will reply with n+1 entries for a directory with n files:
I did! Apologies, I thought you had libs submitted to it. Sorry about that!
Ok cool, I'll just update the code so that is expected. Seems to be working otherwise.
Eh? ```The CircuitPython Community Library Bundle is made up of libraries written and provided by members of the CircuitPython community. These libraries are often written when community members encountered hardware not supported in the Adafruit Bundle, or to support a personal project. The authors all chose to submit these libraries to make them available to the community.
These libraries are maintained by their authors and are not supported by Adafruit. As you would with any library, if you run into problems, feel free to file an issue on the GitHub repo for the library. Bear in mind, though, that most of these libraries are supported by a single person and you should be patient about receiving a response.```
That sounds good to me. Question though if someone tried to reach (say me) and it's been a long time and no one can reach the contributor would you pull the library from the bundle?
Hmm.
Good question. I want to say no. I guess if it reached a point where it was entirely unusable and no one could be reached to the point that it was causing support issues for Adafruit, I would consider it though.
But we would deprecate our own stuff in that case.
So I think that's a reasonable standard to follow.
Yeah just was th inking in regards to the "patient about receiving a response". I think most contributors will strive to respond but wonder if its worth adding something like "... patient about receiving a response. Remember these are not paid employees of Adafruit"
Ah fair enough. Yeah I can include that.
Remember, these folks are not paid by Adafruit, and are volunteering their personal time when possible to provide support.
That is good (better then what I wrote!) and may have alleviate anger at the contributors and Adafruit (hopefully) if an issue arises
Eh... if it's going to happen, it'll happen whether or not this guide is explicit. π
But yeah, we'll have something to point to at least.
very true. If nothing else helps Adafruit fend off the complaints. I almost hope one day my code is used enough I can make someone angry I don't tell them exactly how to use it π
That's like the first time I did git blame when it turned out to be me!
Looks like this might need to be updated: https://circuitpython.readthedocs.io/en/latest/docs/troubleshooting.html
If nothing else, Download the appropriate flash .erase uf2 from the Adafruit_SPIFlash repo. is incorrect, because it is not a .erase file.
And there's no mention of storage.erase_filesystem().
Fixing.
Clarify things, update URLs. Add in the storage.erase_filesystem() method, and remove errant . that confused a user.
@onyx hinge @slender iron @tulip sleet Construction continues here, I may or may not be able to run the meeting on Monday. I won't know until Monday how bad it will be. I think they're scrambling to finish before weather stops them, and so it's worse than usual. Also would appreciate a backup recording regardless since the last one I produced was borked. Anyway, heads up. I'll keep you posted.
@slender iron the costume is just plain awesome. Thank you, Becca!
There aren't any .uf2's in the release directory in this repo. Maybe we made them by hand a long time ago. The alternative is to use Arduino and upload the program, or use the precompiled ones that are in the guide.
@tulip sleet Should I simply point folks to the guide then?
Since I don't want to recreate that entire list in this page...
@dhalbert Should I simply rewrite both of these sections to point to the CIRCUITPY Drive Issues section on the Troubleshooting page in the Welcome to CircuitPython guide? It's clearly explained there, and I don't think duplicating all of that here makes sense.
Yeah, I think that would fine, and we can then revise the guide without having to do a pr
Keen thanks. I replied on GitHub to the same effect for continuity.
My brain isn't working today but a question about a PR. The Adafruit_CircuitPython_Logging moved the adafruit_logging.py file to init.py in the folder adafruit_logging. You should still be able to just import adafruit_logging and it will work correct?
yes
Good thing my explanation was more complicated, because Neradoc beat me to it, and I would have been wrong π
Thanks @jaunty juniper I was worried the PR may break the learn guides using it. But my python is not great and my brain is slow today
import adafruit_logging imports adafruit_logging/__init__.py
Because you might have to access it differently, even though the import won't change.
Ah..
What else is in there then?
Why was it moved to init to begin with?
https://github.com/adafruit/Adafruit_CircuitPython_Logging/pull/22/
It added a couple helper classes.
Ah ok
hmmmmm
dastels and foamyguy reviewed it but there is a merge conflict and i just thought about not breaking learn guides as I looked at the merge part
I'm not keen on extensions.py either, a class is better in a file with its name file_handler.py
Well, I think the only guide I'm aware of it being used in was written by Dastels. So I guess he might have considered that if it was going to break anything?
Submit a review π
Updated to point to guide. Added section to Troubleshooting page on getting into safe mode, and linked to that as well.
Thank you for this! I just tried new custom HID reports with the blink(1) USB LED report descriptor (which uses FEATURE reports w/ reportIds) and TinyUSB hid_generic_inout (IN/OUT reports). But I get ValueError: usage_page must be 1-255. The HID report descriptors look like the below, using the 16-bit way of specifying usagePage & usage, and I think the current usb_hid assumes usagePage/usage are only 8-bit. I've noticed this 16-bit usagePage/usage specification is used by several "rawh...
@idle owl I should be around to back you up
Thank you for this! I just tried new custom HID reports with the blink(1) USB LED report descriptor (which uses FEATURE reports w/ reportIds) and TinyUSB hid_generic_inout (IN/OUT reports). But I get ValueError: usage_page must be 1-255. The HID report descriptors look like the below, using the 16-bit way of specifying usagePage & usage, and I think the current usb_hid assumes usagePage/usage are only 8-bit. I've noticed this 16-bit usagePage/usage specification is used by several "rawh...
Thanks for this. I was not aware of >255 Usages and Usage Pages. I opened #5529 for this.
Do you have anything you can test with feature reports that works with the current implementation? If you do, and they don't work, could you open an issue with those results as well?
I finally managed to get a hex compiled locally and flashed and the same happens. @petejohanson was able to flash his ZMK firmware on test hardware and got it running fine. As such, its not really a bootloader issue. ZMK uses Zephyr, which uses its own BLE stack (not the softdevice). This might have an impact but not quite sure.
Does CP automatically initialize/start the SD when starting up? Or does it wait for bleio to get called? Could this be related to the new BLE workflow?
Nord...
Does CP automatically initialize/start the SD when starting up? Or does it wait for bleio to get called? Could this be related to the new BLE workflow?
The new workflow does use the SD from the start. You could prevent that by doing supervisor.disable_ble_workflow() in boot.py. We might use the SD for a few other things, but we don't enable it until we need it.
Smaller embedded C library for ARM development
``` I noticed this in debian. I wonder if it's a good alternative to the newlib we use presently (shipped by arm with their arm toolchain)
Could you open a Long Term "investigate this" issue with some pointers? That would be great. Thanks.
We rely on newlib as implementation of the C standard library and some standard UNIX APIs. This is generally furnished by ARM with their GNU toolchain.
In the past, @tannewt has observed that Arch's newlib is built with -Os, and this saves some space compared to the newlib furnished by ARM.
I noticed that Debian has picolibc which has its home at https://keithp.com/picolibc/ -- I believe it would be suitable to incorporate in CircuitPython.
As Picolibc is a combination of co...
With this bootloader (from INFO_UF2.TXT)
UF2 Bootloader 0.6.2 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Nordic nRF52833 DK
Board-ID: nRF52833-pca10100-v1
SoftDevice: S140 version 6.1.1
Date: Sep 10 2021
Neither adafruit-circuitpython-pca10100-en_US-6.3.0.uf2 or adafruit-circuitpython-pca10100-en_US-6.0.0.uf2 work.
I drag/drop the UF2 onto the drive and it never gets to boot into CP properly - it just goes back into ...
Regarding supervisor.disable_ble_workflow: CP doesn't even get to boot to be able to place/edit the boot.py file.
I have a Keyboard FeatherWing - QWERTY Keyboard + 2.6" LCD (Adafruit PRODUCT ID: 4818) and a Adafruit Feather RP2040
(Adafruit PRODUCT ID: 4884). I have Circuit Python 7 (adafruit-circuitpython-adafruit_feather_rp2040-en_US-7.0.0.uf2) running on the feather and running the example code from Solder Party to test the keyboard and receiving the same error.
`from bbq10keyboard import BBQ10Keyboard
import board
i2c = board.I2C()
kbd = BBQ10Keyboard(i2c)
while kbd.key_count == 0:
p...
Whenever I try to commit using pre-commit for changes to libraries, it fails on pylint (examples code) and I get:
Executable /usr/bin/env not found
Anyone know what might cause that? I use Windows 10, for reference.
Is this for your MachXO pull request?
It's been for a few of mine. It only happens when I run it locally, any time it's done as a Github Action everything works fine.
Gotcha, strange indeed
Also, hello! Just found this channel, so I thought I'd chime in on this one (I'm the author). Happy to change the filename for the new class's file, or provide any other support for documentation, especially if it break things or changes them drastically. Lemme know!
Thanks! We generally accept translation improvements via weblate and encourage you to consider using it in the future.
Hi folks! Does anyone know if there's a significant performance difference when using w25qxx flash devices in QSPI vs QPI modes for a XIP application?
I tried picolibc with the following change:
--- a/ports/atmel-samd/Makefile
+++ b/ports/atmel-samd/Makefile
@@ -197,9 +197,9 @@ CFLAGS += \
-DSAM_D5X_E5X -DSAME51
endif
+CFLAGS += -specs=/usr/lib/picolibc/arm-none-eabi/picolibc.specs
-
-LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
+LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@...
am using PCF8523 RTC with feather RP2040 and can't get it to work. I am using circuit python 7.x.x.x version. I run example pcf8523_simpletest.py and get following error. Traceback (most recent call last):
File "code.py", line 14, in <module>
File "adafruit_pcf8523.py", line 148, in init
File "adafruit_bus_device/i2c_device.py", line 125, in write_then_readinto
OSError: [Errno 19] Unsupported operation
I use PCF8523 RTC with Circuit playground express using example and it works good.
ideas??
I bet it's minimal because anything that does XIP will have a cache to buffer the CPU from any latency
Makes sense! Majority of the code would be accessed from the cache and a transaction after a cache miss might even be the same with SIOO mode
Thanks alot.
This time, WIZnet launched Ethernet HAT and W5100S-EVB-Pico.
Only W5500 and W5200 chips were available in the existing library.
Additionally, I modified the wiznet5k file by adding the W5100S register.
I created a firmware file by putting the wiznet5k library in the uf2 file.
Where should I attach the library that added W5100S and the uf2 file?
Can I upload it to Pull Requests?
GPIO25 on Maker Pi RP2040 is not connected to anything.
Using GPIO0 as its default LED pin instead.
The pylint examples checker is expecting to run on a Linux host. /usr/bin/env is not Windows. (It might possibly run on a Mac, too.) Example: https://github.com/adafruit/Adafruit_CircuitPython_AM2320/blob/3ee77468bbe7145ca57be11d9c3f3343a5e5c686/.pre-commit-config.yaml#L32
I was actually thinking of doing this as a side project, is this something that there's still interest in adding to the main library (instead of the Community Bundle where I would have added it)?
Welcome to Discord! Thanks for all the work you've been doing. It's greatly appreciated! I know you already worked through this PR. Well done! For future reference, most discussions around PRs should happen in the PR comments, if for no other reason than to keep everything in one place. Thank you for picking up on the comments here and making changes though!
@lone axle Can you do me a favor? Scroll up to the top of the "State of CircuitPython, Libraries and Blinka" and check the list of overall authors. If there are any new folks I didn't make bold, can you make them bold? I'm pretty sure I caught all the new folks, but you merged most of the PRs and might know someone else who is new.
yep, will do.
I might be recognising someone from their first PR and not remembering they're new.
Thanks!
I would greatly appreciate a backup recording of today's meeting, as the audio on my recording was messed up last time with no indication while it was happening or why it happened. I am able to run today's meeting as planned - there is construction going on, but at the moment it's quieter than it was last week. I say at the moment, because who knows what will end up happening. π Won't be the first "Construction Edition" we've recorded π
Meeting is in 72 minutes?
My math is terrible, but yes, I believe so. Just over an hour, so yes.
Ok, as expected, one hour earlier for EU (we changed time between Saturday and Sunday).
Ah yes.
I'll skip it for today that is also a day off in my country (not sure why and why not in US... I take the day off when they are offered to me and I don't ask question).
Makes sense!
But I will try to use that time advantage to maybe go to Show and Tell, maybe showing a CP project. π
Excellent!
I just tried a test recording to ensure OBS setup is good. Seems like it should be. I will record a backup when we do the meeting.
Thank you so much!
We had rainbowio disabled on some boards. Try to reenable it, and see if some fit right now.
Sigh. Of course it now gets loud.
<@&356864093652516868> Meeting is in ~15 minutes! Please add your notes to the document if you want to participate or wish to have them read during the meeting. https://docs.google.com/document/d/1a51XK_vdeGpNmDW2_LaNkq26y7VZr2VaOBVIkhj8irw/edit# Talk to you soon!
OK I just became a convert to the fancy "only build changed boards" feature of Actions. I got this result much faster than otherwse. https://github.com/adafruit/circuitpython/runs/4070903706?check_suite_focus=true
Video is available here on YouTube.
@idle owl shouldn't this just say "Video is available on YouTube." ?
No...?
It's text
It's the word here I'm asking about
I did get the markup wrong, corrected.
OK I changed the template doc
@lone axle How's the backup recording looking
Calendar (for adding to your calendar app): https://raw.githubusercontent.com/adafruit/adafruit-circuitpython-weekly-meeting/master/meeting.ical for viewing online: https://open-web-calendar.herokuapp.com/calendar.html?url=https://raw.githubusercontent.com/adafruit/adafruit-circuitpython-weekly-meeting/master/meeting.ical
@thorny jay Most of the US switches from summer to winter time next Sunday. The next meeting is November 8 at 2PM EST, which is UTC-5. (I was just noting that for Scott to read at the wrap-up)
Explore basic embedded hardware concepts with Kira Hartlage while she demonstrates how to use CircuitPython to control a Circuit Playground Bluefruit circuit board.
The Circuit Playground Bluefruit has a microcontroller board and various sensors such as LEDs, capacitive touch buttons, motion sensor, thermistor, phototransistor, microphone, spea...
Melbourne MicroPython Meetup 27th October 2021
I put the moving eyeball in our door for tonight. Super janky but should last long enough for trick-or-treating. Thx @adafruit QTPy & CircuitPython! https://t.co/FUdUbKzDSR https://t.co/kdoJJgeFqd
My Halloween project for this year. #itsybitysM0, #circuitpython @adafruit https://t.co/MS5iTMYBbH
You beat me to it!
@lone axle I probably would implement it different now but there's a selection list in jeplayer.
Nice ty for the pointer, I'll take a look at it for inspiration that can be drawn.
The next CircuitPython Weekly is November 8 Eastern STANDARD Time or UTC-5
and in summary that is why daylight saving time should be abolished π
Have a great week all!
Thanks all!
Backup recording seems good. It's uploaded here in the event that it's needed: https://www.dropbox.com/s/6ue37ww2wx2zqc1/circuitpython_weekly_2021-11-01.mkv?dl=0
Awesome, my recording missed the start of the stream but now I've got a obs scene setup for the future just in case
Great!
Thanks for trying some of these. The simmel is a special-purpose nRF contact-tracing board, so everything irrelevant was turned off. So I'd say just do the sensebox_mcu
Using picolibc 1.7.3
and gcc version 10.2.1 20201103 (release) (GNU Arm Embedded Toolchain 10-2020-q4-major)
I can build 4922e67b8c35ae3f87919c15ddf16efa62a2a4a5 with
--- a/ports/atmel-samd/boards/common.template.ld
+++ b/ports/atmel-samd/boards/common.template.ld
@@ -1,4 +1,5 @@
/* Template for SAMD21/SAMD51 linking. dollar-sign-curly-bracket items are replaced with strings. */
+E...
I think this is because we are writing more info to boot_out.txt, but the code that checks to see whether boot_out.txt needs rewriting is not taking that new info into account. So boot_out.txt is being rewritten on every hard reset. That rewrite delays for 1.5 seconds, which would explain the longer boot time. The rewrite also explains the wiping: if you remove power in the middle of the write, it will corrupt the filesystem. I'll work on a fix.
@tulip sleet dangit I had noticed the boot_out.txt "caching" not working but didn't file a bug. Note also that if there's a boot.py I think it gets written every time too; this is more notable now that so many will use it for tuning usb properties
@tidal kiln By the way, I'm currently writing up documentation on loading part of a library. Specifically for LED Animation library, but the concept will apply to anything with multiple modules that can be partially loaded on a flash-constrained board. I will have you look over it to make sure I'm not creating a support nightmare for you and the rest of us with it. But wanted to mention it in case you had any suggestions heading into it versus only waiting until I'm done.
okie doke. yah, no suggestions. so will just take a gander when done.
Thanks!
Here is the notes document for Mondayβs CircuitPython Weekly meeting. It is at the (somewhat) normal time of 11am Pacific / 2pm Eastern STANDARD time here on Discord. The time may be different in your time zone! 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/13krd3FcC82ir_a0DBnJMaq0OEqJzY_bPgHg_5bhufWQ/edit
CircuitPython Weekly for 8 November 2021 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 participate,...
should we create a 7.1 milestone?
Makes sense. Along with a release, heh.
Please create a pull request to the existing library that you added the W5100S support for.
You could also create a new library for the new chipset. Instructions for creating a new library are here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library
We won't redistribute a uf2 here. You can redistribute it yourself if you really want it bundled in the UF2. Otherwise, I think it's best to get the existing library update for the new chipset and then it'll be available...
I think the community bundle is fine. It's got good visibility through circup.
So uh.... I've got this QT Py running 7.0.0 fresh, and it's not auto-reloading on save of code.py or when files are copied over.
No boot.py present
I have to ctrl+d every time to get it to reload.
I feel like I had this happen before and either a reboot or unplug/replug fixed it.
It didn't click that it was happening the same way as before until now. I kept reloading it manually like that was normal for at least 15 minutes π
Yah reboot via reset fixed it.
I wish I could replicate it. π
I have noticed that happen sometimes too, I think only on M0 boards ? not sure, hard to replicate
Yeah I don't remember what board did it before. Bleh.
Hmm.
I don't use SAMD21 enough to have it happen very often.
Which based on all the effort I have to go through to get parts of the LED Animation library loaded via command line, I'm kinda glad I don't deal with SAMD21 much.
Nice! Did your build work? Was the size any better than with newlib?
- Fixes #5514.
boot_out.txt was getting rewritten every time, because the contents check did not include checking for the new Board ID: info.
I checked to see whether a longer concatenated string or two string comparisons was smaller in terms of firmware space. The latter was better.
I also reduced the time spent waiting for stable power from 1.5 seconds to 1 second.
Note that the existence of a boot.py will cause boot_out.txt to be written every time, since we don't know ...
@gilded cradle blinka install on pi zero 2 w worked with no issue π got an LED blinking away
Awesome @tidal kiln. Thanks for testing.
I'll need to add a board to cp.org now π
np. thanks for updating!
Oof. Another feature of the LED Animation library no longer works on SAMD21. It definitely used to. I'm not missing something regarding how MemoryError works, am I? It's completely irrelevant to flash space, correct? Which is to say, CIRCUITPY can be full up and it doesn't affect Memory allocation failure? I feel like the answer is "it's unrelated", but I'm second guessing.
Also I get how the number of bytes it fails to allocate has to do with the amount of contiguous space available, but I still find it weird at times how the numbers increase when removing code. As in, I get why it does that, but the raw values still make me look twice.
Correct. MemoryError is due to RAM limitations
Ok that's what I thought but then made myself second guess it. Thanks!
with asyncio around the corner, libraries need to be adapted... it is something like adding in yield points?
It sounds like one of the first things Dan's planning to do is adapt the LED Animation library to work with asyncio. I'm not sure how he intends to do it, but I also got the impression he's not certain yet either. I could be wrong about that though. It's simply what I picked up from our meeting earlier.
There are still a few things to try apparently, and then moving forward with whatever it turns out works best.
cool, thanks, I'll watch the changes there
Requests is really in need of some async
Keen. And yeah, that's a valid point as well. Once it's sorted, others can pick up other libs as well!
To that end, @tulip sleet when you get started on adapting the LED Animation library, if it makes sense, consider posting a link to your fork and working branch so interested folks can follow along.
Did you intend to include async changes here?
These changes look to be async related.
Does anyone know how can I get this dashboard and related code?
https://www.youtube.com/watch?v=yJs2y2HMmiw
Our new Feather Bluefruit Sense is available in the adafruit shop - its jam-packed with temperature, humidity, pressure, sound, light/color/proximity, and motion/orientation sensors. Even has a lil button! How to test it out? Melissa coded up a dashboard in javascript, using a Chrome browser you can visit the webpage, pair with the Feather and d...
The link above doesn't give instruction of how to use it.
Anyone have an idea what could be causing a difference between these two functions?
def test_save():
data = b'\x10\x00\x00\x00\x82\xa4name\xa4some\xa3num\\'
print("len data: {}".format(len(data)))
microcontroller.nvm[0:len(data)] = data
def test_save_broken():
b = BytesIO()
data = b'\x10\x00\x00\x00\x82\xa4name\xa4some\xa3num\\'
b.write(data)
b.seek(0)
val_to_write = b.read()
print(val_to_write)
print("len val: {}".format(len(val_to_write)))
microcontroller.nvm[0:len(val_to_write)] = val_to_write
The first one seems to work as expected and results in the data getting saved into nvm. The second one results in a hard lockup. Thumb drive and serial stop responding until I unplug / replug. Once it comes back up the nvm is filled with \xff values instead of the data.
@lone axle I'd use a jlink to see where it is hard locking up
I'll try to get set up for that. I have one but never used it for debugging. Only to write something to fix a device that got messed up once, dan walked me through it. I think that was not on this PC though, I'll have to get that stuff setup on here. Does the pico expose pins that can be used for debugging?
ya, I think they are on the end of the pico
my gdb tutorial is similar to my rp2040 process
does that match ? https://github.com/adafruit/circuitpython/issues/4867
that bug is still there, and also causes a complete erase of the NVM (0xFF everywhere)
interesting. It does seem like the same symptoms.
as if it crashes after the erase part of the erase-write cycle
in my tests it happens (almost) consistently when writing twice basically
Ah, hmm. It does seem like my first function from above can cause it too. I never tried multiple. But I just tried to run it again now and it did hang.
Definitely did get a successful save a bit ago from the first one. I have never gotten a successful save from the one that uses bytesIO yet I think.
Ooo I think I had one that hung, but actually had the real data in it when it came back
maybe writing a bytearray for some reason causes multiple writes ? (that would be a thing to fix too !)
I'll try to get the jlink set up later. I'm interested to see if the original thing I was working might be working correctly on other ports.
I'm working on a helper lib that uses msgpack to store and retrieve structured data easily and persist it with nvm.
I was trying to repro your BytesIO case, but it worked, until I realized I was on my clue
on the pico it does hang first try so far
nice, that probably bodes well for my test
No, this was a git mess-up. I added only certain files, but must have missed some.
Indeed it's working on esp32s2 as well! π can save and retrieve arbitrary objects like:
nvm_helper.save_data({'name': 'some', 'num': 92}, test_run=False)
print(nvm_helper.read_data())
Force-pushed correct changes.
New design:
- capture output to a vstr
- compare the complete vstr to boot_out.txt
- rewrite if not a complete match
This is resilient against future changes to the automatic text written to boot_out.txt.
This also fixes rewriting boot_out.txt in the case where boot.py prints something.
Perhaps it also saves a bit of code space. Some tricks:
- no need to close a file in read mode
- no need to switch on/off USB write access, going down to the oofatfs layer doesn't check it...
Board added to Circuitpython a monthish ago. Hasn't had a website download page prepared yet.
What happens if a write goes past the end of the vstr? Does it just discard the overflow?
How did you test? The easiest way I found to test whether a rewrite happened or not was to lengthen the 1 second delay to 10 seconds. I had a code.py that blinked board.LED, so I knew when it started.
I don't have any cp boards to test my builds right now (I was working on a new port when I saw this issue). In terms of size I saw a 0.12% increase in text, 16.78% increase in bss
~/circuitpython/ports/atmel-samd$ arm-none-eabi-size build-trinket_m0/firmware.elf #picolibc
text data bss dec hex filename
185588 320 12584 198492 3075c build-trinket_m0/firmware.elf
~/circuitpython/ports/atmel-samd$ arm-none-eabi-size baseline/firmware.elf #newlib
te...
Boilerplate has been added to download pages on circuitpython-org by #753 on how to flash the bootloader on esp32-s2 devices, so perhaps this issue is redundant at this point.
Implement an API to monitor WiFi packets.
import wifi
monitor = wifi.Monitor(channel=1, queue=128)
while True:
packet = monitor.packet()
if packet != {}:
print(packet)
Thanks @anecdata for collaborating on this.
@kattni what do you think? this "simmel" board doesn't have a neopixel built in nor is it intended that anyone would add one on.
@jepler If there's definitely no reason to use RGB LEDs with the simmel board, then I agree, it's probably not worth including. That leaves that space available for future modules that make more sense for it.
This was originally found by a user in the forums at https://forums.adafruit.com/viewtopic.php?f=19&t=184484&p=895677. I was able to reproduce the issue by following the guide at https://learn.adafruit.com/magtag-google-calendar-event-display.
Here's the stack trace
Traceback (most recent call last):
File "code.py", line 246, in
File "code.py", line 84, in get_current_time
File "adafruit_portalbase/__init__.py", line 411, in get_local_time
File "adafruit_portalbase/network.py", ...
Transferring to CircuitPython since the issue is dependent on the version of CircuitPython and the fix is probably also in the core.
Looks like this got reverted from
return mp_obj_new_int_from_uint(uxQueueMessagesWaiting(self->queue));
Thanks so much for doing this! I really think making it easier to find the Community Bundle is an important thing. I really appreciate it.
I suggested a change to the copy below. I think it's formatted properly, but please verify before accepting the suggestion.
@proven garnet Are you around? (edit: I replied on GitHub anyway.)
@tulip sleet @onyx hinge what boot_out.txt PR(s) do we want to merge?
Good question. Not both unless I overlooked something about Dan's.
Headed out for lunch shortly, can discuss later if helpful
Any reason my terminal interacting with the disk image I have setup for CircuitPython would suddenly start taking way more time than usual to interact with it?
As in I change directories, or switch branches, and it takes significantly more time than it did two days ago.
I restarted the terminal, and ejected and remounted the disk image.. no change
Up to 2-3 seconds for every interaction.
@onyx hinge @slender iron Jeff's is better, and I would approve it, but I asked some q's.
Have been neglecting my notifications
i was just trying to fix what seemed like a relatively urgent problem quickly
Overall this looks really good. My only question is whether it should go in a new module so that we can enable/disable the functionality separate from wifi connectivity. That'll make it easier to shrink small builds. It could be a wifimonitor module of its own.
It is not happening interacting with any other repos, but all others are local, not in a disk image.
@tulip sleet kk, sounds good. I'll drop a note on your PR.
What happens if a write goes past the end of the vstr? Does it just discard the overflow?
The allocation is increased, until it fails. This means you could now MemoryError yourself if boot.py produces a lot of output.
How did you test? The easiest way I found to test whether a rewrite happened or not was to lengthen the 1 second delay to 10 seconds. I had a code.py that blinked board.LED, so I knew when it started.
I temporarily had code that turned the LED red during the 1 se...
This PR will likely be closed in favor of #5536
is there something going on in System Monitor? Is it doing a backup?? Time Machine, etc.
I can look, but why would that slow down only that thing? π Checking.
That's not it.
Nothing out of the ordinary in there.
I mean, it's working, but I do anything, and it takes 2 seconds to complete. It's bizarre. And, if it continues long term, a massive time waster. Bleh.
What happens if a write goes past the end of the vstr? Does it just discard the overflow?
The allocation is increased, until it fails. This means you could now MemoryError yourself if
boot.pyproduces a lot of output.
That's a bit of a pathological case, but I think the exception should be caught if possible so you don't get no output, which is what would happen.
If it's hard to catch the MemoryError, then you could just truncate the output after some relatively small amount (a few thousand chars), and add an ellipsis or something.
@idle owl next thing I would do is reboot
Ok. Yeah, fair enough.
Thanks for the suggestions! I hate rebooting so I always try every other possible thing first, but sometimes you simply have to turn it off and on again.
I'm not sure why any of our stuff failed on the Pylint f-string failure, it's not even in 2.7.1 and that's the version we pinned in pre-commit.
We added it to the pre-commit-config.yaml for examples, I guess that was futureproofing.
@onyx hinge When you're around, I'd like to implement the change to the Pylint example hook in the pre-commit-config, but I am struggling to read your git diff or patch or whatever you posted to that issue. What I put into the test file is already complaining about not being formatted properly and I think it's simply because I don't understand exactly what your change was.
Ping me if I don't get back to you in an hour
Will do.
@ruby atlas I haven't figured out what this means: Animations that support cycle complete notifications will have X property set to False., in various on_cycle_complete() in the anims library. I don't know what the "X property" is.
not urgent
Sigh. Reboot didn't fix it. And it's happening on a local repo now too - I submod init'd the entire bundle for reasons, and it's taking forever to do things in there now too. So I guess it's suddenly being slow on giant repos. π
How do I send the output of a command to a file.
| something?
something >log.txt
ok thanks
i am a bit worried about the health of your SSD.
Seriously? That would figure. I have a new machine on the way, but won't see it for another month at least. Of course this one would decide to die before it gets here.
I need to hook up my backup drive at least.
is it only in repositories ?
Yeah, and only big ones.
like if you cd .. out of it, do you see something slow ?
So the entire bundle initialised so every lib is loaded, or the CircuitPython repo
are you using something like starship ?
it could be something running in your shell prompt that takes some time for some reason
what does echo $PS1 say
@tulip sleet From where? Inside a repo or in a new window?
just in a terminal; it should not change
\n\! \u@\h:\[\e[35m\]\W\[\e[0m\]$(virtualenv_info) $(__git_ps1 "\[\e[32m\][$(time_since_last_commit) %s $(tip)]\[\e[0m\]")\$
I have fancy git stuff in my prompt.
if that's what that's related to.
Which it kinda looks like it is
But again, it's only causing issues in big repos.
so set it to something boring in one terminal: set PS1='>'
and see if it's faster in the slow repos
that only changes it for one terminal?
yes, just temporarily
and the prompt is now just >?
nope
what does that say ? echo $PROMPT_COMMAND
Tried running this again inside the repo, takes ages, and nothing happens.
(on my computer it's starship_precmd for example)
Mine is _pyenv_virtualenv_hook;
That worked. And now it's blazing fast.
Sigh.
I'll deal with slow if it means getting rid of my fancy Git info to speed it up
I don't understand why it would suddenly change though
it's never been an issue before.
Computers are jerks.
my fancy starship prompt takes around 2s I'd say (in the CP repo)
Fair enough.
It's never done this for me. But I'll deal with it to not lose the info.
I'm stunted without it.
I'm so used to having it
A friend help me set it up, I don't even know how to tweak it to try to fix it.
it used to be worse, I don't remember if I changed something or it "fixed" itself
Heh yeah
(I'm using https://starship.rs/ in bash)
What does it actually look like to you?
If you don't mind me asking
Mine is this:
It shows different things for different git statuses.
Different symbols.
yeah it uses a few magic symbols like [!$] to tell me there are modifications and new files
and it tells me the time a command took on the next prompt if it takes some time
Neat
but sometimes it tells me that:
[WARN] - (starship::utils): Executing command "git" timed out.
[WARN] - (starship::utils): You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing.
@idle owl ready to type or video about the pre-commit stuff now
or, well, I would go sit in a different spot to video
Sure we can vid. Should be quick.
ok I'll head to the webcam
we may start seeing CI issues due to this. atleast some libraries are using 3.6. https://github.com/fsfe/reuse-tool/issues/427
I was seeing it in datetime
or maybe most/all of the repos are shifted to python3.7 by now
turns out I was operating on an out of date datetime
@idle owl can you give me some examples of LED animation code that right now uses a lot of tricks to be interruptible or to change things? I read through the library (and see the "cycle completed" callback capability). I also looked at the BLE remote control animation guide. It seems like it would be OK as is, but maybe it is slow to respond?
Hmm. I feel like every time I've approached this, it gets shut down because of being too complicated. So I'm uncertain as to whether there is a good example. The BLE code yeah, but what do you mean "maybe it is slow to respond"?
well, you send a command to change, and it takes seconds to move to the next thing, because the current animation cycle is long?
There seem to be a bunch of capabilities in the library that I don't see examples of use for
Oh, that's totally true.
capabilities to catch when a cycle is done, etc.
Some of that was added because folks requested some thing, or we needed something... etc.
maybe I should talk to Rose about it, since there isn't a lot written up
So if it was a community requested thing, the applicable example may never have made it to our stuff.
She's definitely the one who would know. I'll mention it to her. We've been bonkers busy lately, so making time isn't easy. Might have to be later in the evening if that's ok.
@tulip sleet Very little trickery here. https://learn.adafruit.com/cheerlights-led-animations/code
yeah, that's fine, i will be taking a break for a while around 5 for a walk and making dinner
i will look at the issues and PR's in the library too
Sounds good.
@onyx hinge The whole point of Weblate is that you don't need to know C to contribute, right?
I mean there's more point than that
but that's part of it right?
@idle owl not much about C. You need to know some things about %-substitutions that are specific to circuitpython, and to know about \r\n and those kinds of stuff
(like, nothing I know of uses %q as a %-format to mean "some string"
Community Bundlers, check it out! We added direct links to the Community Bundle to the https://circuitpython.org/libraries page. I wanted to showcase it more than we were, and make it easier for folks to find it.
Thanks Kattni! π
You're quite welcome π
@idle owl should this be archived?
https://github.com/adafruit/Adafruit_Python_PCA9685
Yeah definitely. You've gone through archiving before, yes?
yes
Right on. Yeah, deprecate it for the CircuitPython lib.
ok. thanks. will do.
@idle owl done
Cheers!
@lone axle Greetings! Are you around and do you have a moment?
Sort of around. But don't really have a moment. Preparing for class that I am teaching starting in about an hour.
No worries! This can wait. I'll make a note to ping you tomorrow sometime, and you can get back to me whenever you have some time at that point.
@tidal kiln No rush on this, but if you want to check out the new CircuitPython.org section on this page, I'd appreciate it. Anne hasn't checked it yet either. But it's in pretty much every board guide, so I'd appreciate any feedback you have as well. https://learn.adafruit.com/welcome-to-the-community/welcome-to-the-community#circuitpython-dot-org-3105440-6
@idle owl looks good. maybe add level 3 header text to separate each tab section?
Good idea. It got longer than I expected it would.
Yeah, added. They won't have their own links, but that's ok. They're at least better.
Refresh?
See if that's what you meant
yep
Great! Thanks for the feedback.
np
@tulip sleet I may have succeeded in securing some of Rose's time π
Now this boot.py:
for i in range(1000):
print(i)
creates a 512-byte boot_out.txt that ends
88
89
...
I like it! Thanks for fixing this well.
I've ben having a time with a similar issues. mikeysklar over on the Adafruit forums suggested I post this suggestion here.
(Here's the thread: https://forums.adafruit.com/viewtopic.php?f=62&t=184158&start=15)
Would it be possible to add a parameter that can control the minimum lengths or even turn them off? This would allow people who aren't doing IR-related projects to get more functionality out of the PulseIn feature.
This is for returning queue property set in the constructor.
Instead of returning uxQueueMessagesWaiting, I chose to implement the loss method.
... whether it should go in a new module ...
This can be considered in future... we have plenty of space to play with on espressif boards for now.
Any thoughts on where I should poke next?
Is this an incompatibility between bootloader and CP? Is there a combination we know worked in the past?
The PCA10100 was added after 5.3.1, but is in some alphas and betas shortly after. So try the earliest builds here and see if they work: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/pca10100/
Then also try earlier versions of the bootloader, from around that time. The PCA10100 was added Nov 11, 2019, but I don't know that it was tested at that time. On the other hand, presumably the people who added the board to CircuitPython originally presumably tested the firmw...
@xobs Are you still using the PCA10100 or simmel? Do you have any ideas about why @jpconstantineau might be having problems? Thanks.
Monitor depends on part of the wifi init. If we want to separate the modules at some point, that could presumably be coordinated, or duplicated with error checks, or split into a separate shared module.
Just a note that Espressif says you can do Station or AP while Monitor is running, I haven't had good experiences with that. First because Monitor processes so many packets, and also if there is a connected Station or AP, then Monitor is limited to just that channel.
So currently Monit...
Updated the nvm.toml module and lots more boards started to fail... The module brought in a few more new files and I suspect that it's these that are causing the issues. I only tested with my files (puya)
What's the plan? Cherry pick or figure out what's wrong with these other files?
Is there a way to get where the toml processor fails?
No, sorry. I haven't used the NRF52833 hardware in a very long time.
The builds are still working on recent PR's. Have rebased or merged from upstream since the builds started failing? Your toml submodule appears to be out of date now according to the file comparisons.
@xobs Did you use the Adafruit_nRF52_Bootloader? The first release the PCA10010 in is 0.3.0 - 2020.01.13
If so, do you think it would be that release? Timing looks about right...
Thanks. That will give me something to compare with...
By having a pair of buffers, the capture hardware can fill one buffer while
Python code (including displayio, etc) operates on the other buffer. This
increases the responsiveness of camera-using code.
On the Kaluga it makes the following improvements:
- 320x240 viewfinder at 30fps instead of 15fps using directio
- 240x240 animated gif capture at 10fps instead of 7.5fps
As discussed at length on Discord, the "usual end user" code will look like
this:
camera = ...
wi...
We can close this if it's not in the plans to add. I think the collections.OrderedDict solution is workable.
@lone axle Good morning! I have something to discuss. When you have a few minutes, let me know. No rush!
Quick update...
I tried a bunch of bootloader releases and CP releases:
Bootloaders:
- 0.3.0 Loaded fine
- 0.3.1 Could not load bootloader on hardware
- 0.3.2 Loaded fine
- 0.4.0 Bootloader drive did not mount
- 0.4.1 Bootloader drive did not mount
- 0.5.0 Bootloader drive did not mount
- 0.5.1 Bootloader drive did not mount
- 0.6.0 Bootloader drive did not mount
- 0.6.1 Loaded fine
- 0.6.2 Loaded fine
CircuitPython Builds for PCA10010:
- 5.4.0beta0
- 5.4.0beta1
- 6....
@ember iris How goes the list of Python resources you were doing up?
I'm finally almost to writing up that page in the Welcome guide.
π
I haven't actually gotten back to the FAQ since mid Oct
Are there specific kinds of resources you're thinking of? I was working on organizing it into learning mediums--youtube videos, books, blogs, tutorials, that way the FAQ didn't say, "This is THE WAY to learn", but stressed that there are lots of ways to approach learning the language
Different kinds would be nice for that same reason. The page is titled "How Do I Learn Python?"... it was more Dan's baby than mine, so I'm genuinely still pretty fuzzy on what the page should look like. But, I think the idea is providing some beginner resources to learning Python in general.
Ok, I can work on that tomorrow (maybe today as well).
I've got a highlighted question, "What is the best way to learn python?": "Let me know if you find it" entry with a footnote for me to talk about how everyone learns the language differently and not to be disheartened when things are tough followed by pointing the resources entry and starter projects entry,
it seems to line up with this so it'll be good to work on it
That's a good thing to include on this page. I like it.
Thanks so much! I appreciate the assist. I have one link to the Python beginners guide for non-programmers, but ... that's kind of lacking for an entire guide page.
Yeah, it's such a frequently asked question in all the communities I'm a part of. It's just a hard one to answer, and harder still to explain why it's hard to answer
Well, I can definitely help. We can work together on this one.
Woo! I need to focus on the FAQ so that'll be a huge help
Excellent. If you want to put it in a Google Doc or something you can share, where we can both work on it, that might be useful.
Then I can include it in the guide, and you can include it in your docs.
Um, let me see. It's in notion but it's through the python discord so I'm not sure how the permissions are managed
I have no idea what notion is π
I'm on the Python Discord if that helps. (But I think you knew that.)
I didn't either until Joe added me to it
Hah!
I've got some time now, or I should be around mostly the rest of the day.
I'll ping you when joe get's back to me about how the notion side of the organization handles permissions. Worst case scenario I copy it to a separate platform so we can work on it, and just copy and paste it when I need the pydis staff to go over it. It's in just it's early draft but it's got a really good set of questions highlighted
Right on. Sounds good.
Nice, ok. So you did the magic to put the Hacktoberfest topic on all the repos. I assume it's still there, and we need to remove it. But, another issue is Adabot did not remove the hacktoberfest label from all of the issues. I imagine there's something in the API to do this (as I think that's how Adabot was supposed to do it). Sommersoft fixed Adabot adding the labels, but apparently there's an issue with removing them now. And sommersoft is very intermittently available. So! I'm wondering if you can double-up your magic and remove both sets of labels?
Yep, The process for removing them from the repo will be basically the same as adding them (the API only exposes an "update" action that you pass a list to and it sets all the ones in the list). I can work on scripts for that in the next few days. Issues I'm less familiar with but I would guess it is probably possible as well. I'll look into that as well.
I guess one place to start would be to look at Adabot, look at the fix sommersoft did for adding the labels, and see if maybe there's a simple fix to making Adabot do it.
Before trying to figure it out yourself.
Adabot is mostly a mystery to me, so I'm not much help there.
mostly.... heh.
I don't have much experience with it either. I should poke around and learn more about the different things it can do. I have found the Github CLI to be very helpful for making these automated changes. Maybe there is some opportunity to improve or extend the currently functionality in adabot by using that CLI.
Distinct possibility.
looks like the CLI does provide a way to remove labels from issues as well, so that should be fairly straightforward as well I think:
$ gh issue edit 23 --remove-label "core"
It is a gnarly mess. Built like Venice. One thing on top of another.
Oh right on.
Could you explain further how you are using PulseIn? I'm curious what you are using it for.
... whether it should go in a new module ...
This can be considered in future... we have plenty of space to play with on espressif boards for now.
Splitting it now is much easier than doing it later. Aren't we running out of space on some boards due to the OTA partition?
I'm fine leaving it open. It is something we'd want at some point to match CPython.
@jpconstantineau Do you have a jlink? You could use that to see how far code execution is getting.
I wish I could test more bitmap stuff within the Unix build. but I don't want to implement displayio fully. I see 3 options:
- stub out the actual display types on the unix build
- separate out the actual display types to their own modules, like parallelbus already got
- take everything but the display & display bus types to
displaycore, a hypothetical new module
@slender iron feelings? ^
(I think stubbing out the display types means stubbing out i2c and spi which seems like a fair amount of work for nothing)
I have a small board that's designed for props, it controls lighting effects, sounds, leds, stuff like that. It has a feature where it can output a PWM base on the intensity of the sound it's currently producing, the idea being that you can make lights or other devices react to the sound.
I've been toying around with reading the pulses on Arduino using PulseIn, I even made a few small test projects. When I went to port the code to Circuitpython, I found that it's PulseIn returned much defe...
@onyx hinge I have no great options. stubbing has the benefit of not changing any example code or docs. you could theoretically actually implement i2c and spi for linux like blinka does
Don't tempt me
π
Aren't we running out of space on some boards due to the OTA partition?
I checked the 4MB boards and all of them have upwards of 130000 bytes free.
Does anyone have any tips on how to debug MemoryErrors? I'm getting random errors with small code changes, and they don't seem to make much sense. Like trying to import adafruit_datetime with 79000 bytes free, and the error i get is just:
Traceback (most recent call last):
File "code.py", line 541, in <module>
MemoryError:
Not even an amount of bytes it was trying to allocate.
Sometimes it will say it failed to allocate like 300 bytes, which seems like very little considering 79000bytes free... I guess its something else being the problem, it somehow i have managed to really fragment the memory
Queue size is more informative than loss count. Queue filling is a warning sign that loss could occur due to memory or queue full. Do we need to read back the value we set if it never changes? If so, I can PR a new method for queue size once this merges (I can't seem to do a patch on this PR).
is there any other status for the port / support?
on the docs its says only beta and
BLE Connection:
This feature is not yet available and currently under development.
on the circuitpython.org/downloads list at least the search does not find anything related to C3 and in the filter Processor family there is only esp32s2 available.
I do have a jlink (it's included as part of the PCA10010). I never got into using it for debugging... I also have a Black Magic probe.
Sounds like I'll need to learn how to use them to figure out if it even gets into the code. From what I have seen on the nrf52840, when the code faults, it might reboot. In this case, I don't see it enter a boot loop at all. It's goes straight back to the bootloader as if nothing got flashed...
Do we have the right memory/flash mapped to the device? ...
You are correct that it's looking for a single contiguous block of memory, and will fail even if there's plenty left, if the memory is too fragmented.
We have some suggestions starting here, but I'm not sure they're going to help your situation. https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3105286
@idle owl I think the script to remove hacktoberfest topic from the repos is ready. I tested it on a repo of my own and it seems to work properly. We figured out last time that my account does not have permission to update for the adafruit library repos though. I'll need to get another token from you like we did when I added them.
ah right! I generated a temp token for you. I'll do that again.
It needed "repos" permissions right? That was all?
yep, I think that is correct.
Sent!
Got it. Will test 1 manually, then a few with the automation. If all goes well I'll start it running on the rest of the list.
Thanks so much!
@tulip sleet Is this what you had in mind for this page? I'm not done with the libraries section yet, but I feel done with the CircuitPython core section. https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-documentation?preview_token=WsdVgHQVBTr9iHLerIfyWA
@idle owl script is done running on all of the bundle library repos. I figured out how to use github search to check the results as well: https://github.com/search?q=org%3Aadafruit+topic%3Ahacktoberfest there are a few non-library repos that do still have the hacktoberfest topic.
Nice, I'll poke around with adabot a bit tonight and work on the issue labels.
I just merged upstream and the builds are still failing.
The toml submodule has added new files. See here
Unfortunately, more than my files got added and I suspect that it's the other files that are problematic...
Right on. Thanks so much!
Channels 12 and 13 are valid in various areas outside the U.S. For whatever reason, I am also seeing packets on channels 12 and 13 at my U.S. location (monitor.channel does not have a limit check). I suggest the limit check allow channels 1-13.
This is excellent and much more comprehensive than occurred to me to do. I am going to define core modules a bit with some examples, but it's really good.
Thanks. When I finish up the libraries part, I'll hand it over to you then.
I agree we should highlight the core modules part. That's kind of the meat of the sammich.
I thought about doing more detailed things for each section then noped out of that. Too much.
Hey, yβall. Iβve got a question re CP7 debug builds and Express boards with smaller flash.
@slender iron hi - I noticed that MicroPython #defines dummy values for MICROPY_BEGIN_ATOMIC_SECTION() and MICROPY_END_ATOMIC_SECTION() in mpconfig.h, and expects ports to implement them. MPy does: typically BEGIN returns PRIMASK and then disables interrupts; END restores PRIMASK. MPy doesn't use these a whole lot, mostly in the scheduler, which we don't have turned on, but it does use them inside one place in vm.c.
We do not implement these, instead using common_hal_mcu_disable/enable_interrupts and sometimes the similar mp_hal routines. We do not pass PRIMASK around. I notice that you even added a comment in the rp2040 port:
// We don't use save_and_disable_interrupts() from the sdk because we don't want to worry about PRIMASK.
I am going to do something about these ATOMIC_SECTION things, but I'm not sure why you didn't want to pass PRIMASK back and forth. What was your motivation (because the common_hal_mcu routines don't, maybe??)
yeah, you have to turn off some modules to make it fit. π ulab is a good candidate
Ok, got it. Thanks, @tulip sleet I know how to do that. π
@tulip sleet I don't remember why I ignored PRIMASK
Hmm. Apparently circuitpython.org isn't listed in the library API docs. I feel like that should change.
agree
Issue filed. We're running an adabot patch tomorrow morning, wondering if I should simply do it and add it to the patch. https://github.com/adafruit/cookiecutter-adafruit-circuitpython/issues/157
We do not mention circuitpython.org in the API documentation. A link would be updated or added below the following section in the docs/index.rst file: .. toctree:: :caption: Other Links Either we s...
sure, may as well roll it in
Ok, so input then....
Should I add a new link to that list to cp.org or update the "Download" link to be to cp.org/libraries
where does the download link point now, to the github releases?
yeah
could change it to "Download from GitHub" and "Download from circuitpython.org" or something separately
you could say "download individually[->github]" or "as part of the CircuitPython library bundle[->circuitpython.org/libraries]"
yeah
It's not a sentence area, it's a list area.
So I'll make it "Download Library Bundle" and link cp.org
and update the current one to Download from GitHub
yes, i was going to type the same phrasing. There is also info on the libraries page about circup now
OK
@tulip sleet git diff is: ```diff
.. toctree::
:caption: Other Links
- Download <https://github.com/{{ cookiecutter.github_user }}/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize}}{% endif %}CircuitPython{{ cookiecutter.library_name | replace(" ", "_") }}/releases/latest>
- Download from GitHub <https://github.com/{{ cookiecutter.github_user }}/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize}}{% endif %}CircuitPython{{ cookiecutter.library_name | replace(" ", "_") }}/releases/latest>
- Download Library Bundle https://circuitpython.org/libraries
CircuitPython Reference Documentation https://circuitpython.readthedocs.io
CircuitPython Support Forum https://forums.adafruit.com/viewforum.php?f=60
Discord Chat https://adafru.it/discord```
I was going to say harder to read without color, but it's red/green, so I guess it's not so different for you.
If you start your code block with "```diff" I think it colorizes on discord.
hello
-deletion
+addition```
Magical.
Also if anyone wants to take a look: https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/pull/88
Issue 5477. The calculation for number of UART bytes returned under some circumstances could result in a negative number. Since it was unsigned, this meant that a large value would be used and memory would get stepped on. The real issue seems to be that the SDK does not always update the handle.rxData field, but rather than trying to fix the SDK, code was added to UART.c to correct for the situation.
So very looking forward to the pre-commit fix.
Examples take ages. Bleh.
If only I had the time to tweak every library's documentation like I am with LED Animation today. It's all stemming from writing this documentation page in the Welcome guide.... Will involve screenshots, so I'm fixing the docs to look better. heh.
is learn.adafruit.com having issues?
Not for me..
they look more different than usual
Helpful!
Done that and the other you had
I see that, thanks so much! I merged. Was blocked on the LED Animation one, so I really appreciate it!
And it worked on Read the Docs!
Never know that until you merge. Heh.
No problem I miss the e-mails all the time so just wanted you to know.
Thanks!
Ha yeah I was thinking that, at least if it didn't there are two of us to blame π
Eh, it's a mire of mystery at times, no one can really be blamed for that.
I saw you mention that! I like blue, might look into it anyway.
there is a dark version too, haven't tried that
Oooooh.
Very blue.
I realised one issue with it, if I do this - if I take screenshots for folks, it won't look like most folks' setups.
yeah, I was thinking about that too
So.... I guess I'll stick with the regular one simply to make sure I don't create support issues.
You have an actual reason to do it. π
@tulip sleet How would you explain what an API is? "the way code features present to those using it" or "how the features of the library are available for you to use, versus how they work on the backend" or....? We keep talking about APIs but we never actually explain to anyone what an API actually is.
I tossed those off as I was writing that message, I'm not offended by feedback.
for the native modules, I would say that readthedocs documents the functions and classes in each module. Maybe avoid "API" completely, unless that's a page name
"The API Reference page documents the functions and classes in the library"
is this for a library or the built-in modules?
"The API (Application Programming Interface) defines how your program talks to the library: the functions and classes you call upon to use the library. "
could use some cleanup
maybe some other synonym for "calls upon"
Keen
@tulip sleet The API (Application Programming Interface) defines how your program interacts with the functions and classes that you include in your code to use the library.
not "include", because you're not writing them yourself. You are using the functions and classes provided by the library. Maybe just "call" instead of "call upon"
The library provides functions and classes. They are the interface.
they are abstractions provided by the library
"abstraction" is jargony
unfortunately
Changed "interacts" to "interfaces"
Yeah abstraction would require more explanation I think.
The API of a library is the set of functions and classes the library provides. Your program calls those functions and uses those classes to use the library.
I'll try to rework it tomorrow and see if I can make what I have better. I pasted your comments into the guide editor so I have something to work with.
One minor suggestion. Up to you if you want to add more.
This should probably mention what happens to the buffers as well. I'd assume you'd delete their reference so they may be garbage collected after this.
@Neradoc Are you still looking into this? If not, I can work on maturing the poc.
I can confirm this issue; same chips and firmware but different boards.
Adafruit Feather RP2040 with Airlift ESP32 Featherwing, Nina 1.7.4, CP 7.0.0, attempting to start Bluetooth using example code at https://learn.adafruit.com/adafruit-airlift-featherwing-esp32-wifi-co-processor-featherwing/circuitpython-ble with the proper Feather pin settings uncommented.
Resulted in error at line 185 of ESP32.py:
_bleio.BluetoothError: Timeout waiting for HCI response
Unlike OP, reverting to CP...
"An Error, Omission, or Unclear Instruction in Documentation Is a BUG" -- a good blog post about the role of documentation in a project https://blog.networktocode.com/post/show-us-the-bugs/
Receiving documentation bugs from the community helps the authors understand where their blind spots are. For example:
If the docs have too much info, they may need to be reorganized into smaller sections If the docs are too verbose, they may need to be reworded Itβs often difficult for someone who created a solution to understand all the details the users of the solution will need We may need user guides for some topics when: There are a lot of users new to the solution space The user base has varying levels of skills in each of many skill set silos etc.
"Itβs often difficult for someone who created a solution to understand all the details the users of the solution will need" is one I particularly need to take to heart
One minor suggestion. Up to you if you want to add more.
Thanks, I added text to cover this. Needs a fresh review now!
@idle owl the issue label remover is running through the open issues now to remove "Hacktoberfest" label. I did poke around with adabot, and I think figured out how to use it to do this. But when I started it running it stopped after a minute and seemed like it was going to wait essentially an hour because of a rate limit. I tinkered a bit and ended up using something similar to the script that created the "Missing Type" issues. iirc I was able to avoid hitting the rate limit with a small sleep between each action. It's about half way through the "drivers" in the Bundle atm and hasn't hit a limit yet π€.
Based on the error message, I tried making the following edit down in nvm.toml and the error seems to be resolved:
diff --git a/flash/puya/P25Q16H.toml b/flash/puya/P25Q16H.toml
index e4fd193..d7c6903 100644
--- a/flash/puya/P25Q16H.toml
+++ b/flash/puya/P25Q16H.toml
@@ -3,7 +3,6 @@
# This config is still untested.
total_size = 0x200000 # 2 MiB # Page 17
capacity = 0x15
-manufacturer_id = 0x85 # Page 49
write_status_register_split = false
01_continuous_status_write ...
@jepler There is already a PR in the other repo that should resolve this: https://github.com/adafruit/nvm.toml/pull/7
@onyx hinge Thanks for confirming that the removing the redundant line will indeed fix the issue of my PR.
queued and lost working great! I am getting hardfault sometimes when autoreloading or going in and out of REPL a bunch of times. Is there anything more to be done to deinit in those cases?
@idle owl The bulk of the list is done now. A couple of things to follow up on: 1) a few issues had "hacktoberfest" with lower case h while the majority were "Hacktoberfest" with uppercase h. The script I ran removed all the uppercase ones, I'll need to tweak and run it again to do the lower case ones. That is easy enough though. and 2) I found a similar advanced search query to check on this https://github.com/search?p=2&q=org%3Aadafruit+label%3A"Hacktoberfest"&type=Issues which reveals that the issues that were closed did not get affected by my script. Do we want to remove the hacktoberfest label from closed issues as well? or leave it since the issue was already completed?
That's where having a team is important, because you can always have someone else test it to get at least a slightly more userish experience to work with.
This is great! Thank you so much! I think leaving it on the closed issues is perfectly fine - better in fact.
It's possible something else had recently been run? Because it shouldn't have hit the rate limit that quickly.
I was working on this guide page last night, and apparently stopped mid-sentence, and I have no idea where I was going with it. π€¦π»ββοΈ
I hate when that happens
Apart from testing on the hardware itself, this PR is pretty much ready.
MengDu from Seeed on discord indicated that supply is tight right now. Getting some hardware for testing might take a while.
There are some out there right now (Zack Freedman's latest keyboard uses one). Do we get it out now and wait for people to load them up and let us know of any issues or do we wait to merge? Let me know and I'll update the WIP title...
Reread everything before it a few times and.... nope. No idea. Oh well. π€·π»ββοΈ
@tulip sleet Here's what I have now The API (Application Programming Interface) of a library is the set of functions and classes the library provides. Essentially, the APIΒ defines how your program interfaces with the functions and classes that you call in your code to use the library.
If you can get anyone to see if it loads and runs, with CIRCUITPY working, that would be great. The only failure points I see would be the flash definition, and the pin assignments. The latter can be triple-checked, but the former really needs a test with a real board.
Ok, new question. Iβm trying to figure out the SPI flash issue with the MicroMod SAMD51 (the SPI wiring is a little weird, and somethingβs up, because the board boots in safe mode and doesnβt mount CIRCUITPY). This issue has been around since I submitted the port and Iβm just getting back to it.
Iβm trying to debug what;s going on with Microship Studio and a J-link, but the debugger is failing with βError: failed to load ELF executableβ. Iβve built CP7 with `make clean BOARD=sparkfun_samd51_micromod; make BOARD=sparkfun_samd51_micromod DEBUGβ and dropped the .uf2 onto the board. And I can see the board having booted in safe mode. Any ideas? Am I even on the right track trying to debug things this way?
Also, Iβve got some Winbond flash on the way so I can test out the odd wiring config. Because of the way the MicroMod board is set up, itβs kind of hard to probe to see whatβs going on when the flash does/doesnβt work.
Thanks Dan. That's my impression too (pins can be triple-checked but testing with flash can only be done on real hardware). I messaged MengDu to see if they have someone who could load it on their side. I'll want to test it myself as this is the same format as the original Xiao and the QT PY(s) and these are all boards that can be used with my basic macropad/encoder. Having the same pin definition helps in keeping the python code to be the same across all boards...
@tulip sleet Ok I think I'm done with the libraries section on this page. https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-documentation?preview_token=WsdVgHQVBTr9iHLerIfyWA So I guess it's ready for you to add to the CircuitPython section.
this is fine
Thanks
ok, I'll add a bit -thanks!
Keep me posted so I can hand it off to Anne when you're done.
OK, all set, I just expanded this paragraph a bit:
The first section is API and Usage. This is where you can find information about how to use individual built-in core modules, such as
timeandbusio, details about the supported ports, suggestions for troubleshooting, and basic info and links to the** library bundles**. The Core Modules section also includes the Support Matrix, which is a table of which core modules are available on which boards.
Ah fair enough, I was thinking you had much bigger plans π Thanks!
Maybe go for digitalio instead of busio?
sure
Mostly because we have the singletons that take the place of busio a lot now.
ok, done
Thanks!
@tulip sleet Ok, so other then the How Do I Learn Python? page, how do you feel about the order of the rest of the guide right now?
Since this all started from your brainchild.
It's coming down to the end of the update, so I wanted to get your input.
The order looks good.
Ok thanks!
@tulip sleet I'm still not sure what to do with the How Do I Learn Python? page. π
I have one link, and a couple more links from the Python subreddit's WIP FAQ.
How do you want to approach your how do I learn python page?
Fuzzy on that too, tbh. π
Like, do you want to teach the basics of what a program is, or do you want to teach how to learn how to program?
(or both)
Oh hmm
No I think it's more to provide a short list of resources that might help folks learn
Not to actually teach in the page
I want to provide at least one each of different types of resources like book, website, video etc.
Seems like the python.org stuff has a variety
Ok good to know! And aimed at, "never before programmed" groups?
Yeah python.org has a lot of a wide variety of mediums. The main criticism I have is how buried they are on the site
Ooh, maybe both never before programmed AND have before programmed both? Two sections on the page?
Ok
Good start
What is moin anyway. It makes me think someone misspelled main but I realise that's not the case.
Ahhhhhhhhh
I had the same question which I was working on the list lol
That makes so much more sense.
There's also the collection of FAQ's which I think would be worth linking as well
https://docs.python.org/3/faq/general.html
https://docs.python.org/3/faq/windows.html
(this is more advanced:) https://docs.python.org/3/faq/design.html
And I like having a list of, "What can you do with Python"
https://www.python.org/about/success/
(I bet it's possible to reach out to the PSF and ask about adding a bit about circuit and micro python to the success in embedded systems section as well): https://www.python.org/about/success/#embedded-systems
OK, all of these have been copied. I need to break for lunch. Thanks!
@ember iris @tulip sleet I'll shift it up the list in a bit here, but what do you think? And do you have any further suggestions? https://learn.adafruit.com/welcome-to-circuitpython/how-do-i-learn-python?preview_token=WsdVgHQVBTr9iHLerIfyWA
Maybe realpython.com for example? But if that's the only other site we link to, I don't want it to look like we're specially endorsing them or something.
Since everything here so far is official Python stuff.
there is the codecademy course that's in every newsletter./ There is https://www.amazon.com/Getting-Started-Adafruit-Circuit-Playground/dp/1680454889/ and https://www.amazon.com/Programming-Microcontrollers-Python-Experience-Embedded/dp/1484270576/
Usually you'll want DEBUG=1
With a jlink attached you can set a break point on reset_into_safe_mode in order to catch the error before reset
@idle owl those are specifically CircuitPython references. Also the Arduino->CircuitPython guide could be hlepful
Hmm
"One final note:
If you're trying to learn Python and you're having trouble, don't worry! Everyone learns in different ways. If you're working through something and it isn't sinking in, don't be afraid to look for a different way to learn! Everyone learns in their own ways and at their own pace. We hope this gives you the freedom to find your style!"
Maybe something like that? it looks really good as a whole though, I like it
Oh good call. Thanks!
I wish we had a guide on "Learning Programming Basics with CircuitPython" or some such. I mean I guess there's already a lot of getting started resources for Python out there, and it would be rehashing a lot of that at a CircuitPython REPL or whatever, but still I think it could be helpful.
Yeah I was running into that today too. I might do a "Basics of programing for non programmers" page for the subreddit which hit's things like, "What is a variable", has a blurb about it, then links to the "What is a variable" page, chapter, timestamp, in other tutorials, books, videos, so it kind of is a tutorial, but is much more a links doc to many tutorials
but that's for after the FAQ, and the How To pages
figuring out how to talk about how to learn to program in a non-chat way is difficult
Agreed. Itβs also a different path when learning to program with hardware. The RPi book for the RP2040 does an excellent job of this, covering the basics of programming and hardware in a very approachable manner.
Everything I know about Python I learned through CircuitPython.
I hadn't done programming or electronics at all before I got started with this.
To be clear, I'm missing some serious fundamentals because of my learning path, but I'm picking them up slowly along the way.
Thatβs awesome. The main problem, I think, is the Python is so broad.
I tried to learn Python before finding CircuitPython, and couldn't get into it.
CircuitPython does a nice job on constraining the ecosystem. Thereβs a lot to learn, but itβs got bumpers on it.
You can start with CPython, but many of the applications almost immediately bring in big concepts or modules.
The Pi Pico MicroPython book is Creative Commons licensed. It could be redone with CircuitPython with no copyright issues
That would be worth looking at @tulip sleet
Yeah, I appreciated the translation, @idle owl
Thanks!
there really is not a lot of Python instruction in the book, though
I found that it was a good reference backward on some specifics of MicroPython on RP2040. I write in both MicroPython and CircuitPython, but there was hardware stuff I wanted to understand about that processor in both.
(looking at it now0
It doesnβt get into anything too deep, for sure. If you wanted to cover data structures like lists via tuples vs dictionaries vs sets, for example, youβd definitely need more
Plus awesomeness like comprehensions
I really like that!
Excellent, thanks for the suggestion.
One tricky thing about teaching the basics of programming is deciding where the boundary of βbasicβ sits.
Yeah.... agreed. But I feel like I'm still in a good place to come up with an idea of where it sits still.
Plus, thereβs general basics versus language or environment specific context.
Iβm all for it, though.
Not sure it'll happen, but I'm into it.
Itβs some where between βa variable is a sort of box for dataβ and βyou need to read Knuth on algorithms before you even start to write any codeβ
π
Haha yeah
Maybe the place to start would be an outline/speculative ToC, just to see if thereβs a general set of things to include. From there, figure out what can be fleshed out.
It's more about whether or not I would be given time to do it. I already have a good idea what I would put in it. π
Gotcha!
If you do get the go ahead, and need help, Iβd be up for giving you a hand. In all my copious free time. π
@DaftVagabond Thanks for the info. What is the base frequency of the PWM? Do you need to measure individual pulses or could you use a different technique to measure the average? You could filter the signal and read it as an analog value. If the pulse frequency changes you could use countio to measure how many pulses happened.
Thanks!
Appreciate that
Feedback as I go is often super useful, since guides are, on the whole, a pretty one-way affair.
It is still very early. Looks like there are two C3 boards defined so far:
ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk
4:IDF_TARGET = esp32c3
ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk
4:IDF_TARGET = esp32c3
anyone else have opinions about https://github.com/adafruit/circuitpython/pull/5537 specifically splitting the wifimonitor stuff into another module
I was wondering if more of it could be written in Python, but I didn't really look at the code.
see e.g., this build: https://readthedocs.org/projects/circuitpython/builds/15185882/
Running Sphinx v3.5.4
Traceback (most recent call last):
File "tools/extract_pyi.py", line 201, in convert_folder
tree = ast.parse(fragment)
File "/home/docs/.pyenv/versions/3.7.9/lib/python3.7/ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 27
def continuous_capture_start(self, buffer1: WriteableBuffer, buffer2: WriteableBuffer,...
@tulip sleet By the way, my git magic prompt uses __git_ps1 behind the scenes, which is part of Git, apparently. I talked Wolf (who set up this git magic for me in the first place) and he suggested maybe my Git wasn't up to date. It wasn't, but it wasn't far enough behind that it should matter. Regardless, I updated it, and it's a bit faster than it was. Still chokes on the entire bundle initialised, but the CP repo is significantly faster than it was before updating.
So there's that.
I found this, which I think is the thing. https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
Either way, it's a little faster, and I get to keep my git magic, so I'm pleased.
that's good; i just type git status all the time π
I do that too! Even with the Git magic!
it's very reassuring
I was taught well.
because the state you think it's in is probably not the state it is actually in
I really wanted to call this page "Status. Add, Status, Commit, Status, Push" but it was too long https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/status-add-commit-push
The Google doodle today is mesmerising: https://www.google.com/
I keep opening a new tab and then getting distracted. At least I haven't managed to forget why I opened the tab yet.
This blends two "565"-format bitmaps, including byteswapped ones. All the bitmaps have to have the same memory format.
The routine takes about 63ms on a Kaluga when operating on 320x240 bitmaps. Of course, displaying the bitmap also takes time.
There's untested code for the L8 (8-bit greyscale) case. This can be enabled once gifio is merged.
The demo below is real-time. It's using directio (display_bus.send(44, bitmap)) to send bitmap data to avoid displayio overhead.
https://u...
Would newer Sphinx handle this?
I don't think so. I just tried to build it and I'm pretty sure I'm running the latest Sphinx locally, and it failed.
no it's about the Python version. This language feature, "/" in a parameter list of def, is new in python 3.8 or something.
Looks good to me! Thank you!
One conflict that needs to be resolved.
I was just wondering if a newer sphinx knew about that new feature, but I'm realizing it depends on Python to do the parsing. (I guess!)
We can consider moving to 3.8 for CI.
By the way, folks, I'm taking suggestions for Blinka art, probably until Tuesday, when I will be sending the list to our artist. Simply because it's suggested does not mean it will get made. But I'm happy to consider any suggestions that anyone has! Basically, we're going to be drawing up Blinka doing new things. We currently have art of her on a computer, sleeping, flying fast, wrapped around various things, etc. (That list is not even close to exhaustive.) We're ready to show her engaging in new activities. So let me know if you have any suggestions!
Blinka with a backpack π or even Blinka riding a robot!
Idk how she would wear a backpack thoughβ¦
Maybe have a CPX and and Clue in the backpack
Not sure if you already have Blinka with the other characters like the Ruby the LED
Or, blinka coming out of a backpack with a clue and CPX in it
Chest strap across her from the regular straps.
Oh good idea
Either way, PT and our artist Bruce are really good at figuring out how a snake can do things a snake shouldn't be doing.
I just think about how much Circuitpython has impacted education so it feels very fitting
I like it
I'm not sure we do either. There's images of many characters together, I think, but not necessarily Blinka and one other character.
Just thinking if you ever did lessons along the line of LEDs but with CP it could work. Thinking while my food is being delivered π
Added to the list!
Agreed! Especially the LEDs, though maybe Hans too.
(I think that's the right character....)
I have the stuffed LED from my first adabox sitting up in my living room so always see it
That's lovely π
Added Blinka plus Ruby, Gus and Billie to the list π
(I had to look them up)
@blissful pollen @ornate breach Thanks for the suggestions!
Youβre welcome! π
glad to help!
@lone axle Quick question if you're around.
No worries if not - I'll ping you tomorrow.
Looks good to me! Thank you!
It's the sphinx version on RTD that matters, can we select it there?
I pushed a new version, you declare the list of I2C pins and their number like this:
#define DEFAULT_I2C_BUS (2)
// SCL, SDA, SCL1, SDA1
#define DEFAULT_I2C_PINS { &pin_GPIO25, &pin_GPIO24, &pin_GPIO23, &pin_GPIO22 }
And declare a new I2C object with a name and then number like this:
ADD_SINGLETON_I2C_OBJ(board_stemma_i2c_obj, 1)
...
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_stemma_i2c_obj) },
It is compatible with the old style, thus not requirin...
.. this isn't handled when the stubs extraction procedure runs on RTD, due to the python version they use. It did not seem to be possible to select to run on a newer 3.x version.
Closes: #5543
oh nice -- I got to the point of finding the "3.x" and "2.x" dropdown but this is more flexible!
OK it's all different now. is there any way to test before merging & checking what rtd does when this lands on main?
CircuitPython version
Adafruit CircuitPython 7.0.0-615-g38c381633 on 2021-11-03; Adafruit ItsyBitsy M4 Express with samd51g19
Code/REPL
import time
for t in range(10,0,-1):
print("Starting in " + str(t) + " seconds")
time.sleep(1.0)
from microcontroller import watchdog as w
from watchdog import WatchDogMode
w.timeout = 5.0
w.mode = WatchDogMode.RESET
tenths_count = 400 # tenths of seconds
w.feed()
for i in range(tenths_count):
...
I looked in the rtd docs, and don't see a way to test, but it's not terrible if it fails, since the old version will still be there. So let's try it. Feel free to merge when done.
soldering blinka?
I get a crash with just import wifi in code.py, after code execution stops entering and exiting the repl results in a crash.
No idea how to debug this as it doesn't happen in a debug build.
thanks for the update :-)
i have read that the cp bluethooth support relies on the WebBluethooth API that is currently only available in chrome...
so i think for me that is currently out of interest...
will have to dive deeper into this some time..
I get a crash with just
import wifiincode.py, after code execution stops entering and exiting thereplresults in a crash. No idea how to debug this as it doesn't happen in a debug build.
I added a lot of ESP_LOGI() statements once to track down exactly what was going wrong when I was debugging the I2C/wifi hangs. Can you do that without invoking the rest of the debug build?
Was teaching last night (class is Tues/Thurs nights for the next few weeks). Am around today though.
That's true for code.circuitpython.org. It is the best option for Android. We'll have separate iOS apps very soon for it.
