#circuitpython-dev
1 messages · Page 16 of 1
Ah, sadly the rules say drafted PRs can't be accepted ( @ruby atlas )
feel free to move it out of 'draft', I did that.
@ruby atlas @proven garnet ^
I marked it ready for review again, sorry for causing trouble
and re-marked as accepted
thanks rose!
🥳
No, we're evidently leaving it unarchived, but we're not supporting it any further. I will have to ask Limor whether she wants to accept PRs to it, or whether she's ready to archive it to make it read only. This question has come up a few times previously, and the answer was always don't archive. But who knows now.
@proven garnet Please go through the PRs as you would on any repo. If they're reasonable, we can accept them. If they're not, we don't, as usual. We don't support the library, but we are willing to take updates to it. We will not be archiving at this time.
I'm looking at the asyncio code currently. There seem to be two versions - one is in the main repo under extmod/asyncio, the other is at https://github.com/adafruit/Adafruit_CircuitPython_asyncio
I think I've found a bug (and a fix), but not sure where to file it/ do a PR etc
Anyone got any pointers?
Use the library. The extmod version is what is in MicroPython. We should probably delete it from our sources.
Thanks, will do
I think we can probably use the Streams class with UARTs, usb cdc serial ports and ble uarts as well
@tulip sleet now that our tests use our asyncio module I think we can do that.
@mystic flume there are rough edges so come back and help us solve the problems when you run into them 🙂
it would be good to track changes to that code, but we can do that in the merges
I mean third-party disk utilities or anti-virus programs.
In my case, Pico W is not even visible in a device manager. Windows does not play the system sound that something was connected to USB. I have such feeling that sometimes board is not fully initialized.
@tulip sleet I've found several issues in asyncio/stream.py - where is the best place to report these. I have solutions for some but not all of them . Should it be done as multiple issues on github, or discuss here?
Best place would be to file an issue in the asyncio repo https://github.com/adafruit/Adafruit_CircuitPython_asyncio
Did this used to work in beta.1 or beta.2?
Does it work if you connect it to a non-Windows machine?
Does it work if you connect it to a non-Windows machine?
For me: no, it does not show up at all in my nas (pi with docker, filebrowser), laptop (win10) or main computer (win10)
Before it at least showed up as rpi2 or something, not anymore.
The released version of Mu has no support for the escape codess produced by the status bar, and will interleave them with the REPL output. There is a fix in Mu for this, but there has been no release yet that includes it. I am inquiring about when another beta of Mu might be released.
If you flash the plain Pi Pico 8.0.0-beta.4, does it also show up reliably? You mentioned the plain Pico 7.3.3 above.
It could still possibly be a hardware problem, but related to the Wifi coprocessor. Another test would be to load MicroPython for Pico W and see how reliable that is. But that does not present a disk drive, so you'd just want to see if the serial connection appears.
@jepler is there any startup thing for the CYW43 that might get stuck?
Is there any plan for USB debugging? Would love to be able to have breakpoints in python and debug interactively instead of with print statements.
Used to that with Atmel studio (and also for web dev or desktop python)
very old issue about this: https://github.com/adafruit/circuitpython/issues/298
MicroPython has some debugging support with sys.settrace(). Local variables are not available for inspection in MicroPython/CircuitPython, so there would be limits on what you could do.
search for other pdb stuff in the MicroPython issues as well
Python + gdb = pdb?
well, I think just Python + DeBug
gdb is Gnu DeBugger
print statements to the rescue
I guess you can inject a line to print local vars
Set trace to stop on a line. At that line use repl? Or locals still won't be available
still won't be available, I think
The early init for cyw43 is supposed to be able to return an error, but if it's going deeply wrong I don't know what actually happens:
#if CIRCUITPY_CYW43
never_reset_pin_number(23);
never_reset_pin_number(24);
never_reset_pin_number(25);
never_reset_pin_number(29);
if (cyw43_arch_init()) {
serial_write("WiFi init failed\n"); ...
I think the bootloader may be working but CircuitPython startup is not. @ok1rig if you put it in boot mode, does that always work? I think the original post may imply that.
Sanity check please!
I've been reading through the code for the DNS server in Adafruit-CircuitPython-wiznet5k, and I think there is a bug. In _build_dns_question() the line self._pkt_buf += host[i] appears to concatenate a str onto a bytearray which should raise a TypeError exception.
Code snippet below (my thoughts added as # > Blah blah
Can someone please confirm that the code runs or have a read and see if you agree?
Thx!
adafruit_wiznet5k/adafruit_wiznet5k_dns.py
class DNS:
"""W5K DNS implementation."""
def __init__(
self,
iface: WIZNET5K,
dns_address: Union[str, Tuple[int, int, int, int]],
debug: bool = False,
) -> None:
...
# > self._pkt_buf is bytearray
self._pkt_buf = bytearray()
...
def _build_dns_question(self) -> None:
"""Build a DNS query."""
# > self._pkt_buf is bytearray
# > (not touched after __init__)
# > self._host is bytes
# > host is str
host = self._host.decode("utf-8")
host = host.split(".")
# write out each section of host
for i, _ in enumerate(host):
# append the sz of the section
self._pkt_buf.append(len(host[i]))
# append the section data
# > concatenate bytearray and string should raise TypeError
self._pkt_buf += host[i]
# > **** ^ ****
# end of the name
self._pkt_buf.append(0x00)
# Type A record
self._pkt_buf.append(htons(TYPE_A) & 0xFF)
self._pkt_buf.append(htons(TYPE_A) >> 8)
# Class IN
self._pkt_buf.append(htons(CLASS_IN) & 0xFF)
self._pkt_buf.append(htons(CLASS_IN) >> 8)
it should throw an exception, and does in Python 3, but doesn't in Circuitpython because of optimizations that treat strings and bytes and stuff similarly internally or something
so you're right, it's a bug
a silent one in CP, but it should be fixed to be correct C python
I'll open an issue and submit a pull request with self._pkt_buf += bytes(host[i], "utf-8). Thanks for a quick response!
I think the bootloader may be working but CircuitPython startup is not. @ok1rig if you put it in boot mode, does that always work?
- Boot mode (when boot button is pressed) works always correctly. And if I flashed UF2 v8-beta and then there is automatic reset, it always worked fine too.
You mentioned the plain Pico 7.3.3 above.
-
I was desperate so I tried v7 on Pico W and flash drive worked always as expected (of course I had not wifi functionality, it was just test)
-
With ...
Thank you for your response and inquiry Dan.
I don't think that serial print actually goes anywhere.
This call happens in port_init() but that's before serial_early_init(), which is the place that would enable a serial console if it was defined. (and there's no serial console defined, either)
Want to submit a PR to change "only" to "first"?
Fixes #1083. Fixes #1084.
Might properties such as start point and length/duration of the wav to be played be accessible via audiocore/audioio/audiomixer now or in future?
Can we reopen this? I have a program which writes to a SSD1306-oled, goes to sleep for 10 seconds and then updates the display. This works sometimes for 1 cycle, sometimes for something like 10 cycles. But then it seems the display is not released properly and the screen is garbled by the REPL. This is independent of true or fake deep-sleep,
I know (at least I thought I knew...) in C there isn't really a way to make arguments optional. But I see in countio pull argument is optional - how does that work? Or is this a better question for the forums?
I'm wondering whether init of cyw43 should be moved later, and even whether it should not be done in safe mode. but especially since it seemingly can't be re-initialized it can't go in any of the "reset" functions. I could put a "maybe init cyw43" in a few strategic places so that it happens well after startup instead of happening super super early. I'm open to ideas.
did your testing include finding out whether your device worked with the "non-W" circuitpython firmware? I guess one of yo...
@ancient hemlock I'll try to answer .. but let me check how the code is working in this specific case.
the code you're talking about is in the source file shared-bindings/countio/Counter.c and the function is countio_counter_make_new
there's a structure that describes what is required from Python arguments. An argument can have the REQUIRED flag or not. The pull argument doesn't have the REQUIRED flag: ``` static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_edge, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_FROM_PTR(&edge_FALL_obj) } },
{ MP_QSTR_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
};
if it's not specified, then the default is the Python None value
yes, looking for something to model after.
so later on when args[ARG_pull].u_obj is used, it'll be the default value instead of a user-provided value
okay so when you give that to your construct method it will be the none
and the function validate_pull is prepared to accept the UP object, the DOWN object or the None object, and turn it into the corresponding value in C code: const digitalio_pull_t pull = validate_pull(args[ARG_pull].u_obj, MP_QSTR_pull);
so basically.. you need a special value (good choices might be 0, -1, or None, depending on the situation) that is used as a default if no value is specified in the Python code. Then, in C, you just check for the special value.
I think the none object is my missing link. Thank you.
I am modifying pulseio to allow for 32bit long pauses between events to use a hall sensor for slow to fast rotations
cool, happy if this gets you un-stuck. btw I think asking questions about the core C code is more appropriate here than in help-with-circuitpython, because it is at a far different level than most questions are.
I would like to have the default behavior be the original max pulse limit, and be able to specify longer gaps. Thanks for the redirect to the right place also!
if you are compiling or writing C, questions go here 😉
The reason for 16 bit values is probably a combination of wanting to save RAM size and maybe even a limitation of the counter peripheral on some microcontroller like the samd series
but I bet if you're using something like rp2040 you can have a bigger limit easily
I have a pi pico that I'm playing with now - exactly
you might also just code it in pure Python using the rp2pio module and bypass countio / changing core code entirely
as in, use my own PIO to read the pulses instead of pulseio?
I think I'm in that position of being very new, where I grabbed on to something that looks familiar-ish
I guess countio on rp2040 is using the pwm peripheral, I kinda didn't expect that
I started with countio, moved to pulseio for the exact pulse times then started to work down at the lower end of the range realizing the counter for pulseio was maxing/rolling over
https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__pwm.html#ga157c8b11483967714823187725a5ed5a pwm_get_counter only operates on a 16-bit value so it may be a dead end to do it like countio does now (countio uses pwm)
pulsein is using the pio peripheral, so it shouldn't (knock on wood) have a 16-bit limitation
I have it working now so it will count to 32bit. Not being very familiar with the PIO I'm not very confident how it works exactly
but the countio design needs the IRQ, you'd need a different design of pio program if it was going to work as pure python .. no interrupts from python code
OK, yeah, I think working based on improving pulsein within the core is the way to go!
other than it seems like it looks for a transition and then counts the cycles and reports them as microseconds
Not sure if this is something that you (collectively) would want in the main or not but I will play with it some more. I wonder if it was 16bit to be consistent across architectures...
Can we reopen this? I have a program which writes to a SSD1306-oled, goes to sleep for 10 seconds and then updates the display. This works sometimes for 1 cycle, sometimes for something like 10 cycles. But then it seems the display is not released properly and the screen is garbled by the REPL. This is independent of true or fake deep-sleep,
Sorry to hear you are having this problem. I would suggest you to open a new issue with all the relevant info to your setup.
This issue has been fi...
going back to pulseio and countio I see now how the arguments work...I just missed the pattern before
`static const mp_arg_t allowed_args[] = {
{ MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_maxlen, MP_ARG_INT, {.u_int = 2} },
{ MP_QSTR_idle_state, MP_ARG_BOOL, {.u_bool = false} },
{ MP_QSTR_max_period, MP_ARG_INT, {.u_int = 65536} },
};
the
there is a default value as the last value of each argument object.
thanks again
Fixes #1064. Fixes #1052.
@ladyada just tested with 8 strips and this PR and it works!
https://user-images.githubusercontent.com/1517291/199587767-da4e0488-434b-4db9-9a37-cee7d5416937.mp4
This is about Pico and I think the linked PR is only about Pico W.
Oops, yeah. Was this a hardware or software fix?
Never mind, I found what you're referring to: https://github.com/earlephilhower/arduino-pico/discussions/364#discussioncomment-1750308
Sorry to bother you again, but does anybody know, what I need to change to make built work? When I wrote this (https://github.com/adafruit/circuitpython/pull/7135#issuecomment-1297785568) comment, repos were in sync. Many thanks for any hint.
Small small updates to the awesome list, including:
- Add John Park's CircuitPython Parsec to events
- Add Radomir Dopieralski's EuroPython 2022 talk
- Add River Wang's Online IDE to frameworks
This pull request isn't building because espressif boards each need an "sdkconfig" file. The specific contents of the sdkconfig file depend on the espressif chip / module used.
Not all sdkconfig settings have to be in this file, but these do:
- the size and speed of spiram
- psram pinout information, in some cases
For example, this is the sdkconfig file for the kaluga devkit: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/espressif_kaluga_1.3/sdkconfig
...
CIRCUITPY_MODULE is no longer used. Remove this line.
The safe mode messages were recently re-worked. As a result, this line is not needed. Please remove this line. When CIRCUITPY_BOOT_BUTTON is defined, a predefined message is used:
message = translate("The BOOT button was pressed at start up.\n");
These lines are not needed, because these are defaults on espressif. Remove them please.
Hi and thanks for the PR! I have some comments / requested changes. I'm sorry that I don't know enough about the sdkconfig file to guide you through getting the right content into it.
@tannewt - I'm a general programmer (not a BLE expert), but I might be interested in helping with this if it would be useful
Thanks, I removed those lines 🙂
Thanks, I removed that line 🙂
Thanks, I removed that line 🙂
Thank you @jepler I could build localy so I was confused, why this build failed. I had sdkconfig file localy, but I do not know why, but I did not copy it to PR 🤦♂️. I hope this will build.
https://github.com/adafruit/circuitpython/issues/4107
I removed the auto close mention.
Looks like the PR is still linked though.
f76a887 Add CircuitPython 8 poster link to Swag section - prcutler
0b12bba Update Events with correct link and PyCon 2023 - prcutler
2494dd1 Add John Park's CircuitPython Parsec to Events - prcutler
d7f76f2 Add River Wang's CircuitPython Online IDE to Fr... - prcutler
35f9fd5 Update last updated date and John Park's Circui... - prcutler
Python 3.11 started to roll out to github actions, and .. it doesn't work. This MAY affect just the espressif build, but I'm pinning it back at 3.10 for all builds.
Typical failure, during "Run $IDF_PATH/tools/idf_tools.py --non-interactive install required" shows a lot of failures building gevent:
...
Collecting gevent=1.2.2
Downloading gevent-1.5.0.tar.gz (5.3 MB)
...
Building wheel for gevent (pyproject.toml): finished with status 'error'
...
src/gevent/_greenlet_p...
The failures you're seeing now are due to an incompatibility of esp-idf and python 3.11, which has started rolling out on github actions. I filed a PR to pin our python back at 3.10 during the build: https://github.com/adafruit/circuitpython/pull/7164
@onyx hinge that looks not great, is that Python thing gonna be an issue for libraries too?
It looks like it was for building the wheel
some stuff may come up, but this particular thing is probably unique to esp-idf's requirements.txt
Gotchya, okay thanks. I still want to address issues with those actions so just trying to keep up with that
I tried flash reset with flash_nuke.uf2, but no magic happened. Symptom is the same.
did your testing include finding out whether your device worked with the "non-W" circuitpython firmware? I guess one of your tests involved blinking the built-in LED, which of course will not be possible without the cyw43 co-processor running.
I did not concentrate on non-W testing. I just tried ~10 times disconnect/connect to PC with v7 and check if in windows the flash drive appear. It always did...
This has never been a problem of the MatrixPortal, but for any display (at least for all my displays).
I thiiiink Python 3.11 is breaking pylint for library CI 😬
@idle owl I can go ahead and move all the libraries over to that new composite action if you want me to just push directly to mains, I can handle that tonight
Looks like wrapt hasn't been updated to stop using removed (previously depreciated) methods yet.
Outside of running both AP and STA modes at the same time. The AP is working really nice. I have made a few tweaks outside of what @bill88t has done here.
- Added wifi channel selection when starting the AP. The interesting thing with this is that the channel can only be set on the first run after cold boot. If you do a warm reset, the radio will not change to a different channel.
- Enabled dhcpserver for the AP. This is a compile time option.
I have the changes that I've made her...
This change adds some additional pin definitions that were missed in the initial support (or weren't used then - like the user LED one)
I removed the auto close mention.
Looks like the PR is still auto-close linked though.
I fixed it and re-linked.
Yes, please.
we are not so fond of this board and its idea of exposing absolutely every pin
Where in the documentation of an MCU (example link) do I find the info which pins shouldn't be exposed/used?
For example, in Table 10 of the datasheet of the aforementioned MCU, should I just avoid all pins mentioned in the column OTG1_FS, and all other pins ar...
Youuuu got it! I'll take care of that ASAP (tonight)
@proven garnet, looks like setting pylint version to 2.13.0 or higher should fix that - seems to work in my recent PR for https://github.com/adafruit/Adafruit_CircuitPython_asyncio
Ahh, a preferable solution I think, thanks!
Is there any reason the core and lib need to (or should) use the same Python version?
I know @onyx hinge had the PR to pin the core's to 3.10
I think this is just the python version used to check code before commits. I think either way works tbh
Shouldn't actually make much difference as CircuitPython is (I think) based on 3.4 (with features from 3.5 to 3.7)
@proven garnet Using a newer Pylint might mean another sweep of fixes to the libraries. Be aware of that. Eva can be involved if it turns out to be necessary.
No. They are two entirely separate things when it comes to this.
I was gonna say I'll run my tool, but adabot does it now daily too! 
I'll let you know, I also am likely to have a list of libraries that need other work too, if they aren't using the standard CI
I'll get that list prior
@proven garnet I also think I want a change to the download stats page. And I have no idea how complicated it would be. Out of my immediate wheelhouse anyway, but it might be super simple to you.
Couple changes, maybe, now that I look at it rendered.
Sounds good, I'll take a look if you made them to the PR
I'll try to explain in the PR review, but we can chat if what I suggest doesn't make sense.
I don't know how to make the biggest change. So I'll try to explain it instead.
It's worth mentioning the I put the Blinka stats in there not primarily for reference, but because I need it for the report, and so need to write it them to parse later.
It is a good comparison value, I think, but not the primary reason
Blinka stats can stay, I think it's a good piece of information to have in reference to the library downloads, since they basically go hand in hand (other than when pip installing for your editing environments etc.)
I take it that last one is the complicated one? I think all the libraries have the "same" PyPI name as repo name besides capitalization and dashes/underscores (my code and existing code relies on it even)
Yes, the last one. I wasn't sure what you'd have to do to make that happen.
I assumed you could, at worst, parse the package names and use that, but that doesn't do camelcase for the lib name necessarily.
Totally doable 😄
Thanks!
Hah ok
Two thumbs!
The failures you're seeing now are due to an incompatibility of esp-idf and python 3.11, which has started rolling out on github actions. I filed a PR to pin our python back at 3.10 during the build: #7164
Thanks 🙂 Is there way, how can I restart build without making changes to my code?
I updated the PR to remove the change to circuitpython.pot, which is unneeded now anyway. This should cause a fresh re-builld with the fix to the python 3.11 problem too.
Did Thonny used to be able to upload larger files in beta.1 or beta.2?
No. My whole experience with all of this has been terrible. Even when it works, it does nothing reliable. I have had the other Xiao boards and no issues. Its not just Thonny either.
It appears to be something related to pyserial from the error. \serialwin32.py", line 325, in write
raise SerialTimeoutException('Write timeout')
I suspect something with this is causing issues with everything but the flas...
Working on moving things over to the composite actions!
Libraries now utilize the composite actions! Those need a couple updates so the libraries show as failing but that's expected right now. Sorry if someone just got 300 emails about it like I did!
In hindsight I should have done that first 
There's a lot to fix, but it all seems to be valid fixes need and not anything bogus from what I can tell
When the website updates library infrastructure issues, that should be the correct list.
Most issues seem to stem from two things:
no-memberraised as a result of CPython inconsistencies likeos.uname
- Names not conforming to the standard, often caused specifically the variable
cswhich is in a bunch of driver libraries for the chip select.
Hey, thanks for catching that. It was a stupid copy&paste mistake. Fixed.
By the way, is it OK to give each pin these two names (a generic one and a "friendly" one), or should I rather choose one?
Latest pylint (2.15.5) seems better and fixes most of those werid errors
Yeah, much better, I'll move it to that and finish up this patch - the rest can be cleaned up
yes, it's fine. The one that appears first will be used when printing the pin, so just keep that in mind when writing the pin definition. For instance, on pygamer, LED and D13 are the same, and both print as board.LED:
>>> board.D13
board.LED
this is due to the order in the pins file:
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) },
.. so as you've written it, board.LED would print as D17, which is the reverse of what we usually do.
Ah, got it, thanks for the explanation! Let me fix it quickly.
Seed studio has two XIAO (QT-Py format) nRF52840 board.
One is the Seeed_XIAO_nRF52840_Sense (see https://circuitpython.org/board/Seeed_XIAO_nRF52840_Sense/) that is supported in CP. The other one is/seems identical but without the microphone and without the 6 DoF IMU:
- SENSE: https://www.seeedstudio.com/Seeed-XIAO-BLE-Sense-nRF52840-p-5253.html
- NON-SENSE: https://www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html
I have both (don't ask) and they are delivered from factory wit...
@lone axle do you have your newsletter update in?
😩 I do not. I am terribly sorry I have slipped on that a few times now. I will submit that shortly, and try my best to get back into the routine of submitting by Thursday evening.
@lone axle @onyx hinge Is it one of you I need to talk to if there's an issue with the simulated-CIRCUITPY dynamic screenshot generator? I keep starting with Justin, and keep being reminded I'm asking the wrong person.
I believe I made the initial version of it that screenshotted the learn guide projects. I think Jeff adapted it to the library / product guide ones and hooked up the automagic actions running, but I've done one or two tweaks on that side as well iirc.
I will leave it open to Jeff also, but maybe best to start with me and if I hit a snag or something I can't figure out or work through I'll reach out for here for help.
Keen, ok, so apparently it's not including .csv files. The Project Bundler itself includes the actual file, but the dynamic screenshot doesn't include the file name.
Ah, I think there is an allow-list of file extensions that it will include. I'll poke into it this evening and see if I can add CSV to the list
I'll look into whether it makes sense to use a deny-list instead of allow as well. Thinking about it now it seems to me there would be a rather short list of files that we wouldn't want to include. .license files being the only that come to mind immediately. Perhaps there were others that came up when it was originally coded. But also possible it was just a consequence of using a dictionary to map extensions to the mock icon images for the different types.
Fair enough. I'm happy with whatever you decide is the best route. We can always iterate on it over time as well.
Thanks for working through the details with me!
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Adafruit Feather ESP32 V2 with ESP32
Code/REPL
not code related
Behavior
'''Unable to connect. The device [local IP address] was not found. Be sure it is plugged in and set up properly.'''
Description
I changed the default port (CIRCUITPY_WEB_API_PORT) to 8080 and the /code/ interface gives the error about
Additional information
No response
Implements PDMIn for STM32L4/Swan R5 using the SAI peripheral and decimation/filtering in software.
@idle owl if you are around still (no worries if not) do you know off hand a learn guide project, or library repo / example that has a CSV in it? I think I've got the change but need to test it.
If not I'll add one temporarily to a project locally and run it there to try it out without committing any changes to the project.
Let me check, I think I might have one.
@lone axle I don't. Please add one temporarily to test it. Eva's latest has one, but I have no idea what it's called.
Will do, Thank you. CGrover searched some up for me as well to try out just now
Excellent!
Yes, a VID/PID is needed for this to move forward.
I noticed in other PRs that CircuitPython prefers that the VID/PID pair should be unique to CircuitPython if the device has multiple operating modes.
Reading their docs, the Raspberry Pi Foundation might want to issue a generic PID for RP2040 boards running CircuitPython? A possibility to discuss with them.
I'd love to link to one potentially in my circuitpython-csv library!
Also, we're now fully (for real this time) using composite actions for the CI! Feel free to tag or ping me if something seems weird - about ~50 libraries have issues that need to be addressed since we upgraded pylint versions.
I'm trying to make sure PRs that have been run since that fail on them try to get fixes sooner
Catching up on the stream, @lone axle do you want to use the latest Python, or keep it pinned to 3.10? I noticed you got the cryptic formatargspec error - I managed to solve it for Python 3.11 with some upgrades to pylint. If you'd rather the latest Python I'm happy to submit those changes as a PR.
Looks like you got it running on 3.10 which is good.
I don't have a preference / would defer to same as we are doing for other repos. Someone in the chat mentioned that Learn Guide repo had been reverted to 3.10 for the time being, so I tried it to see if the same change would work for screenshotter.
Have you seen the Black / Click issue that I ran into before? that one was new to me.
Yeah, I have - if I remember correctly that was that click implemented a change where they removed that library and black still referenced it. So it was basically a mismatch between the two.
Basically no version of click was pinned, so their upgrade broke things across anything using black
Two checks in the build-arm job failed retrieving external dependencies due to a limit on the number of times a URL can be requested. I don't have access to re-run these checks - grateful if someone with access can re-run these failed checks.
The ESP32 is supported now via the Web Workflow.
I think we can close this issue.
An issue for reference, as I haven't found one.
This is not the same as #5926 as it's for support of the ESP32, not about the features of BLE on espressif.
Do we want to implement BLE workflow on Espressif ?
It could be an alternative to web workflow or enabled by default, solving the problem of the creation of .env which otherwise requires serial access. And maybe it would be turned off if web workflow is enabled.
I am using the Pico W and i want to make a portable web server. For instance after you connect to the access point you can view local website. However that i have seen, it seems impossible to just create an ap without connecting to a network first.
There is no AP on Pico W currently, follow any progress here:
https://github.com/adafruit/circuitpython/pull/7101
But you can run an HTTP server (or other type of TCP / UDP server) as a wifi client.
The best place for support questions like this is https://adafru.it/discord
I've just written a library for the community bundle for the XIAO nrf52840 (PR pending: https://github.com/adafruit/CircuitPython_Community_Bundle/pull/121), it would be reasonably simple for me to add a function to this like
def is_Sense() -> bool:
try:
with imu as IMU():
return True
except:
return False
- The internal definition of ticks in moduasyncio was still wrong, in a way that deceptively seemed to work sometimes
- select() was not interruptable with ctrl-c
- socket objects are now selectable -- implementation tested on rp2040 only at this point -- needs further changes in asyncio module itself
Here's my test program, which connects to a netcat -l 5153 already running on my laptop bert. When I type something into netcat and hit enter, it's received and echoed back, with...
will it be added for the Pico W? i had seen on the documentation that the Pico W was a supported board for the wifi module>
Station (wifi client of an external AP) for Pico W is supported, same basic API as for espressif boards.
Follow the PR mentioned above for progress on AP for Pico W.
ahh thank you i might use stations until it is available
I've just written a library for the community bundle for the XIAO nrf52840 (PR pending: adafruit/CircuitPython_Community_Bundle#121)
Great news, I feel it is a sensible thing to do, I guess I should try that.
My question was maybe more about the trade-off between, on one side:
- sharing one firmware for multiple hardware
- reducing the CICD computation
- reducing S3 storage
and on the other side: - make it eas...
This means that the user can hit anywhere on the big target like "Adafruit" instead of only being able to click the small checkbox. It may also improve accessibility.
Additionally, the mouse cursor over the checkbox and its label is changed to the "pointer" to indicate an action is available by clicking.
Just a note that I'm seeing this intermittently too, on a CPX when calling cpx.play_file(). I haven't prepared a minimal repro case or bootloader/version info yet, I'm crunching to get https://github.com/usefulsensors/person_sensor_tv_remote/blob/main/code.py done unfortunately and it's not a blocker for me, but I wanted to at least mention that it comes up outside of the original context.
I have found one of the big issues I was having with the XIAO esp32c3. You have to have the antenna attached for it to work with the webserial. It also seems to have an affect on every other means of interacting with it. I am not sure why this is, but was able to get MU Editor to work pretty consistently. The adafruit webserial works now and is pretty reliable. Thonny is still not working with this.
I have found one of the big issues I was having with the XIAO esp32c3. You have to have the antenna attached for it to work with the webserial.
!!
Hello there, I discovered something strange while doing some testing with CircuitPython today.
I was testing this code I wrote some time ago https://github.com/educ8s/CircuitPython-Pi-Calculation-Benchmark
This script calculates the Pi using an approximation algorithm.
I ported the code in C to run on an Arduino Nano and I noticed something strange.
The execution time of the script was linear depending on how many iterations of the algorithm I was doing.
On CircutPython on the other hand the execution time grew exponentially
and the memory usage grew on each iteration
That's the code of the algorithm:
def calculate_pi(n):
"""
Calculate the value of pi using the Bailey–Borwein–Plouffe formula.
"""
pi = 0
k = 0
while k < n:
pi += (1 / (16 ** k)) * ((4 / (8 * k + 1)) - (2 / (8 * k + 4)) - (1 / (8 * k + 5)) - (1 / (8 * k + 6)))
k += 1
return pi
After a lot of testing I found out the culprit. It is this experession: 16 ** k
I replaced it with math.pow(16,k)
and I now have linear performance and no memory increase at all. Also the speed diference is huge.
For 1500 iterations the scipt needed 6.8sec with the ** expression and only 0.2 sec with math.pow function.
I don't know if it is a bug, I just wanted to let you know.
might be a good idea to report it as an issue on github
Thanks for the feedback. Report it on the main CircuitPython repository or somewhere else?
I think the main repository is best
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Raspberry Pi Pico with rp2040
Code/REPL
import math, time
def calculate_pi(n):
"""
Calculate the value of pi using the Bailey–Borwein–Plouffe formula.
"""
pi = 0
k = 0
while k < n:
pi += (1 / (16 ** k)) * ((4 / (8 * k + 1)) - (2 / (8 * k + 4)) - (1 / (8 * k + 5)) - (1 / (8 * k + 6)))
k += 1
return pi
def calculate_pi_pow(n):
...
@stuck elbow Thanks, I just submitted a report.
The types of the expressions are different. Python and CircuitPython represent ints exactly, but the memory storage and computation time increases according to the length of the number; while floats always use a constant amount of storage but don't represent values exactly: ```py
type(16**k)
<class 'int'>
type(pow(16, k))
<class 'float'>
you can also write 16.**k so that the power operation is done as a floating point calculation rather than an integer calculation
The information in this thread might prove useful ...
https://forums.raspberrypi.com/viewtopic.php?t=339994
I added code to unblock the use of GPIO29 for AnalogIn and as expected it disrupted the use of the pin as GPIO:
>>> import microcontroller
>>> a = analogio.AnalogIn(microcontroller.pin.GPIO29)
>>> a.value
31799
>>> import wifi
[CYW43] cyw43_kso_set(1): failed
F2 not ready
At this point the module required a reset before it would work again.
The types of the expressions are different. Python and CircuitPython represent ints (integers) exactly, but the memory storage and computation time increases according to the length of the number; floats always use a constant amount of storage but don't represent values exactly:
>>> type(16**k)
<class 'int'>
>>> type(pow(16, k))
<class 'float'>
you can also write 16.**k so that the power operation is done as a floating point calculation rather than an integer calculation.
Oh, good one. I didn't realize it wasn't working like this. Looks good. Didn't test.
<@&356864093652516868> hey all! Our weekly meeting is coming up in a few hours (3ish) but remember to double check your local time, as most of the US switched to winter (standard) time over this past weekend. It's a good time to add your notes to the document! See you a little later today. https://docs.google.com/document/d/1BtwVBaXLXcFHM52SGlMX0-7K0m3r_e-T6l6MLfux5KI/edit?usp=sharing
CircuitPython Weekly Meeting for November 7, 2022 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 pa...
Thanks jepler!
Build size on proxlight trinkey m0 en_US:
Before: 2412 (en_US) 820 (ru)
After: 2544 (en_US) 984 (ru)
Savings: +132 (en_US) +164 (ru) bytes available flash
hey @random junco, @turbid radish says that the newsletter is ready to crib from for the meeting notes!
great, thank you!
Thank you very much for your time!
Very interesting, didn't know this difference\
It is not evident, it's something you have to learn/know about python. Glad I could help.
Looks like this wasn't enough - I think it may be worth pinning the Python version similar to the way Adabot does to Python 3.9. If so, should it be penultimate (3.10) or the same as Adabot (3.9)?
Yup! For reference, the BigQuery package adabot now needs isn't avialable for Python 3.11 yet.
@tulip sleet: Would you be willing to speak to the core in the weekly meeting?
i was out a lot of last week, so @onyx hinge would be better this week (if ok with you, Jeff)
sure!
great, thank you!
as though I know what is going on...
Fixed build errors twice now, maybe I got 'em all
2pm or 3pm?
Now
We're a few minutes away from starting the meeting
adafruit folks are wrapping up our internal meeting but no reason for paul not to get started 🙂
no hurry. 🙂
Ah Jeff beat me to it. We'll be there soon!
come on ya scallywags
(swoon emoji)
Learn how to build your own Jarvis-like AI assistant, in Python
I made my own AI robots; they can tell jokes and the weather. Just don’t make them Angry!
#micropython #python #circuitpython #robot #robotics #raspberrypi #ML #AI #computerscience #STEM
I've lost sound
🤯 * 206300 PyPI downloads over 322 libraries
Is Paul still using a browser?
@random junco Everyone else's sound is working. Are you not hearing us?
@random junco do you need someone to take over the meeting?
It's all good @random junco. We've all lost audio at some point.
No worries, @random junco! It's happened to all of us. Seriously.
it sounds similar to how my sound cut out the last few meetings at points. I was using the browser to record discord and speak. I've changed over to using the app today🤞
yeah that dev setup stream was awesome
been enthralled with all the great stuff happening at supercon this weekend. really great stuff.
belated hug report for everyone who joined in during hactoberfest
(cgrover, you seem professional enough to me)
<blush> Still have a long journey ahead of me.
Thanks, foamyguy! 🎉
I'm not familiar with the MCP2307 chip, so can't be sure. But the Debouncer library I'm pretty sure has ability to interface with arbitrary functions which should make it possible to use for even non-standard digitalio type stuff.
I'll take another look into the library. Figured it would require access directly to GPIO pins like the keypad library code does.
@midnight ember do you need to set each of the chips to a separate address by soldering at least one of those address pads?
They're on 2 separate busses so I can get away with using the same address. Didn't know I could chain them if I really needed to. Since designing the PCB figured out I can get 8 chips per bus if needed. Right now have 1 chip per bus and still have 10 unused GPIO... god i love expander chips.
aha ..
whew Kattni's been busy
That's a full plate for sure
Indeed.
Yeah it's enough for weeks-plural.
it was early christmas in the internal meeting, in terms of work assigned 🙂
This cricket example is the one that shows the function technique: https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/blob/main/examples/debouncer_crickit_test.py it uses lambda to define a function that reads from the cricket library, which is seesaw underneath I think. Different expander chips should be able to set up similarly with functions / lambda that call the expander libraries functions.
Oh and I will also finally be taking the time to update the Contributing to CircuitPython using Git and Github guide!
I saw that example but decided to go a different route with enumeration which ended up being a dead end. Will give that a shot thank you.
excellent work on the composite actions, belated hug report @proven garnet
i realized after the meeting began that i neglected to add notes, but just wanted to say group hug to all.
Thanks Paul!
Thank you Paul for hosting.
So greatly appreciated! Thanks so much, Paul!
Thanks Paul
Thanks Paul!
Thanks for hosting Paul. Have a nice day everyone! 🎉
thanks paul!
@random junco , I have many stories that would easily eclipse your experiences. It's all part of the game.
Doc build error (I think it just changed out from under us:
terminalio/__init__.pyi:46: error: Incompatible default for argument "status_bar" (default has type "None", argument has type "TileGrid") [assignment]
terminalio/__init__.pyi:46: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
terminalio/__init__.pyi:46: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Thanks all! Have a great week everyone!
thanks all for the support. It's appreciated. 🙂
Kattni doing an entire session with only her voice sounds like it takes the cake. big oof. lol. these things happen.
this is why we have people here who record backups, these things happen, kind of regularly, just part of internet life.
Yeah it was pretty bad. 😄
I could hear everything, OBS was acting like it could, but only my side came through. 🤷🏻♀️
I performed a music gig as a duo with new in-ear monitors. Forgot to turn on the PA for the audience for the first two songs.
in OBS when others are talking you want to see that VU meter going back and forth 😉
See? Happens to everyone in some way!
@errant grail Don't forget to disconnect from the voice chat to avoid surprises.
Yes, and that's just one of many similar experiences.
It was, that was the problem. 🙂
as a DJ who wore headphones, imagine sliding into the next track that is muted. sounds fine in the headphones... also why i'm deaf in 1 ear now.
And there's another...
Thanks! Definitely going to make some necessary changes to the CI much more manageable
Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1_pM6rZNwdHXKLP69lmqDRBxVVnlMj-TsIRuRjjSCyEU/edit?usp=sharing
Ok, I think all the post-meeting stuff is done, just need this PR merged if someone gets a chance: https://github.com/adafruit/adafruit-circuitpython-weekly-meeting/pull/90 - thanks!
Done!
awesome, thank you
@proven garnet Hihi. I heard we are working on fixing the pylint stuff and was told to ask you for more info on what specifically the problem is
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
Code/REPL
import usb_hid
import board
import digitalio
from adafruit_hid.mouse import Mouse
mouse = Mouse(usb_hid.devices)
time.sleep(5) ## 5 sec delay
mouse.move(y=20)
time.sleep(5)
move.mouse(y=20)
Behavior
whenever the Pico board is attached to the iphone using the usb adapter, the initial location of the pointe...
My apologies for missing the meeting today, all. Despite having a block on my work calendar for that time, I was scheduled for TWO conflicting work meetings during that time. 😕
@proven garnet I noticed in help-with that the circup instructions for circuitpython_csv are incorrect, likely an effect of: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/issues/207
@tulip sleet do you know if we have a USB HID descriptor for an absolute pointing device (custom descriptor etc)? (I ask due to the above issue)
Yup yup! I'll message you about it now
Thank you! I'll file an issue and fix it!
I did something like that some time ago. Doing copy cat of someone else code. There was code in boot.py because I think this is where the description must occurs. Let me search my gist or tweet.
if you find it can you comment on the issue?
The HID mouse that CircuitPython uses by default can only send relative motions. It's up to each device where the mouse pointer is placed when the device is first plugged in.
The first workaround that comes to mind is that you could begin by sending a series of large moves so that no matter where the mouse pointer started, it ends up in a known corner of the display, and moving from there by known increments. This should be possible just with changes to how Mouse is used.
A more advance...
I turned it into a library
https://github.com/Neradoc/CircuitPython_Absolute_Mouse
@onyx hinge 👆 (and @thorny jay )
On Discord, @Neradoc chimes in with a link to https://github.com/Neradoc/CircuitPython_Absolute_Mouse and @dglaude found https://gist.github.com/bitboy85/cdcd0e7e04082db414b5f1d23ab09005
thank both! I went ahead and put those links in
And I used that in this piece of code from the gist here:
https://github.com/dglaude/CircuitPython_udraw_Absolute_Mouse
The difficulty is that not all devices do accept and understand "absolute mouse" as that was the case for my Nintendo Switch. So to deal with that I just did what @jepler describe by translating into CircuitPython an Arduino library: https://github.com/dglaude/AGTD_CircuitPython/blob/main/mouseto.py
So the trick is to move the mouse in a corner, on the 0,0 side, and the...
Great collaborative work. I was typing, so I edited to only keep the added value part.
I keep meaning to look at the macros and figure out why my mistake want a compile error
Thanks for this work. I have some minor comments.
Consider redoing the copyright lines on files you have modified extensively.
Use the py/argcheck.c mp_arg_validate...() routines here instead, if possible. This allows reuse of existing error message, saving space, and saving work for the translators. Look at some other uses of mp_arg_validate* in ports/*/common-hal/.
If there is no existing routine you can use, at least try to reuse an existing error message. Use the %q (for QSTR) designator in the error message, so you can pass in an MP_QSTR_... arg name.
Move these up into lines 41-46, with the other enabling/disabling values, and consider alphabetizing those lines.
Yesterday I successfully followed this guide for Building CircuitPython using Windows 10 (21H2 Build 19044.2130) and Windows Subsystem for Linux (WSL) running Ubuntu. Hooray!! It went pretty smoothly and the guide is excellent. https://learn.adafruit.com/building-circuitpython/build-circuitpython
Some of the steps were slightly different for me though:
https://learn.adafruit.com/building-circuitpython/windows-subsystem-for-linux
Some added comfort:
- WSL 2 is now default with a new install, it didn't need to be seperately enabled
- Moving Files to Windows has become much easier: you can call
explorer.exe .from WSL and copy the files via the GUI - There easy to setup intergration with VSCode following these instructions https://learn.microsoft.com/en-us/windows/wsl/setup/environment
Rust needed to be installed
- in order to install requirements-dev.txt and requirements-doc.txt, I needed to install Rust first (didn't come with Ubuntu):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh```
You can verify the installation by running:
```source $HOME/.cargo/env #Import the environment config for rust
rustc --version```
https://learn.adafruit.com/building-circuitpython/linux
**Some unzip weirdness**
- in WSL2, this only worked without errors using sudo: `sudo tar xvf <name of the .bz2 or .xz file you downloaded>`
**.profile and .bashrc**
- .bash_profile is just .profile in WSL2
- path format needed to be `export PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"`
- in order for the paths to work I had to restart WSL2 Ubuntu
I ended up adding these three lines to .profile and .bashrc:
```. "$HOME/.cargo/env"
export PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"
export SETUPTOOLS_USE_DISTUTILS=stdlib```
Maybe one or two of these things might be worth adding to the guide. Other than that, the build process went smoothly and the .uf2 work on the boards I had. 🍩 🍩 🐘
Hi, I love circuit python, you are doing a great work
working on display independent terminal aps which can use "print" command to show
data in terminal style on LCD display
Unfortunately on 0.96" 80x160 display I kill half of display with blinka logo
I found command
supervisor.status_bar.console = False
it disable text but logo remaining and half of display is death
I read somewhere that is compilation option but I prefer mainstream distribution for Raspberry PICO instead custom bui...
Thank you for the detailed feecback! I've recorded it in the Learn Guide with the "Feedback" link.
Some unzip weirdness
- in WSL2, this only worked without errors using sudo: sudo tar xvf <name of the .bz2 or .xz file you downloaded>
that seems like you were in a non-user directory when you tried to un-tar? Could you go to your home directory and tar xvf without sudo? Or maybe you downloaded with different permissions?
it was in the bin directory, but I had to create that
/usr/bin ?
yes
or ~/bin ?
let me try this real quick, I have it open
ah yes, you shouldn't try to unpack there, it's for sudo apt-installed stuff. Instead you can create ~/bin, say, and then add that to your PATH. I'll make this clearer: I was assuming the user was more famliar with Linux directory layout
regular users should not write in /usr/bin or /bin, etc
ah I just put the .tar.bz2 there because that's where I wanted the files to end up
FWIW it worked even if unorthodox
it did work, but the danger is accidentally overwriting an existing system file, so I'll make clear to put it in a directory under your home directory
OK that makes sense
analogy is that you don't want to put stuff in the C:\WINDOWS folder
again, thanks for the feedback, it is very helpful, because I make unknowing assumptions.
ah hang on, you were right, the file is in ~/bin
that's why I had to set the path to PATH="$HOME/bin/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"
I'm just discovering the various bin directories
fun 😀
learning has occurred
CircuitPython version
CircuitPython 7.3.3
Code/REPL
X
Behavior
X
Description
Download Link for CircuitPython 7.3.3 please
Additional information
No response
To download CircuitPython binaries, go to https://circuitpython.org/downloads and select your board. On the right hand side are links to the downloads for that board, including stable (7.3.3), unstable (8.0.0-beta.4), "absolute newest", and "past releases".
Note that if a board was added subsequent to the 7.3.3 release, it may only have an unstable or absolute newest release.
Source code can be downloaded from github by using the git command-line program. Each release is "tagged", so on...
Hi jepler thank you for your quick reply. Im using Feather S3 but can't find 7.3.3 only from 8.xx on. In the past I was also using S3 and some 7.x version from the download page but now it seams that its disappeared?
"Feather S3" is a bit ambiguous.
Unexpected Maker FeatherS3 download page has links to 7.3.3: https://circuitpython.org/board/unexpectedmaker_feathers3/
Adafruit Feather ESP32-S3 No PSRAM has links to 7.3.3: https://circuitpython.org/board/adafruit_feather_esp32s3_nopsram/
Adafruit's other Feather boards with S3 do not have links to 7.3.3, because they were added after 7.3.3:
[Feather ESP32-S3 4MB Flash 2MB PSRAM](https://circuitpython.org/board/adafruit_feather_esp32s3_4mbflash_2m...
@jaunty juniper I think I fixed the installation instructions for the cav module and confirmed using circup.
Thanks again!
Because this must be treated like an in-use pin for all other purposes, unfortunately a special case must be added in shared-bindings.
Multiple AnalogIn objects for VOLTAGE_MONITOR can be created (because in use tracking isn't working) but this causes no harm.
Testing performed: Read the monitor, then imported wifi. When the pin state was insufficiently restored, the second step would fail with debug messages about do_ioctl timeout.
import analogio, board
a = analogio.AnalogIn(...
aha the voltage still seems a bit low because it's one diode below VUSB, albeit with the very low forward voltage MBR120VLSF. So 4.8 is plausible.
I can look into the changes you suggested, thanks for the pointer. I'd much prefer to use an established pattern than something ad hoc.
Just for some background, most of the error messages were present in the nrf port, so the translations appear to be reused - the translation file now has 2 file references for the same translation text that already existed. This should mean reduced work for the translators. I can look into quick wins to reduce this further.
If that's the case, we can leave it alone for now, and then shrink it later. I was wondering if the STM32L4 had limited flash, as well.
So don't bother changing these now, unless you need the space.
That's good to hear. Thanks!
I don't think this difference is worth making a separate board. Comparable situations is the PyBadge vs the PyBadge LC, which has fewer components, or the Adafruit Feather ESP32-S2 which optionally has a BME280 on board.
So you mean just turning on the current partial support?
Assigning to 8.0.0 to make a decision one way or the other.
The status bar is updated by sending out a "OSC" Xterm escape sequence. This can just be done with print(), though we should probably document how to do this, or add a helper routine. This gets sent directly to the connected terminal (if any), and is intercepted by the REPL display and interpreted.
Suppressing the icon is a separate thing we could allow the user to enable/disable.
Yes, whatever is needed to make turning CIRCUITPY_BLEIO to 1 in mpconfigport.mk to work.
any idea who does the graphics for pretty pins for the boards in product pages? i'd like one made for the MCP23017 learn guide.
We don't do it for sensors/breakouts/etc. We do them for microcontrollers. If there are any on sensors/breakouts, they were generated by someone else most likely and included following that.
i mean for the bare chip because adafruit does sell that and the way the library uses it is different than most pinout diagrams you find on it
Right, I'm saying we don't do PrettyPins for chips, we do them for microcontroller boards.
It's not designed to work with chips as it is.
ok can i recommend a graphic for the MCP23017 learn guide because the pinouts are very confusing to use the first time. they start on the right side of the chip.
the software "prettypins" is https://github.com/adafruit/PrettyPins fwiw
Just to follow up on your question about flash space - the L4+ used in the Swan has 2MB flash, partitioned as
- 64kb - UF2 bootloader
- 960kb - runtime (presently 520kB used for a release build.)
- 1024kb - python scripts
For me, this is an "academic" discussion!
As long as BLE on ESP32(s3) is not working and developed as on the Adafruit ItsyBitsy nRF52840 (which is "out of stock"), I think you should work on getting _bleio and the other libs working as well as on the Nordic chip !
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Seeed Studio XIAO ESP32C3 with ESP32-C3FN4
Code/REPL
from adafruit_ble_radio import Radio
radio = Radio(channel=1)
radio.send('test')
Behavior
Traceback (most recent call last):
File "", line 1, in
File "adafruit_ble_radio.py", line 134, in send
File "adafruit_ble_radio.py", line 151, in send_bytes
File "adafruit_ble/__init__.py", line 215, in start...
On second thought, I don't think we can do BLE workflow given #7170
This is about half done. The two remaining large pieces are adding GATT server support and bonding support. Unfortunately GATT server support probably needs NimBLE modifications to allow for adding servers, characteristics and descriptors after things are running. The SoftDevice can do this so we've assumed it in our APIs ability to just `S...
Two big ones:
- eliminating a bunch of incorrect, never-used QSTRs
- Fixing a problem where the French translation was using Unicode code points above 255 again; this almost certainly pops French out of being the largest translation again
We should add a check for langauges that we expect all the chars to fit in uint8_t actually do, otherwise firmware grows by up to 500+ bytes...
As long as BLE on ESP32(s3) is not working and developed as on the Adafruit ItsyBitsy nRF52840 (which is "out of stock"), I think you should work on getting _bleio and the other libs working as well as on the Nordic chip !
It's in stock at the moment: https://www.adafruit.com/product/4481
Marking this as a draft, we can pick and choose from these improvements when we have a need for space ...
@Neradoc what do you think of the French apostrophe change? I'm not sure we could get the regular translators to do that, or if it looks wrong.
Can just use mp_arg_validate_length_min() here, I think, eliminating the if check.
FYI I get this issue using Pimoroni's picographics library in Micropython as well, I got around it by changing my white to very slightly off white, somewhere around rgb(240, 240, 240) works fine but going much closer to pure white and I have the issue
I agree that it's useful to be able to use the whole screen for terminal on smaller screen sizes.
Neradoc posted this in the Discord, but it's really not obvious.
#help-with-circuitpython message
display.root_group[0].hidden = False
display.root_group[1].hidden = True # logo
display.root_group[2].hidden = True # status bar
supervisor.reset_terminal(display.width, display.height * 2)
display.root_group[0].y = 0
@Neradoc what do you think of the French apostrophe change? I'm not sure we could get the regular translators to do that, or if it looks wrong.
As far as I know it's only ever auto inserted by software, like Word, a CMS and such. Nobody is gonna notice the difference. It's also not even used consistently in CP.
I also had to respell an œ as oe, and made changes in a few other translations as well.
we could look into a different way of storing the data (such as utf-8) but last time I looked there was a real inconvenience to storing values[] in a way that can't simply be indexed
I also noticed that some other languages, like ru, use just a small number of codes well outside the 0-255 range. A much less complicated rule could remap the 160..255 values to those code points and potentially save s...
Tentative to document (with minimal change) that the same firmware can be used for two distinctives boards.
The opportunity to do a separate firmware has been discussed here and rejected: https://github.com/adafruit/circuitpython/issues/7167
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
Code/REPL
import time
print("Hello World!")
while True:
print("foobar" * 50)
time.sleep(1)
Behavior
Code runs and prints messages once per second as expected.
- open the Mu Editor
- set it to CircuitPython Mode
- open the Serial panel
- wait a few seconds for a few messages to appear
- click around betwe...
This confirms what I think: it is a firmware issue. The CircuitPython code looks correct and I tested slight variations in speed and timings, but that does not change anything fundamental: either I have artifacts (slower bus speed) or ghosting (high bus speed). In the latter case, ghosting disappears when keeping away from white.
Initially thought it was something in my code as I dropped a fairly complex script over from another display.. I have now added an issue over at Pimoroni as well with some rudimentary examples..
@onyx hinge could I have an audio chat with you about translations and the compression mechanism?
sure! give me a couple minutes to transition to my computer with good mic.
OK I'm ready @tulip sleet
make BOARD=adafruit_proxlight_trinkey_m0 TRANSLATION=fr
https://github.com/adafruit/circuitpython/pull/7181/commits/f5b20a3ef0917d62cc836356c24649d611098b9d
Plus d’un tiers
The apostrophe (' or ’) is a punctuation mark, and sometimes a diacritical mark, in languages that use the Latin alphabet and some other alphabets. In English, the apostrophe is used for two basic purposes:
The marking of the omission of one or more letters, e.g. the contraction of "do not" to "don't".
The marking of possessive case of nouns (a...
Although ubiquitous in typeset material, the typographic apostrophe ( ’ ) is rather difficult to enter on a computer, since it does not have its own key on a standard keyboard. Outside the world of professional typesetting and graphic design, many people do not know how to enter this character and instead use the typewriter apostrophe ( ' ). The typewriter apostrophe has always been considered tolerable on Web pages because of the egalitarian nature of Web publishing, the low resolution of computer monitors in comparison to print, and legacy limitations provided by ASCII.
0000000 P l u s d 342 200 231 u n t i e r 0000020 s \n 0000022
yeah, nobody uses it
I just pasted that from a lemonde.fr article
but you don't type it on the keyboard, you are saying, so when does lemonde fancy it up
oe is also good enough for œ, likewise it's annoying to type on a keyboard
does the Academie still care?
there's setups in software like Word, and web CMS to convert automatically
(and for example putting a non-breaking space before : as is required by the typographical rules)
is there a provision in weblate for remapping certain character sequences?
En français, l’utilisation de la ligature œ n’est pas esthétique mais linguistique, contrairement à d’autres ligatures (par exemple, fi) : œ et oe ne se lisent pas de la même manière, la deuxième forme notant un hiatus (cœlacanthe ≠ coefficient).
french wikipedia says that the ligature is "not aesthetic but linguistic"
i was giving @onyx hinge the example of ligatures being important in at least some languages, and offensive if not used, like in English, w could be vv but everybody would say that's weird
I don't think we should aim at the typographical quality of prestigious newspapers
also it's mis en œuvre for implemented when implémenté is used somewhere else
I'm sure the consistency of the translations could be better!
(borrowed from the english, it has entered the French language)
which is .. better ?
feel free to modify the french translation if you have ideas about that
or do a corsican translation 🙂
yeah
by the way, things not to do:
mp_raise_msg_varg(&mp_type_RuntimeError, translate("%q is %q"), MP_QSTR_storage, MP_QSTR_extended);
worth noting that in an issue, say
yeah I'm going through untranslated strings and taking notes
there's Expected a %q in many places and one Expected an %q in alarm 🤔
could be Expected %q
locale/circuitpython.pot:msgid "Expected a %q or %q"
locale/circuitpython.pot:msgid "Expected an %q"
those may be convertible to mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name)
which will say mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, type->name);
I can put back the oe with the single offset block now
why not, but I'm removing the one occurence from the translation anyway 😉
good, thank you
I might be increasing the translation size by adding translated strings and fixing some stuff 🤫
I see there were a couple of related PRs. Is this fixed now?
and I logged in with my github account to discover that I already made a weblate account, and to associate the old one with my github I delete the other one, so now the first changes I made today are credited to "deleted" 😛
thanks @ deleted for your first contribution to circuitpython!
I had a good chat with @jepler about why there are knees in the compressed-message table sizes. Look at genhdr/compression.generated.h for the tables mentioned below.
If a two-byte character is present in a message, it will cause mchar_t to go from uint8_t to uint16_t, doubling the size of the values[] and words[] tables.
Ideas about how to avoid this:
- Just avoid those characters in the translations. @jepler has done this for some translations in #7181. Examples are the n...
does that need a translate ?
for (size_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
mp_cprintf(&mp_plat_print, translate("%02X"), raw_id[i]);
}
(is there an advantage, like compressing ?)
@tulip sleet am I wrong to expect a subclass of aesio.AES to work does subclassing built in types work generally? ```import aesio
b = bytearray(16)
a = aesio.AES(b'1' * 16)
print(a.mode)
a.encrypt_into(b'a' * 16, b)
print(bytes(b))
print()
class A(aesio.AES): pass
a = A(b'1'*16)
print(a.mode)
a.encrypt_into(b'a' * 16, b)
print(bytes(b))
I started by removing the "I thought it was unneeded" type check at the top of several of the methods, but then the encryption is just .. not even performed and the mode is not set...
1
b'\xc6\xb9\xd1\x02\xdd\xea\xb1i\xf3$\xcb\xdb\xe73\xf0\n'
0
b'aaaaaaaaaaaaaaaa'
yes that translate() apparently saved space, it was part of a crop of space savings that dan committed about a month ago
it is really weird that it made a difference; I think it may have to do with how the surrounding code was compiled and optimized
Could I get a review on https://github.com/adafruit/Adafruit_Python_PlatformDetect/pull/257 ? It's holding up other PRs.
I thought the native C code had to anticipate subclassing and doing special lookups, e.g., see examples in displayio
as far as I know subclassing builtin types is complicated because you can't call their dunder functions like __setitem__ since they are not exposed as properties of the class, and other side effects like that
@gilded cradle looking .. does it matter that _LIBRE_COMPUTER_IDS is just a string, but you're using 'in' on it? It might give an unexpected result, say if self.id was a short string like C?
Let me check...
-_LIBRE_COMPUTER_IDS = AML_S905X_CC
+_LIBRE_COMPUTER_IDS = (AML_S905X_CC,)
```maybe you want/need something like this.
the removed function property wasn't considered part of a public API?
No, I already changed it in Blinka
Perfect, thanks
Sorting the GitHub issues by "Recently updated" seems to be giving strange results recently? There are quite a lot of issues near the top where I can't see anything having been updated.
Maybe because the hacktoberfest label was removed?
I think recently updated means any update such as a comment, label change, or whatever.
I've seen that before, but it normally says when a label was added/removed in its update history
Which repo?
It looks like the top issues were added to a specific milestone.
Hmm, adding to a milestone was also shown in the update history before. But maybe GitHub isn't showing that any more.
e.g. https://github.com/adafruit/circuitpython/issues/4303 says in the index it was updated 12 hours ago, was added to a milestone on Mar 2, 2021, and had hacktoberfest label added Sep 29
Ok, good example. I'm not sure why it's showing updated 12 hours ago.
Possibly a comment was added then removed
There's about 15 of them at the moment
the most recently updated ones all have a Hacktoberfest label, so seems related to that
except for 3 actual new ones
Maybe the Hacktoberfest label itself was edited?
yes, maybe that was it, though I don't know what it would have been. I think it was already capitalized. Maybe the description was changed.
Could be the description. I think the same thing happened a week or two ago.
I'm looking in the audit log for the organization, but don't see anything immediately. However, it has tons of stuff in it
i think I will give up for now
@dhalbert - I've made the changes suggested. It would be great if you could approve and merge this PR.
OK, this looks good! Sorry for the delay.
I had trouble finding this commit, and then saw it was an unaccepted PR to protomatter. I approved and merged that. Could you update this to the protomatter merge commit?
was https://github.com/adafruit/Adafruit_Protomatter/commit/000ca43f792e298faf08db7573555b5525386c24
now https://github.com/adafruit/Adafruit_Protomatter/commit/cc93ff18c3a20b25396cb2babaee8ed33bb79528
Thanks @Atalanttore and @Neradoc (via a defunct account, I think)
I have reproduced this, and am working on some changes to the https://github.com/adafruit/Adafruit_CircuitPython_LC709203F library to do retries and delays in various places to minimize the throwing of errors. It was interesting that the Arduino library seemed to work OK, but upon further inspection, it appears that is due to the Arduino library and example program largely ignoring many errors that occur intermittently (!). Those errors cause intermittent bad data values but the Arduino code ...
Just for your information, I also had my share of issues with the build in I2C library.
Since I switched to bitbangio.I2C all works fine...
btw: I did not observe my problems with the LC709203F lib but with the INA219 and the AW9523 GPIO expander libs.
I am happy to help testing....
@jepler It is again failing at language files. I really do not need circuitpython.pot file? Thanks
@tulip sleet do we have some boilerplate about please don't add frozen modules? frozen modules that were not added as submodules are the reason https://github.com/adafruit/circuitpython/pull/7135#issuecomment-1309356235 is failing. I'd like to recommend the submitter not freeze the modules, because I think that's our standard line.
There are some folks who do want to freeze modules, based on the use case of their board (e.g., for education). So we don't recommend it in general, but will defer to their judgment.
In this case, if this is a badge for a conference or whatever, frozen might be appropriate.
they are having enough trouble with github that I'd have to step in and do all the submodule stuff 😕
which I guess is fine, I shouldn't grump about it
well... I think they should learn how to do it: https://learn.adafruit.com/building-circuitpython/adding-frozen-modules
if you're willing to do it, OK, but first maybe ask about whether they really want the frozen modules. Let me find another discussion of that.
The build is failing for the following reason:
make: *** No rule to make target '../../frozen/Adafruit_CircuitPython_UC8151D', needed by 'build-maker_badge/frozen_mpy'. Stop.
Additional steps are needed to properly add a new frozen module that has never been included before in any board. We have a guide on doing this via git on your local computer: https://learn.adafruit.com/building-circuitpython/adding-frozen-modules -- as far as I know you can't add a new submodule merely by...
@onyx hinge https://github.com/adafruit/circuitpython/pull/6526 is all I could find
Hello everyone 👋 ! I just joined the server so hopefully this is the right place to ask my question
you won't know until you ask it
I have a good few hundred neopixel LEDs and I was wondering if I could write the code for my project on my PC and control GPIO pins on the raspberry pi that's on my local network.
@stuck elbow sorry man took me a while to write it 🤣
that's more of #help-with-circuitpython question
aight, will ask it there, thanks!
or even #help-with-linux-sbcs
since you don't necessarily have to use circuitpython for that
yeah I mean I wouldn't mind switching to arduino at all, as long as it works
it's actually quite funny because the library is called adafruit-circuitpython-neopixel, so... yeah, I'm sure I'm not the only one who's a bit confused 🤣
no problem at all, it's just that you are likely to get better answers there
I was wondering about that. The CircuitPython repo has a custom system for getting submodules, but it still works to add more using git submodule add as in the guide?
Actually this test-setup works fine with the build in board.I2C()

Is that an ESP32-S3 board?
Is that an ESP32-S3 board?
Yes, a Feather S3 from Unexpected Maker.
Please paste code as text if you can, thanks.
print("hello battgauge")
import sys
import time
import board
import bitbangio
import supervisor
from adafruit_lc709203f import LC709203F
i2c = bitbangio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
if not i2c:
print("init I2C went wrong!")
else:
print("init I2C ok")
while not i2c.try_lock():
pass
print("I2C locked!")
# Find the first I2C device available.
devices = i2c.scan()
i2c.unlock()
print("I2C unlocked!")
for devic...
The line in big font is actually commented out as you see in the "picture" above.

And it actually worked 5333 seconds without a error!

This is the CP-Version I am using.
Oh no worries, thank you for reviewing and approving.
Is there a list or place I can find all the different bootloader mode names for boards (like QTPYBOOT)? Looking to write a program that helps with loading firmware but need to know what to look for.
You'd find most of them in the tinyuf2 repo, but some boards have a hardware uf2 or other bootloader and wouldn't be found there.
and tinyuf2 is only for ESP and STM, there are other repos for atmel and NRF
or you can use discotool 😉
how exactly do you want to do it ?
you can identify a BOOT drive by the presence of INFO_UF2.TXT in it, which will also contain basic information about the board ID, but of course on RP2040 there is no way to find the board from that
I don't think there'd be any way at all at the bootloader level to distinguish between rp2040 boards
yep
discotool tries to provide an identifier for the USB port that the board is connected to, so that you can have a Circuitpython board, make it reset in UF2 mode and find it again by the port it's connected to
but that assumes you already had CP on it
I was actually going to borrow the same code that circup uses, and just add a parameter for those specific names instead of just CIRCUITPY.
with rp2040 you could read out the contents of flash and try and make some sense of it somehow.
Oh, does discotool already do this?
since the rp2040 bootloader allows you to extract a uf2 image off of the device.
discotool doesn't care about the name CIRCUITPY, if finds drives connected to microcontrollers, which are defined as: USB devices with a serial port OR USB devices with a VID in the list of known VIDs
there is:
❯ picotool info
Program Information
name: CircuitPython
version: 8.0.0-beta.2-9-g5192082e6
web site: https://circuitpython.org
features: double reset -> BOOTSEL
that's not good enough 😦
You could relatively easily use picotool to read the non-CIRCUITPY flash contents and compare hashes with a list of official releases, but that would only work for official builds.
Ahhh, discotool is likely what I want, thanks for the tip!
here is the code I wrote for auto installing UF2s (updating CP) and code.py on CP boards, but I didn't actually use it so it's more like an idea:
https://gist.github.com/Neradoc/64795d4c9b7b5ecd12217b773fdbad92
CircuitPython version
Hi
Have no idea what the units of the mouse movement are: pixels? relative something?
Also, when going back and forth can't get to the same place, which is strange.
Help please.
Code/REPL
-
Behavior
Description
Additional information
mouse is just emulating a regular mouse. It is just requesting to "move this many units" in X and/or Y. This is how a regular mouse works. It's up to the host computer to interpret that. And if you move larger distances, you will invoke the acceleration algorithm on the host computer, which is perhaps why you are not going back to the same place.
Ah, perfect, I'll take a look for reference
This kind of support q is better asked in https://adafru.it/discord or https://forums.adafruit.com/viewforum.php?f=60
When can this be added? I just bought this board for a project and going with CircuitPython would be great.
See https://github.com/adafruit/Adafruit_CircuitPython_LC709203F/pull/21 for a proposed workaround for this problem.
Adding the MechWild PillBug, a blackpill compatible nRF52840 powered dev board. VID/PID combo was purchased through MCS Electronics
If that is not acceptable for whatever reason, I was looking for documentation on applying for one of the 0x239A Adafruit PIDs, but could not find a good source or other examples of them being assigned since around 2020.
I also inten...
Just shouting out that I am the one that submitted this, in case it comes up for discussion on what might need to change.
Thanks very much, It is crazy, looks like there is many secret features.
not understand why
supervisor.reset_terminal(display.width, display.height * 2)
etc for 80x160 display works only
supervisor.reset_terminal(display.width,95)
and for 320x240 is best value
supervisor.reset_terminal(display.width, 260)
but now that I think about it, the status bar (without logo) is a great feature, but I would like to be able to write in it via
print()
and also need bigger font
@ajnbrs Any chance you can share your Micropython code that produced this issue?
You can set display.root_group.scale=2 to make it use double pixels, which technically makes the font bigger, though it doesn't look that great. Of course you will need to adjust the size of the terminal too. Unfortunately the font is compiled into the firmware, so to use a different font, you would need a custom build.
Thanks Radomir, I can now read without glasses. Where do you go for that secret information? I didn't find it documented anywhere. Which font format is recommended for custom build?
Is somewhere secret setting to make display faster? (using Pico & st7789 320x240) maybe SPI speed?
The scale parameter of a group is documented here: https://docs.circuitpython.org/en/latest/shared-bindings/displayio/#displayio.Group.scale
The baudrate can be set when creating the FourWire bus: https://docs.circuitpython.org/en/latest/shared-bindings/displayio/#displayio.FourWire
The font can be set in the board definition like this: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/ugame10/mpconfigboard.mk#L37 -- it uses .bdf format. You can create/edit it usin...
That VID/PID is OK. Another source would have been https://pid.codes. Are you ready to have this merged?
@dhalbert Yes, please.
FYI, the usual reviewer for the nrf52 bootloader repo is out for a few days
appreciate the heads up. this isn't super time sensitive
Updated my local branch, cherry-picked the commits from paul-1's fork, thanks @paul-1!
And I am now giving it another try.
As soon as I get the disconnection working, we should be able to merge this.
Not sure if you or anyone has some advice about the country code commit. I know we are initializing the wifi chip early, so that the digital pins are available for general use. That appears to be the only time we can set the country code. The default wifi country is a global wifi policy.
Perhaps before wifi init we should use getenv to look at see if the user has a valid country code defined in the .env file?
is there any way for me to build circuitpython with debug symbols and actually do meaningful debugging on picow?
The pins are there, I have a pi400, I can debug it with native gpio.
I have used gdb like 2 times in my life, but I really need to extract data if i'm going to implement the picow-ap
I have openocd configured and ready
I have tested it with a pico, and I can halt/reset it
but I don't know how to actually debug circuitpy with it
I have not tried this on a pico w; @onyx hinge might have. I do plenty of gdb debugging on atmel-samd boards. you can do a lot of printf-style debugging:
mp_printf(&mp_plat_print, "i is now: %d\n", i);
No, I haven't used gdb debugging with pico / pico w lately. I mostly do printf debugging
Alright, thanks, I will stick to printf spam!
You have several sub problems:
- getting gdb to talk to your hardware
- learning the restrictions (such as small number of breakpoints) of the debugger implementation
- getting useful debug information into firmware.elf
For the former, you should be able to follow instructions from raspberry pi and learn about any caveats from them.
For the latter, we never strip circuitpython by default so you should have function-level information. you can make DEBUG=1 to include additional debug information such as line-level information (equivalent to gcc -g3); you must make clean and then consistently specify make DEBUG=1 or things get messed.
but yeah it's not how I work so I can't give you 'in the trenches' info
Verifying that debug info is present in firmware.elf: $ arm-none-eabi-gdb ports/raspberrypi/build-raspberry_pi_pico_w/firmware.elf GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.1.90.20201028-git … (gdb) list *main 0x10026f3c is in main (../../main.c:916). 911 return exit_code; 912 } 913 914 int __attribute__((used)) main(void) { …
doesn't sound ver complicated tho, I will try it, and if it ends up working well, I will do a writeup
I have openocd working already with rp2040
those picow debug pins were such a pain to solder
and its gonna be an even bigger pain to clean
did you solder them underneath?
no real reason to clean if it's just flux
mine is conductive for some dumb reason
cleaning
had 3 boards crashing due to flux bridging stuff, now I am kind of a maniac with the flux removal sprays and stuff
oof, I'd discontinue using that flux!
Currently awaiting bootloader PR approval (https://github.com/adafruit/Adafruit_nRF52_Bootloader/pull/284), so the referenced bootloader is in anticipation of its approval.
what kind of flux is that?
I am using leaded rosin-core solder for non-SMD work still
that kind of flux is for soldering pipes and stuff
???
uhh what?
don't use it on electronics. It's acidic and will eat away at your connections
did you buy it at the hw store?
literally at my microcontroller retailer
over 10 boards are soldered with it already
painn
clean them really well but if there's flux inside the connections, you may have trouble later
use rosin core flux or other flux marked for electronics soldering, and tell your store not to sell that stuff
it's for plumbing, jewelry, stained glass, etc, NOT for electronics
Alright, thanks a lot man! I would have never known..
shame on that store
This explains as to why its also conductive..
oh man, glad we caught this early
what kind of solder are you using? Most electronics solder has a rosin core built into the solder wire
dis, its a simple lead-free I got from the same store
can you find a link for that?
the leaded stuff smell nasty
you should buy solder that's specifically marked for electronics
no part number on that pic; is there another label?
that company sells a lot of odifferent kinds of solder
maybe we should go to a different channel as to not pollute the dev channel
go to hw design yah
Thank you, I have been using that since a bit of time... Found it in a hardware store and I was super happy to finally find "Flux" as before that I was using none.
Now I need to remember and check the board where I have used that... 😭
these fluxes should be labeled "NOT FOR ELECTRONIC USE". sad that they are not
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4 on 2022-08-29; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2
Code/REPL
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
# SPDX-License-Identifier: MIT
"""CircuitPython status NeoPixel red, green, blue example."""
import time
import board
import neopixel
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixel.brightness = 0.3
while True:
pix...
Well I mean mission success
alright someone left broken debug code in picow radio
it doesnt compile with DEBUG=1
more fixing to do.. I will continue tomorrow
It was probably me. feel free to submit a fix. copypaste code from lwip seems to use the DEBUG macros as well, and the debug messages are just broken
Side conversation determined that the wrong firmware was being loaded (plain Feather ESP32-S2 instead of TFT version)
Using a QT PY ESP32-S2, an SSD1322 OLED display and CircuitPython 8. Currently I just have a simple clock displayed although the program has other features. I'm using the built-in RTC along with NTP. Everything works except that after a few days of just sitting untouched as a clock, random pixels start appearing along the top left of the display. If you draw over the pixels, they go away. The program isn't crashing or throwing errors.

This will probably blow out a bunch of boards which indicates it'll need to be ...
don't feel bad @brazen hatch I did the same thing when I first started. Was using plumber flux for soldering copper pipes commonly found in hardware stores. Started noticing all the joints on my boards looked like they were dissolving in acid after 3 months, because they were. Joints looked like they were 30 years old not 3 months old. Got some chip-qwik flux and everything good since. Still need to clean with alcohol though after use.
This branch has some unrelated stuff in it, I'll rebase it out before bringing out of draft.
Huh? My boards look nice and shiny somehow..
They have been soldered for over 5 months now..
To it's defence though, I am literally spamming Kontakt U (it is a spray, not a kde app) and distilled water.
I do 3-4 passes till it's perfectly shiny and all the laser etchings are visible.
it's very possible at the time I wasn't cleaning the flux off. :/
oof
Though all were revived after cleaning
some were powering off after like 40s
some did random reboots
some reset
kinda same, i was having all kinds of weird issues. posted on the forums and someone helped me learn the error of my ways.
and stayed with reset.
Anyways, now I have one morbiliion boards cuz of this
All were fixed with like 3€ worth of sprays and a toothbrush
https://forums.adafruit.com/viewtopic.php?t=155352 2019, i've learned a lot since then
if you're not getting oxidation on your joints then probably nothing to worry about it. the amount of scale buildup was visible and obvious.
i'll have to look into deoxit stuff. i have some but have been using 99% IPA, probably does about the same thing.
It now compiles with DEBUG=1.
All yours
static uint32_t ping_time;
Thanks! @bill88t, just one minor suggestion.
Note: It is copied from ports/raspberrypi/lwip_src/ping.c, line 98-100.
If the uint32_t doesn't work, I will revert it later. I will test it with debug anyways.
The build failed for the following reason:
subprocess.CalledProcessError: Command 'git describe --tags --exact-match' returned non-zero exit status 128.
as a policy, each frozen submodule must point exactly at a tag (release), not at another ref. There's a script for updating all libraries. I ran it and updated your branch, so maybe this time it will build successfully.
Late during a build you can get a failure like
subprocess.CalledProcessError: Command 'git describe --tags --exact-match' returned non-zero exit status 128.
let's add a check early (before any board builds are started) that all frozen modules are pointing at a tag, so that hundreds of board builds can be avoided when this kind of problem exists. Prompted by problems encountered by a contributor in https://github.com/adafruit/circuitpython/pull/7135
@onyx hinge For the NeoPxl8 was it designed (or testing done) on less then 8 strands? Noticed the PIO program always defaults to 8 despite what you set num_strands to. Looking at using it (for the PIO) revamping a project I have but not going to (yet) resolder things to multiple pins
@blissful pollen yeah I bet it is only exactly 8 strands right now, pull request welcome 🙂
I was noticing that a qtpy rp2040 has 5 consecutive pins available so .. it'd be nice if that worked!
Thanks, just wanted to check before I got into it, just finding space for 300 pixels on my desk first
NeoBFF5
That would be cool.
One other quick question is the pixel order still strand0.0,1,2,3... stand1.0,1,2,3... or stand0.0, strand1.0, strand0.1, strand1.1, etc. (if that makes sense)
pixels[1] is strand 1 pixel 0
and pixels[8] (if you have 8 strands) is strand 0 pixel 1
in the one example you can see how to construct pixel maps that give you back the individual strands
okay cool thanks. And I just loaded that example up
My past project used adafruit_pixel_framebuf and I think should just be able to take advantage of NeoPxl8 with the map
that would be very cool!
speaking of which, I'm supposed to do a small text scroller for the neopixel bff (5x5) -- did you have font code that might help me out?
@jepler Many thanks for your help! I tried to fix it yesterday at my local build, but without success. Do you have more info about that script to fix this issue? I saw this information at page, which you linked earlier, but I did not figure out how to make it work.

It would be good to mention that script in the learn guide, so peple will not strugle to fix same issue.
Yes I do, let me see if its on Github
The command is "make update-frozen-libraries" in the top level directory. I left feedback on the guide using the " Feedback? Corrections?" link so hopefully the maintainer will incorporate the suggestion soon.
Thanks! It's taken a bit of time and I appreciate your responsiveness to my questions and suggestions. I think it's ready now.
An "IDF_TARGET" line is needed. For instance, if the specific microcontroller is esp32-s2 then it would be
IDF_TARGET = esp32s2
Also, can you verify that you did actually remove the unneeded lines I mentioned before?
https://gist.github.com/gamblor21/25a94e286eb95047157c434ff1eab32b
It was fast enough on a ItsyBitsyM4. If the BFF helper is 5 high something from the IS31FL3741 project may help the glasses were only 5 high (but for that it was a core update I made for speed)
yeah this is strictly 5x5 so it'll display about one letter at a time
I was joking about the "neobff5" (hypothetical product for 5 LED strips in bff form factor) but the 5x5 "neopixel bff" product is real
Yeah I did basically realize that (though not really familiar with the 5x5).
I left feedback on the guide using the " Feedback? Corrections?" link so hopefully the maintainer will incorporate the suggestion soon.
Done.
I am curious the speed diff for 300 pixels if it is say 1 vs even 2 data lines.
❤️ @tulip sleet thank you for making that quick improvement on the guide!
Some folks here mentioned they seemed to need rust to install minify_html, which is listed in requirements-dev.txt. But it's a Python-only package, as far as I can tell. I don't have rust installed and I am able to use the package.
under what circumstances does it need rust, or am i misunderstanding?
@tulip sleet it probably depends whether there is a wheel available for your system. The description on github says "A Rust HTML minifier meticulously optimised for speed and effectiveness, with bindings for other languages."
so it's probably affecting m1 mac folks for instance, but not linux folks?
https://pypi.org/project/minify-html/#files there are only wheels for x86_64 macosx, not arm macosx
the user in q needed it for WSL2, which is a bit strange
they have wheels for 3.8 through 3.11 manylinux x86_64 which should cover wsl2 unless it's a very old or very new python
part of me thinks we could investigate other minifiers that don't depend on native modules, but .. for most users it's OK. I've never tried to install rust on my own system fwiw
I thought the first report came from a mac person but maybe I jumped to a conclusion or maybe there are multiple people hitting trouble
I have a guide feedback for WSL2.
its main virtue is that it's faster, not sure it matters given how little we have
anyway I am documenting the rust thing for now
https://github.com/adafruit/circuitpython/pull/7160 rose also(?) ran into it. I was thinking she was on mac but she didn't say.
I think you can also end up with a python/pip setup that's not capable of downloading wheels even if they're available? "Support is offered in pip >= 1.4 and setuptools >= 0.8." .. but those are both super old versions now, setuptools is over 60 and pip is over 20 in versions now
What "core update for speed" are you referring to?
there was that person that mentioned rust #circuitpython-dev message
- in order to install requirements-dev.txt and requirements-doc.txt, I needed to install Rust first (didn't come with Ubuntu):
minify-html, required in requirements-dev.txt, uses Rust underneath. This is fine when the pre-built wheels exist, but otherwise it makes rust be a dependency. minify-html is nice and fast, but we don't need a superfast version. Maybe let's find a Python-only one to remove this slight annoyance.
@blissful pollen did you specifically have a 5 pixel tall font or did you use a bigger font via the optional 3x scaling?
Sorry I meant the IS31FL3741_FrameBuffer module vs the pure py thon one
I think I used a 15 pixel and scaled it. There was a tomthumb.bdf (i think?) font PaintYourDragon had that was 5 pixels. let me check
https://github.com/apparentlymart/ledpixels
It is 4x6 (but can ignore the top or bottom line). I think the original was an Arduino font.
https://github.com/adafruit/Adafruit-GFX-Library/tree/master/Fonts
Has the font in Arduino form
cool, thanks for the links
Fixes #7081
Ignore pin alarm changes before deep sleep has started. Previously, the pin could change, triggering the interrupt handler, and clearing the alarm setup, preventing detecting pin change during deep sleep. Now the interrupt routine ignores changes until the last possible moment. There is a tiny sliver of a race condition, but it is very, very narrow.
@billedluh Could you test this? IThanks. tested on a Feather RP2040, grounding a jumper many times before sleep. I was able t...
Thanks @bergdahl and @wtuemura.
I'm guessing there's a reason why not, but can interrupts be disabled or masked here to eliminate the rest of the race window?
That routine sets a single boolean, so it's very tiny, and probably done inline, then the reset happens. Since the reset doesn't mess with the interrupts, even if I guarded alarm_pin_pinalarm_entering_deep_sleep();, there would be a time immediately after it, and before the reset_cpu();, when an interrupt might happen. So I'm not sure it would help any. But maybe I'm thinking about it wrong.
The temperature sensor API is available for the ESP32-S3: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/temp_sensor.html
The linked issue is related to the temperature sensor driver for the ULP coprocessor.
@igrr Thanks - I will see about adding it. We are still on 4.4.3 at the moment.
Hi, I was wondering about drive strength on RP2040. Not found anything about it in the source code yet.
Datasheet says "The GPIOs on RP2040 have four different output drive strengths, which are nominally called 2, 4, 8 and 12mA modes"
we set it to 12ma in DigitalInOut and UART
What about PulseOut and PIO?
it is not set in those
digital/DigitalInOut.c line 107 and busio/UART.c line 135
If you'd like to make a PR, that would be great
Do you mean it should be 12mA for everything?
I'm looking up some PR's
in general we set it to strong by default at least for DigitalInOut. The UART change was made as part of RS485 support, it looks like.
Limor's philosphy is to set it to strong by default, makes for fewer support problems. .e.g https://github.com/adafruit/circuitpython/issues/1270#issuecomment-463457634 (on nRF)
I see the default is 4 mA
I have some IR things on PulseOut and PIO where 12mA would be plenty but 4 is perhaps not quite doing it
And a visible LED with PWM that might be dimmer than expected?
yes, if there's no API to change it, it should be the max. There is a bit of an exception on the nRF chips, where high drive strength on pins near the radio can cause interference, so they don't recommend it.
but we know about that
Hey, there’s a really interesting confluence going on right now. The graphical, sound-focused programming language plugata just gained the ability to compile into Python. That puts it in sniffing distance of working on any CircuitPython board, which means that DIY synth builders can build on embedded platforms and, probably most excitingly, it’s an editor that can reach a whole new kind of brain for any digital, embedded project.
(Sorry to interrupt. I’m really excited.)
Ah yes I see it. Tried searching for "drive" or "strength", but the comment says 'Turn on "strong" pin driving' 😉
Also, I didn’t know you could switch current supplies on pins and that’s really cool.
There isn't a CircuitPython API for it (yet?) so CircuitPython needs to decide what to set it to. And they were saying maximum is best except where there's a particular reason.
Higher drive strength than needed isn't normally a problem as long as your circuit is OK, while lower than needed can mean that stuff doesn't work.
It’s a normal mA capacity, right? So you’re saying it’s probably better to design the peripheral circuit to not draw too much current so you don’t just starve your peripherals by accident. Still, built-in current limiting seems like it could matter in the wild.
plugdata x CircuitPython
Hi all, I'm currently looking atulab: (https://github.com/v923z/micropython-ulab); it's got a bunch of extra functions in python files in the snippets directory. These aren't automatically imported when circuitpython is built, but I think they could be really useful. I've tried setting FROZEN_MPY_DIRS to the snippets directory, but I just get errors with relative imports, however, the bin file is about 18k bigger, which sounds about right. ere to
I've tried also creating a separate frozen dir and creating a separate ulab dir there with it's own __init__.py, but that doesn't seem to import at all well
Any suggestions?
When I say the second attempt didn't import I mean that I couldn't see any of the snippets I was hoping would be included
Ooooo shiny
@mystic flume RIGHT?
It’s got 20 years of codebase, but Timothy’s work on it from just the last two years turning into his fork is monumental. It’s like he’s made a whole new thing in two years with all the benefits of people collaboring on it since 1992 or something.
Holy crap 1992 is 30 years ago, not 20. I keep forgetting.
I'm sure 1992 was a couple of years ago.
so I bought 2 pybstick boards, one is RP2040 with 1MB of flash and the other is a ESP32C3 with 2MB of flash, dunno if I should bother trying to add them to CP with those limitations...
I just checked: it was first released in 1996, so at least that’s only 26 years ago.
I'm just building CP for the Pico
comes in at 719kb flash usage for circuitpython
so you've got about 300k-ish of space for the flash drive etc - enough to play with
yeah that's what it has in MP
Right, say if you have a LED and you want 8mA, and the pin has the 12mA drive strength, you just choose your resistor get 8mA as normal.
(they ship with MP)
Dunno about ESP32 - I presume needs more space for bluetooth/TCP/IP stack?
Makes sense! Why would you want to limit on the μC end? Low part count?
ah no I think the C3 is 4 MB, I misread, that's more standard at least
To reduce chance of damage in case of mistakes I guess.
Including rules about "total current drawn from all GPIOs"
Limiting the current for your circuit by using the drive strength doesn't seem like a good idea, since it's not that well-defined
Here's some info from broadcom about the raspi:
Two reasons:
1. The raspberry-Pi 3V3 supply was designed with a maximum current of ~3mA per
GPIO pin. If you load each pin with 16mA the total current is 272mA. The 3V3
supply will collapse under that!
2. Big current spikes will happen especially if you have a capacitive load. That will
"bounce" around all the other pins near it. It is likely to cause interference with the
SD-card or even the SDRAM behaviour.
What is a safe current?
All the electronics of the pads are designed for 16mA. That is a safe value under which you
will not damage the device. Even if you set the drive strength to 2mA and then load it so
16mA comes out that will not damage the device. Other than that there is no guaranteed
maximum safe current.```
Unfortunately seems like a lot of data sheets don't seem to state max current source/sink per pin these days
I'm looking particularly at the nordic chips here Grrr
So it is about interference. Not totally straightforward then.
Custom font compilation works with brutalist-6.bdf
My font Pavlova16s.bdf give this errors:
`make BOARD=armachat
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-armachat/genhdr
GEN build-armachat/genhdr/moduledefs.h
QSTR updated
Traceback (most recent call last):
File "/home/bobor/Desktop/circuitpython/ports/raspberrypi/../../tools/gen_display_resources.py", line 94, in <module>
b[overall_bit // 8] |= 1 << (7...
This allows vectorio shapes to be hidden with a property on the objects. Previously the only way to hide them was by putting them into a Group and then hiding the Group. With these changes they can be hidden directly without a parent group.
I used this code for testing the new functionality:
import displayio
import vectorio
import board
from adafruit_display_shapes.circle import Circle
import time
display = board.DISPLAY
main_group = displayio.Group()
palette = displayio...
This is an ESP32 WROOM based board. The board files modeled after the adafruit-feather-huzzah32.
Hi is here any secret codes/or can be added to use colors on internal display connected to displayio?
Thanks for circuitpython, is my favorite imbedded language ;)
Unfortunatley, the way terminalio is implemented using displayio.TileGrid, it's not possible to change the colors of individual characters, though you can change the color of the whole screen by changing the palette being used. Adding it would require quite some changes.
Without reading the datasheet, I was imagining that you could disable interrupts, set up the wake interrupt sources, and then reset without ever enabling interrupts, a la:
disable_interrupt()
enable_pinalarm()
// (no enable_interrupt() here
reset()
this would make it so that there's no window before reset where interrupts are enabled. But it depends on the post-"reset" CPU state not caring that interrupts were disabled pre-"reset". This is analogous how __WFI for entering light...
reset_cpu() is not actually a regular reset. This is its implementation:
https://github.com/adafruit/circuitpython/blob/f76351d17809f43afd6a77245d546951c7474050/ports/raspberrypi/supervisor/port.c#L203-L210
well that's weird. I tried reactivating WFI in port_idle_until_interrupt on rp2040. My picow starts and resets just fine but either timekeeping or sleep() time are messed until I do something like write to CIRCUITPY! my main loop looks like this: while True: pop.frame() pixels.show() time.sleep(.10) i += 1 t1 = adafruit_ticks.ticks_ms() diff = adafruit_ticks.ticks_diff(t1, t0) if diff > 1000: print(f"{i * 1000 / diff:.0f}fps") t0 = t1 i = 0 and before any change it consistently prints 10fps. This makes sense because the sleep of .10 seconds is huge compared to the computation time. But right after the change, it prints 7FPS! until I write to CIRCUITPY, and then it prints 10FPS! ```diff
diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile
index 5095c4c1f8..7f9a3a09fe 100644
--- a/ports/raspberrypi/Makefile
+++ b/ports/raspberrypi/Makefile
@@ -127,6 +127,7 @@ INC +=
-I../shared/timeutils
-Iboards/$(BOARD)
-Iboards/ \
- -isystem ./../../lib/cmsis/inc
-isystem sdk/
-isystem sdk/src/common/pico_base/include/
-isystem sdk/src/common/pico_binary_info/include/
diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c
index 781d2b11d2..7a5ed9ccb4 100644
--- a/ports/raspberrypi/supervisor/port.c
+++ b/ports/raspberrypi/supervisor/port.c
@@ -72,6 +72,9 @@
#include "supervisor/serial.h"
+#include "tusb.h"
+#include <cmsis_compiler.h>
+
extern volatile bool mp_msc_enabled;
STATIC void _tick_callback(uint alarm_num);
@@ -269,10 +272,9 @@ void port_interrupt_after_ticks(uint32_t ticks) {
void port_idle_until_interrupt(void) {
common_hal_mcu_disable_interrupts();
- if (!background_callback_pending()) {
-
// TODO: Does not work when board is power-cycled. -
// asm volatile ("dsb 0xF" ::: "memory"); -
// __wfi();
- if (!background_callback_pending() && !tud_task_event_ready()) {
-
__DSB(); -
}__WFI();
common_hal_mcu_enable_interrupts();
}
@onyx hinge given that reset_cpu() is not really a reset, I don't see a way to prevent a single instruction window that would lose an interrupt. Maybe a restructuring of when the alarm pin interrupts are actually set up would help, but it's kind of a major change. The PR is still much better than the previous situation.
this is with the serial repl open
Accepting as an improvement over the status quo.
It's definitely sleeping over-long.
This needs thorough testing before it's merged, as we tried and reverted this once before (#5341 and #5356).
I think that besides checking for tinyusb having "something to do", the fact that port_interrupt_after_ticks and port_disable_tick weren't implemented that was causing a secondary problem.
I've tested this on a pico w over reboot-cycles and ctrl-c-cycles, with and without drive automounting, with and without serial repl open, and on a power-only connection.
I didn't notice...
Does this change support the 4MB/8MB/16MB flash variants, or only the 2MB version?
Tested on Feather ESP32-S3 4/2. Works -- thanks!
@Neradoc @MicroDev1 @urish if any of you have time & interest in testing out this branch it would be helpful!
CircuitPython version
CircuitPython 8.0.0-beta.4-17-g9e94d7e75 on QT PY ESP32-S2
Every time you change the text on a label it consumes around 6.4K of free memory.
Code/REPL
from adafruit_display_text import label
from adafruit_ssd1322 import SSD1322
from board import D9, D17, D18, SPI
import displayio
import gc
import terminalio
displayio.release_displays()
display_bus = displayio.FourWire(SPI(), command=D9, chip_select=D18, reset=D17, baudrat...
Hi, that's not a memory leak, Circuitpython uses a garbage collector.
As the program runs memory is allocated and mem_free() goes down until it can no longer allocate, which triggers the garbage collector, which you can call in your loop with gc.collect() and see if the mem_free stabilizes, as it should, more or less. If it doesn't, then we can look into a memory leak.
Assigning a new text to a label means discarding the previous image representation of the label and creating a new one,...
Ported some of this project from the UM Feather S3 + TFT featherwing to an Adafruit Feather S3 4mb/2mb + RGBmatrix panel + RGB matrix featherwing. It's also crashing into the hard fault handler. Reliably. Only experimented with it for a couple hours last night. Initial impression is the timing related bug is still present on 8.0.0 beta 4. Fault handler crashes to safe mode which requires a hard reset. It only crashes when wifi is added to the code, was trying pull API data from an online so...
Unfortunately, the garbage collection doesn't occur until the program is almost out of memory. With the loop above, the 2 MB of memory is depleted in under 30 seconds. I only noticed the usage because it is part of a much larger program that was experiencing weird memory crashes.
I will try the bitmap_label tonight. I did insert a gc.collect() when I noticed but it just seemed like bad practice.
Are there any other Display IO text objects optimized for fields whose text changes eve...
Unfortunately, the garbage collection doesn't occur until the program is almost out of memory.
That is how it works. Garbage collection triggers when the code tries to allocate memory and there is no space left in the "free" memory. It does not mean that the board is out of memory, it just means that it's time to clean up. Calling it manually is a form of memory optimization that can be efficient in reducing memory fragmentation typically, if called in strategic places.
I only notic...
Espressif boards need an sdkconfig as well as the other files mentioned in the guide. The best starting point is an sdkconfig from a similar board, with the same chip, etc.
I have an sdkconfig file. The board is basically a copy of the Adafruit Feather Huzzah32 with pin changes. It appears that a .gitignore file removes the sdkconfig file.
Here is the .gitignore that I believe removes my sdkconfig file:
https://github.com/adafruit/circuitpython/blob/main/ports/espressif/.gitignore
Oh yeah, I was working on adding a C3 board today and noticed that ports/espressif/.gitignore now ignores sdkconfig* (I noticed because it made ag skip those files by default). This comes from #6974
My project is also audio synthesis. Timing is critical, and I'm trying to find a way to do it with the PIO, but the FIFO is extremely small for buffering audio, and with CircuitPython I don't have the option of triggering an interrupt to run the generation code as needed. I haven't written any code yet, so I'm not sure exactly how limited I'm going to be yet, but the ideal situation would be to be able to use the second core to generate the audio and the first to handle user input and the...
@MicroDev1 Notice the .gitignore issue above, from #6974.
whoops! 😅
@MicroDev1 Notice the .gitignore issue above, from https://github.com/adafruit/circuitpython/pull/6974.
Following should allow inclusion of board skdconfig while blocking build files.
-sdkconfig*
+./sdkconfig*
@bborncr Can you make the changes? It seems like "Allow edit by maintainers" is turned off for this PR.
Does this change support the 4MB/8MB/16MB flash variants, or only the 2MB version?
I think only the 2 MB variants as that was the only hardware I had at the point in time when I worked on this unit.
Thank you for merging my board.
Great! It worked! However, should it have built all Espressif boards?
Great! It worked! However, should it have built all Espressif boards?
Yes, because changing the .gitignore file was at the top of ports/espressif, so it potentially influences anything below it.
bitmap_label use 4K as opposed to 6.4K per loop.
from adafruit_display_text import bitmap_label
from adafruit_ssd1322 import SSD1322
from board import D9, D17, D18, SPI
import displayio
import gc
import terminalio
displayio.release_displays()
display_bus = displayio.FourWire(SPI(), command=D9, chip_select=D18, reset=D17, baudrate=10000000)
display = SSD1322(display_bus, width=256, height=64, colstart=112)
mem_label = bitmap_label.Label(terminalio.FONT,
...
I noticed in the actions of https://github.com/adafruit/circuitpython/pull/7204 that docs didn't build after a change of .github/workflows/build.yml. However, the file can affect the output of the doc build (e.g., changing it from using 3.10 to using 3.x). The script should account for this.
In C, "static" means that the scope of the thing (ping_time) is restricted to the single source file. So, when debug is enabled there's one "ping_time_ variable in Radio.c, and it's separate from the one in "lwip_src/ping.c". The print in Radio.c will always be based on a ping_time of 0, so it'll show incorrect results.
(that's one meaning of static, it has others :rofl: but that's the meaning when it's used to declare a variable at function scope)
Thanks -- wish we would do this more transparently in shared-bindings, but it's fine.
I didn't check for how ping_time was being used in the code, now that I have taken a look at the implementation, I think it would be better to just move the custom pin_recv function to ports/raspberrypi/lwip_src/ping.c.
I'm having the same problem with CircuitPython 7.3.3 on a pico. Anyone found a fix/workaround?
We talked about it on the Discord a few days ago but I thought I should raise it here too.
- The datasheet says "The GPIOs on RP2040 have four different output drive strengths, which are nominally called 2, 4, 8 and 12mA modes", and the default is 4mA.
- CircuitPython currently sets it to 12mA in DigitalInOut and UART, and doesn't set it for PulseOut, PWMOut or PIO.
- CircuitPython policy is normally to use max drive strength except where there's a particular reason not to?
- There coul...
.. by moving it into a new weak function that can be replaced just by the picow build.
I was stewing about this and Dan also mentioned that the way that cyw43 poked its head out into shared-bindings was gross. A weak function that allows the port to substitute a different check is a way to move the complexity back where it belongs.
This is a very nice solution. Making the validation routines weak functions is great to avoid having to implement them in all the ports.
Follow up to #6411, and based on Fabian's work there.
I only have the 16MB board, so as I can't test them I haven't added the 4 and 8MB versions.
Maybe, it looks like it ran last night. If no one manually retriggered it it looks like its resolved!
I noticed this stacktrace in one of the actions task for the scheduled jobs:
https://github.com/adafruit/circuitpython-org/actions/runs/3460106060/jobs/5776269092
it's inside of `adabot.update_cp_org_libraries step
Running circuitpython.org/libraries updater...
Run Date: 14 November 2022, 09:24AM
- Report output will be saved to: /home/runner/work/circuitpython-org/circuitpython-org/bin/adabot/libraries.v2.json
Unhandled exception list index out of range
Traceback (most recent ...
This is a very nice solution. Making the validation routines weak functions is great to avoid having to implement them in all the ports.
I fixed (I hope) the build errors and re-titled the PR since the phrase "non-public code" could be open to misinterpretation :)
Yeah that should be the step that gathers all the information needed for generating that page. If it fails, I assume it uses the existing (previous day's) information when regenerating the website since that file never gets overwritten.
That's also my code from adabot that's causing it to fail so I can wrap it in a try/except - looks like it trips up checking the CI status if the CI has never run, so I can patch that.
Alright, submitted the fix to adabot; I'll also update it as a submodule here once that's approved and merged.
It's more efficient passing one register-sized structure than 4 arguments or 4 pointers; working on intermediate values of 'int' size is also more efficient in code size!
On raspberry pi pico w, this increased free flash space by +104 bytes. It also increased the speed of my testing animation very slightly, from 187fps to 189fps when run 'unthrottled'
If we do this, I'd prefer to also redirect /board/board-name to /boards/board-name. The redirect to all the boards would then go from /downloads to /boards. This would make more sense if we ever created a circuitpython.org json REST api as well. https://circuitpython.org/boards/raspberry_pi_pico_w.json, etc.
In hindsight, this what the endpoints probably should have been when the site was first built, but we went with a more traditional /downloads endpoint that kind of stuck.
If we do t...
Umm ports/raspberrypi/lwip_src/ping.c is unused.
I renamed it and the build was successful.
Removed source files are a class of problem not detected by the build system, that is, if "foo.o" has been created and "foo.c" is subsequently removed, the build system does not signal a problem, it just re-uses "foo.o".
According to this test, the file is used
jjepler@bert:~/src/circuitpython/ports/raspberrypi$ echo '#error check if unused' > lwip_src/ping.c
jepler@bert:~/src/circuitpython/ports/raspberrypi$ make
I: Building for raspberry_pi_pico_w 0
Use make V=1, make V=2 or s...
I always clean before making. I don't care if I lose time like this.
I run am running make V=0 BOARD=raspberry_pi_pico_w clean && make -j4 V=1 DEBUG=1 BOARD=raspberry_pi_pico_w.
(I know I could just set the variables once)
Commit incoming.
Now, the lwip_src folder is completely unused. And ping_time is captured.
I will probably do a cleanup commit and then test the changes on some real hardware.
Converting to draft till done.
Umm
ports/raspberrypi/lwip_src/ping.cis unused.
Hmm... does it use ports/raspberrypi/lib/lwip submodule?
If so we should probably delete the lwip_src folder in order to avoid confusion.
yes, lib/lwip is used
lwip_src exists specifically so that files from lwip that unavoidably had to be modified didn't require us to change the submodule. It's nice if we can reduce this to 0.
Git does not track directories per se, so if after an update there are no tracked files in the directory, and no untracked files in the directory, I think git removes the empty directory. Likewise in a fresh clone it will not create the directory in the first place.
I tested this successfully on a NeoTrellis M4 using this modified version of the pixelmap example from the led_animation repo:
import board
import neopixel
from adafruit_led_animation.animation.comet import Comet
from adafruit_led_animation.animation.rainbowcomet import RainbowComet
from adafruit_led_animation.animation.rainbowchase import RainbowChase
from adafruit_led_animation.animation.chase import Chase
from adafruit_led_animation.animation.rainbow import Rainbow
from adaf...


