#circuitpython-dev
1 messages · Page 14 of 1
yeah it's up to you
by convention, the first in the list would match the silk, if that's appropriate
oh the pykey is actually missing the default port definition on mpconfigboard.h
you want something like that for board.I2C() to work:
https://github.com/Neradoc/circuitpython/blob/b56d5d97d2ecdd11adb270770beabd0ed96c9c15/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h#L37-L38
#define CIRCUITPY_BOARD_I2C (1)
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO20, .sda = &pin_GPIO22}}
so when they load that it's already set up as a keyboard with a basic keymap?
or do I just have to provide those files separately for them to load after flashing
you mean ^that stuff needs to be in there for the qwiic/stemma connector to work?
that's how you would do, but you can also make a UF2 that contains all of the flash from a pre configured board and flash that
picotool save --all my_full_board.uf2
for the board.I2C() and board.STEMMA_I2C() shortcuts to work
(it would still work setting it with busio and the pin names)
great, thanks
@idle owl I moved the stuff we talked about to the Welcome to CircuitPython FAQ page. I also reorganized the FAQs and put subject headings on groups of related questions. The BLE info fit with the Internet question and i added a q re RFM. Still to do is to put the port-specific-stuff into the RTD doc.
Great!
also I forgot to say I added blue info boxes to the ESP32-S3 and -C3 product guides on the Overview pages to warn about the BLE restrictions on those boards.
@jaunty juniper @tidal kiln note the additions to the FAQ page (https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions) for stuff you can link to for common support q's
nice
@tulip sleet do you know if there's a reason not to use CIRCUITPY_STATUS_LED on the pico ?
the raspberry pico
Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on 8d34445 and it does occur on de95463. That would point toward the issue being from #7023 , which had a big update to esp-idf included. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.
if the user uses, it, it should take over
Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on
8d34445and it does occur onde95463. That would point toward the issue being from #7023 , which had a big update toesp-idfincluded. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.
I did a bisect inside esp-idf to narrow it down further inside the esp-id...
There is already a compile-time option that you can use for this: CIRCUITPY_SKIP_SAFE_MODE_WAIT.
I am reading the newsletter and in particular the release notes of beta.2 . I wonder if for the sentence Added WiFi workflow with browser-based device discovery, filesystem browsing, upload, download, file editing, serial/REPL connection. if true, you could add (available only on Espressif for now) I mean, where is the wifi workflow available? Does it work with build-in AirLift? Any other MCU with wifi (knowing the PicoW does not have the wifi workflow).
I thought the safe mode blink was not enabled when coming out of deep sleep. That would make sense, after all if you need safe mode after deep sleep you can just press reset then enter safe mode.
I thought the safe mode blink was not enabled when coming out of deep sleep. That would make sense, after all if you need safe mode after deep sleep you can just press reset then enter safe mode.
Hmm, it does appear that way.wait_for_safe_mode_reset() in supervisor/shared/safe_mode.c determines whether to wait or not for the safe mode reset. It returns immediately in these circumstances:
https://github.com/adafruit/circuitpython/blob/b56d5d97d2ecdd11adb270770beabd0ed96c9c15/supervis...
I wlll do that.
I think it is one of the place where expectation can be managed. And there are a lot of useful such information, like "only on RP2040 for now".
Not like if everyone is reading the release notes. 😉
@jaunty juniper if you feel like adding and testing the status LED for the pico (trickier on Pico W), go ahead -- that would be nice!
Getting the following error on set_ipv4_address line:
TypeError: extra positional arguments given
Code is below. Creating ipaddress objects as specified in the documentation for the wifi module. ipaddress objects are created correctly.
`dic = {}
with open('PCATS_WID_CONFIG.ini') as f:
lines = f.readlines()
for line in lines:
if line[0] is not '#':
line = line.strip()
key = line.split(':')[0].lower()
value = line.split(': ')[1]
...
I wrote a script to find boards that have board.NEOPIXEL but no status led defined in mpconfig, same with LED if no rgb status, or board.SCL and I2C but no default bus pins in mpconfig (or spi or uart) I'll see if I do a PR with those that it makes sens to add
@tulip sleet thanks. those updates look good. really like how the main sections are broken up.
@onyx hinge re https://github.com/adafruit/circuitpython/pull/7079 Couple of review q's on this, but I can put this in a beta.3 very soon.
https://github.com/adafruit/circuitpython/pull/7059 the prerequisite asyncio merge is now done. Is this ready to pull out of draft? I will make a release of the library. Eva already did.
Does it ring a bell that there may be a missing timeout somewhere in the requests stack (espressif 7.3.3) ...that would require watchdog to recover from?
not that I remember
CircuitPython version
Current main branch. https://github.com/adafruit/circuitpython/commit/b56d5d97d2ecdd11adb270770beabd0ed96c9c15
Code/REPL
# Using adafruit_httpserver.py from https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/blob/ba2da4352290b880592ae5ab5db83ee50c045244/adafruit_httpserver.py
from secrets import secrets
import socketpool
import wifi
from adafruit_httpserver import HTTPServer, HTTPResponse
ssid = secrets['WIFI_SSID']...
Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on
8d34445and it does occur onde95463. That would point toward the issue being from #7023 , which had a big update toesp-idfincluded. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.I did a bisect inside esp-idf to narrow it down further inside the ...
It looks like microcontroller.cpu.reset_reason is returning
I should clarify that when connected to usb it simulates sleep and doesn't actually reset, so the reset reason doesn't get updated. But when I disconnect and run over battery it consistently reports the reason as being SOFTWARE upon being awoken from deep sleep, regardless of the previous reset reason. I'll let y'all decide if that's a bug or not.
I'll poke at using the existing in compile time option, which looks like it should work.
wasn't there something recently about espressif not supporting elliptic TLS algorithms?
I've searched github, meeting notes, and discord
@crimson ferry I encountered that TLS 1.3 wasn't supported on Pico W but that is different than TLS algorithm support.
ok, thanks, maybe I dreamed about the elliptic thing o_O
You can test with https://badssl.com/ -- they have sub-sites including two that are ecc-only, https://ecc256.badssl.com/ and https://ecc384.badssl.com/
@tulip sleet I was kinda sucked in by that "port doom" thing yesterday, I'll dig out and respond to your messages later today.
thanks -- looks like there is a missing include causing build failures
I'll get it sorted. silly me, not bothering to build locally.
do you have a simple test for the big send?
I will make a beta.3 today with that as the last change, probably
@tulip sleet foamyguy saw that "large files" weren't sending with the httpserver. I was just running a manual test connecting to a "netcat -l" listener and sending various amounts of data.
i was just wondering if you can run a simple test again with your latest change to smoke test it
I will
@tulip sleet that PR is updated and I re-tested it; sendall still works after the change.
@tulip sleet next I'm figuring out the status of the async stuff. do you care about getting that into beta.3?
oh, that would be good too, I forgot there's still one outstanding PR
@tulip sleet looks like the updated ticks and asyncio libs are released, so we can update frozen modules?
I did not know they were frozen; I will do that
The tests get the code from frozen/
I don't know if they're actually frozen into something but I guess they must be since the submodules were there
only elecfreaks_picoed; they freeze a ton of stuff, and I already discussed that with them; they really want to
is there a command to update frozen modules or is it a manual process?
make update-frozen-modules at the top level
i can do that, but then you need to approve, or vice versa. If you are in there, you can make a PR, and then it's off your plate
OK it's pulling a lot of changes. I should commit them all?
modified: frozen/Adafruit_CircuitPython_Display_Text
modified: frozen/Adafruit_CircuitPython_RFM69
modified: frozen/Adafruit_CircuitPython_SD
modified: frozen/Adafruit_CircuitPython_Ticks
yes
a lot of these changes are inconsequential; not really code changes
from library sweeps of various kinds
I will be heavily using the display stuff the next few days, so in case any issues pop up, I will probably catch em.
Rewriting ljinux support for ssd1306, as a package
The frozen modules have all the necessary updates now, so this PR is ready for review @dhalbert
@tulip sleet since the core changes of 7059 are MOSTLY only concerned with testing it could also wait .. but https://github.com/adafruit/circuitpython/pull/7059/files#diff-e2baf888039fbdf18dc4d8600714a0a332a02c995a694d98910671bc262ba7a5R293 does close an actual bug (that I hit)
I want to merge that too, so undraft it if you've tested and feel it's ready
@tulip sleet I took it out of draft 2 hours ago but didn't ping or anything
checks are still ongoing 😕
some are failing due to network
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/a7/79/86ea5a4c0b80840671cda065d9e037fd6c402ccc9d37e6ad0b1d2e370e57/awscli-1.25.94-py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f1bb7461d20>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
I will re-run the failed ones when it's done.
lotsa failures these days
yeah
Just one thing about the args.
I am fine with including this and describing it as "experimental" and subject to change. @jepler do you have a comment?
The index arg doesn't seem to be present in the actual arg processing.
Did you give up trying to refactor this similar code into shared/, that you asked about yesterday?
I have made changes to the API and have added CoprocMemory which provides access to the shared memory region.
In the following example:
0x500007fcis the address ofshared_memvariable.- The value of
coproc.memory(program)[0]decides the LED blink interval. - Here is the pre-compiled binary of the ulp program.
🚨 Blink Example:
# CircuitPython
import coproc
shared_mem = coproc.Copr...
I would like to have coproc module present in CP8 so I prioritized this over refactoring for now.
Thanks for fixing this up and adding tests!
Six jobs failed for network reasons, and one got stuck for network reasons:
Received 455017511 of 459211815 (99.1%), 0.3 MBs/sec
I have seen this particular stuckness several times, at the same percentage finished. Cancelling the run to stop this from spinning.
@analog bridge I've been trying for a couple of days to fix the ESP32-C3 boot-loop problem. The only change is the toolchain update from patch3 to patch4 (and eventually to patch5). I built the hello_world program to see what was in the "standard" sdkconfig, and tried changing ours a bit: tried different optimization levels, stack sizes, and disabling/enabling a few things. No luck. It fails in esp-idf's startup.c in most cases; I can turn off some options to make it fail early in our main.c, but there is something fundamental going on. We have our own variation on the build process, with lots of hardwired stuff to avoid their general CMake process, so I will probably start looking at that. I could open an esp-idf issue, but I don't have a test case besides the whole thing, and we're doing enough non-standard that they might not care. I could also ask in esp32.com, but that has generally been fruitless. Do you have any more ideas of things I could try? I'm not going to hold up beta.3 to get the C3's working.
it is odd that the firmware size is quite different going from patch3 to patch4. They did change the riscv architecture designation
I also suspect our build process, I have tried changing things in sdkconfig but no luck.
i can make it work by rolling back to patch3, even with the tip of main
i need to understand cmake better, and maybe rely more on their sdkconfig tooling. Scott put this interesting comment in the Makefile:
# Newer versions of the idf will have save-defconfig that will only include non-default values.
# We should use that when available. For now, we sort out everything.
the save-defconfig thing is present in idf v5.0
but not in 4.4? oh well
since, we are already running custom idf, we can revert the toolchain as a hotfix until the issue is figured out?
the toolchain choice is not flexible per architecture. It is a single version for all chips. I need the esp-idf rolled forward to the current version to get the wifi fixes for the other chips. I would rather keep it on patch5 for the xtensa chips. I certainly could hack up a custom build process for the c3 by copying files around to get patch3 only for those builds. But first I'll study a bit on cleaning up the build process and maybe getting more info automatically instead of wiring choices in the Makefile.
i can't find anything like release notes for the patch<n> releases, but maybe I will ask our Espressif contacts
it seems that esp-idf/tools/tools.json details the toolchain per chip ?
that does, there is also toolchain_versions.mk
which is across all. But I wasn't sure how it was being used
but good point, it may be easier than I feared
my work so far was trying to figure out the cause instead of giving up. But for beta.4 maybe I should just give up, and we can wait for esp-idf v5.0 and clean things up more
Loaded absolute latest onto my Feather RP2040, and now it's called NO NAME, and there's nothing only a boot_out.txt file on it.
Tried again, same.
erase_filesystem, sounds corrupted
Ok will do thanks
Same result.
CP is obviously loaded, because I can get to it through serial.
But....
try beta.2 and erase_filesystem
i want to know if it's due to latest or something else. If you have another Feather RP2040, try that too
I definitely have another Feather, lol
I just tried another Feather, mine worked with the latest from S3
another RP2040?
yup, should have mentioned that
you could try the nuke but honestly that should not be necessary
this issue is still present in idf v5.0
I did see you said that, my hope is that other things (like cleaning up builds) would be easier in v5.0 so I might get it fixed more easily
hmm, could be bad flash, so try the nuke.uf2
Where is it? I don't see it in the guide.
worth trying
is this a brand new one? I wonder if the flash chip changed from under us ??
No it's not brand new. It's pink, but I haven't ordered one of these in a while.
I don't see it on the Pico guide either
i don't know why! erase_filesystem should erase everything that nuke does, but I guess it doesn't
🤷🏻♀️
off to take a walk to Trader Joe's for groceries
Have a good one!
thanks for the merges Dan!
Ok this LED wired up to this light sensor on the INT pin is not doing what I'm expecting it to do. I am perhaps not understanding how the interrupt functionality works for this sensor.
Bleh.
I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.
@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp32-qui...
If anyone's up for approving a PR, here is one in need of a look: https://github.com/adafruit/Adafruit_CircuitPython_LTR329_LTR303/pull/4
As of our main branch, espressif's version of lwip lacks the required bug fix,
https://github.com/lwip-tcpip/lwip/commit/ef76bbe3f0b97e695dff4a8574fe1647a8fe07ed -- marking as upstream.
*Slowly googles more words than I expected to verify*
😂 Nice.
@tulip sleet @onyx hinge I think when we add major changes to CircuitPython, e.g. supporting ESP32, we should drop a note in the discord helpers channel so everyone is aware.
Boy I had to double check way more than I expected, but as far as I can tell that looks correct and I don't see any reason not to merge
Rad, can you leave a comment?
I can merge it if you don't have access.
The comment should be there by now with approval, should I go ahead and merge or would you like to?
You're welcome to! Wasn't sure if you had access.
Thank you for being thorough! I was going off of my own brain which could absolutely have been wrong.
I could have still been wrong and gone, "Nah that is spelled right, I don't need to check" in spaces I thought were solid. My brain has been slow mush of late whenever I'm not deep in my current focus project
I'm still dealing with COVID brain. So.... definitely mush.
Since it's a breaking change, do you want to handle the release versioning change?
You can do the release too! Bump it to 3.0.0, and make a note of what I broke, and include the rest of the boiler plate.
That is a much more reasonable mush brain reason I think
Will do, I'll be asking questions once I get to them
Tag me so I know!
Will you be able to release it soon? If not, I can handle it.
Yes--One question though
Sure
The doc link isn't working--the correct one is https://docs.circuitpython.org/projects/ltr329-ltr303/en/latest/ (tracking it down was what slowed me down)
Should I do this release then update the docs with a pull request, or should I pull request then do a release?
Docs aren't completely set up. Please do the release assuming they are, and I'll get to the final piece of set up when I get to it. Totally on me.
Oh wait
You're saying the docs are wrong?
the main link in the README?
The link in the readme is pointing to a dead link
Ooh, yes please do this release with the correct link, and then submit a PR if you're up for it
I am confused by this--do I need to make a pull request fixing the link before I make a release, or should I make a pull request fixing the link after I do a release?
...Wait, I think I follow--In the release fix the link to the docs that the release itself mentions, then make a pull request fixing the link the readme mentions--is that correct?
Yes.
(you can also hear the cogs thonking into place as my mind tries to finish a thought)
I need this release for a guide, so we'll simply do another one when your fix is in.
you don't need a release for doc fixes too so it's not as big a deal
That too.
Oh I did not know that, that's wonderful
@idle owl Am I correct in noting that the only end user breaking change is that ltr303.int_persistance is now ltr303.int_persistence
That is it!
Ok because this is only the second release I've done, is this correct:
Fixed spelling errors and increased specificity for some variables and property names. Additionally flipped the polarity in the `ltr303_advanced_test` to `True` to work with attaching an LED to the int pin to see when it is triggered. Thanks @kattni!
Variables changed:
- `ltr303.int_persistance` is now `ltr303.int_persistence`
To use in CircuitPython, simply install the [Adafruit CircuitPython Bundle](https://circuitpython.org/libraries).
To use in CPython, `pip3 install adafruit-circuitpython-ltr329-ltr303`.
Read the [docs](https://docs.circuitpython.org/projects/ltr329-ltr303/en/latest/) for info on how to use it.
I think I have all of the rest of the changes correct and @idle owl I forgot to ping on the above
Looks right!!
Congrats on your second release!
It's published! I'll draft a pr fixing the readme shortly. Let me know if I need to fix/improve something so you can get the learn guide ready to go!
I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.
@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp...
Will do! Thank you so much! Tag the circuitpythonlibrarians for review on the PR, but you can also post it here and tag me and I'll take a look.
Ok, what originally was going to be a one line change has become a lot more lines across the documentation than I expected. I'm going to come back to this midday tomorrow unless someone wants to take it from me. There's enough points where the ltr303 needs to be added that I want to be more thorough than I can be before I need to head offline for the evening
Take as long as you need!
Thanks--would a web crawler testing for valid links be useful? I don't know how often this issue comes up and am torn by the programmers urge to automate pointless tasks
This is a new product/repo, so better to catch all of this sooner rather than later. Point is, not many are likely to be using it yet.
Awesome! I'll go through it all tomorrow to the best of my abilities, it's good to know I can at least step away for the evening
Hmm. I mean, it couldn't hurt, but I feel like it doesn't come up that often. This is an unusually named repo. Chances are in this case, she wrote the lib for the 329 first, and then decided to include the 303 afterwards, and did not update the cookiecuttered stuff when she did.
ok that's good to know--I'll resist the urge until after I get the pull request finished
Thanks, and I'm stepping away for the evening so have a good rest of the day and get some much needed/earned rest!
Have a good one!
I found this spi display driver for raspberry pi that uses several interesting optimization techniques to achieve fast rendering over spi: https://github.com/juj/fbcp-ili9341
perhaps some of those could be stolen for displayio
Here's another to unfix something I fixed. https://github.com/adafruit/Adafruit_CircuitPython_LTR329_LTR303/pull/5
@deshipu found an interesting SPI display driver for RPi:
I found this spi display driver for raspberry pi that uses several interesting optimization techniques to achieve fast rendering over spi: https://github.com/juj/fbcp-ili9341
perhaps some of those could be stolen for displayio
@stuck elbow -- Thanks! I made an issue to track this.
Hi! Thanks for your report. This method is actually unimplemented on the Pico W at this time. However, the reason you did not get a NotImplemented error appears to be a simple usage error.
I'll explain the usage error but changing your code will only get you the NotImplemented error, it won't fix the problem.
def set_ipv4_address(
self,
*,
ipv4: ipaddress.IPv4Address,
netmask: ipaddress.IPv4Address,
gateway: ipaddress.IPv4Address,...
Hi,
Thank you for the response. Is there a timeline for when this function
might be implented on the Pico W?
Kind regards,
Tal
On Thu, 20 Oct 2022, 12:34 Jeff Epler, @.***> wrote:
Hi! Thanks for your report. This method is actually unimplemented on the
Pico W at this time. However, the reason you did not get a NotImplemented
error appears to be a simple usage error.I'll explain the usage error but changing your code will only get you the
NotImplemented error, it won't f...
I tested this with static configuration on my own (dhcp-managed) network:
wifi.radio.set_ipv4_address(
ipv4=ip_address("10.0.4.33"),
netmask=ip_address("255.0.0.0"),
gateway=ip_address("10.0.2.76"),
ipv4_dns=ip_address("10.0.2.76"),
)
#wifi.radio.start_dhcp()
print("before connect", wifi.radio.ipv4_address, wifi.radio.ipv4_subnet, wifi.radio.ipv4_gateway, wifi.radio.ipv4_dns)
ssid = os.getenv('WIFI_SSID')
print("Connecting to", ssi...
You might wonder how this fixes a problem with PulseIn, when the changes aren't to any of those files! PulseIn is implemented in terms of StateMachine, which had some assumptions about the relation between the index of a pin object in mcu_pin_global_dict_table and its "pin number". This was true, until some pins were removed from the microcontroller module on Pico W.
Closes: #7078
:+1: can merge after builds
Had a USB quick-disconnect issue on linux with the macropad, it erased all my data...
good thing I had a backup - a snapshot that wasn't irrecoverably far back.
I had another look at the time I had to write a memory driver, I had a factory default memory erase method.
Is it possible that the issue occurred because the default action for a != STATUS_OK memory initialisation
is to return to defaults? (instead of leaving the SPI Flash like it is or attempting journalling repairs? parity could also be useful)
Has this happened to anyone else on any other boards recently? Still on CP7
I should make it a bit clearer, it's normally very good at keeping data intact, it's only linux and only on rapid connect and disconnect from USB
Yea, its infrequent, but happens.
CIRCUITPY is erased and reformatted when an attempt to mount the filesystem on power-up fails. This would not be just because of corruption of a single file or some directory entries, but because the metadata is so completely scrambled that there appears to be no filesystem there (e.g., as might be seen the first time CircuitPython was put on the device.).
a quick power cycle might do this either because a write being done due to mounting was interrupted, perhaps after an erase but before the write, or because there is a low-power condition that causes the SPI flash chip to have too-low voltage for a period. We had this problem more frequently with SAMD51 for a while, and had to modify the bootloader to add brownout detection very early.
Re erase before write: a "page" of flash erased to all 1's an then written. This is how this kind of flash works. So there is a period of time when there is a whole chunk of all 1's. If the write is interrupted there will be lot of bad data on that page. Pages vary in size but 256 bytes is typical
# CircuitPython
import alarm
import coproc
if alarm.wake_alarm is None:
with open("sleep.bin", "rb") as f:
program = coproc.Coproc(buffer=f.read())
alarm.exit_and_deep_sleep_until_alarms(alarm.coproc.CoprocAlarm(program))
else:
print(alarm.wake_alarm)
// ULP RISC-V
#include
#include
#include
#include "ulp_riscv/ulp_riscv.h"
#include "ulp_riscv/ulp_riscv_utils.h"
#include "ulp_riscv/ulp_riscv_gpio.h"
int main (void) {
...
this is why good boys os.sync() and remount('/',True) after finishing their writes
microcontrollers are considered appliances
not conputers
so your average user unplugs it without concern
and its as it should be
It's implemented now, if you grab the very latest builds or wait for the next beta release. If you do please let us know if it worked for you, either here or (it it's not working for you) in a fresh issue
trying to think of a solution which doesn't involve having 2 methods of storage without the same quirks...besides adding a spinning disk mini floppy drive to the macropad...
maybe some flash chips come premade in the same package with double memory that takes care of that redundancy for you so circuitpython doesn't have to worry about it?
so long as that also doesn't have the same problem and it recovers a bit like RAID1, it will be good to use on keyboards etc...RAID1 on a keyboard? ¯\_(ツ)_/¯
if you can come up with a scenario that causes it to happen relatively often, we can consider it a bug. It's not inherent necessarily, but power glitches can be an issue. we might want to add more power-checking logic at various places
Use boot.py to disable mass storage or (is this possible?) set it read-only to the host computer. If no flash writes occur, then no corruption can occur.
of course then your keyboard needs a way to enter safe mode, where it would be writable by the host computer, to fix or update the software
normally the host would not write to CIRCUITPY when mounting. But some utility programs might cause this to happen. What OS is this on?
what is the exact scenario where this occurred? Did you unplug/replug very quickly, etc.?
I haven't just come up with it in this case, it actually happens. Raspberry Pi Keyboard with the USB Hub on the back (or similar), swapping out the USB cable between devices within 3s of device boot
or in another scenario using a KVM Switch that doesn't maintain power to the USB Hub with the macropad attached (it's a bit much to say don't use it with a hub as using it with a hub should be ok)
Linux - Raspberry Pi OS Debian Bullseye, hasn't happened as much on Windows as it has on Linux but not ruling it out as it probably has happened on Windows as well in low power conditions
though on Windows I've noticed it will go back to the UF2 loader sometimes if this happens, then when it goes back to CircuitPy it's all integral. On Linux the same thing causes the data loss.
Some versions of CircuitPython have also had bugs that caused boot_out.txt to always be rewritten at every boot-up
which version of CP7 are you running?
@tulip sleet Linux DOES write to a FAT filesystem when mounting/unmounting it. tud_msc_write10_cb(lun=0 lba=1 offset=0 bufsize=512)
the one that was loaded doesn't write to flash, the one before that which was unloaded was the rtc test. boot_out.txt was there but it seemed fine.
It reverted to "hello world" code.py on this event and true different OS's write hidden spotlight files to USB flash drives to aid search indexing
I loaded 7.0.0-rc1 afterwards, this is probably not what I had running on it beforehand, I think it was 8.0.0-alpha, then I went backwards to fix it
oy, i did not know that, well, that could easily cause an issue
maybe it is clearing the dirty bit
It appears that Linux is setting the FAT 'dirty' state at mount and clearing it when unmounting. This lets it warn that the filesystem was not unmounted cleanly.
an auspicious line number.
i wonder if we should suppress writes to the dirty bit. It has never been useful, really. It's either just scolding or the filesystem is trashed anywya
wishing that Linux or any other operating system did something different is probably fruitless
right, but we could circumvent it
I mean, we would notice writes to that block, and see if the only change was the dirty bit. If so, discard the write
yes I was thinking along those lines
I don't know if a 'no change' write is already suppressed at a lower level ; if it is then if(lba == 1 && offset == 0) { clear that specific bit } in msc write could do it
there is code to compare and detect no-change writes on various ports, not sure it is on all ports
Windows: writes __pycache__ if a cpython310 is run from the macropad
Mac: writes .Spotlight-V100 and VolumeConfiguration.plist for search indexing
Linux: writes .fseventsd (hidden) and a uuid for later quick reference
All 3 seem to be fine, the data loss event is something other than this
and seeing as this happens in a low-power scenario, it probably is setting a colliding disk check flag. Windows was aware of it quite a long time in advance
"linux: writes .fseventsd" must specific to some linux distributions and/or desktop environments because my system doesn't do anything like that
might also be Apple in that case, so then what linux is doing for search indexing like Mac and Windows maybe isn't working?
but I reject most software written after 1998, I don't dispute that something popular like gnome does that 🙂
"Linux" doesn't monolithically do any one thing for filesystem indexing, it depends on the distribution & desktop environment.
so in this case Raspberry Pi OS
when we create CIRCUITPY, we create some macos-specific files to prevent macos from creating junk in the filesystem
it is not due to Linux
circuitpython itself does that
I think either setting your computer to not mount CIRCUITPY, or setting CircuitPython so that it does not appear as mass storage, or setting CircuitPython so that it does not offer writable mass storage is what I would do as a practical thing on these devices that you just want to use as devices, not as development platforms.
and making sure you have a version not affected by the "writes boot_out.txt everytime" bug
we create these when CIRCUITPY is first created:
// inhibit file indexing on MacOS
res = f_mkdir(&vfs_fat->fatfs, "/.fseventsd");
if (res != FR_OK) {
return false;
}
make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index");
make_empty_file(&vfs_fat->fatfs, "/.Trashes");
make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log");
// make a sample code.py file
make_sample_code_file(&vfs_fat->fatfs);
that's been there and has been fine, the thing causing the data loss isn't one of these ones
Windows has even logged to it after doing a disk check...wait, are you considering making one partition readable and one partition read-only redundant?
@tulip sleet maybe we should add a writable=True parameter to storage.enable_usb_drive() ? Otherwise, I don't see how to make CIRCUITPY writable by neither CircuitPython nor the host computer.
by neither? Turn off MSC and remount as readonly?
well, for some reason I was thinking "could be mounted readonly by the computer" was a goal but I'm not sure why that'd be. Well, maybe you want to keep something like an encrypted SSH key in your keyboard's read only storage, that'd be cool
So, yes, I think it's missing to be able to have CIRCUITPY mountable by the computer, but not writable from Python code and not writable from the computer.
@ember iris Thank you for the review! I replied 🙂
for CIRCUITPY being able to save to it from a text editor and run automatically is fine, it's implicit that you will need to back it up yourself in 2 other locations
just so long as there is also a partition which isn't CIRCUITPY that maintains the data when the memory (or a page) is being set to 1's for that brief moment during boot
Thanks for the clarification and I'll merge it unless you've already clicked merge (to avoid double merging issues)
Na, it updates quickly. So if you refresh it, and it's not merged, you're likely good to go. And even if it looks like it merged twice, it doesn't break anything.
@idle owl @ember iris pretty sure github protects against double-merging, but you two should coordinate and press the button at as close to the same time as possible and find out
Racing the race conditions---I like it
we would not have two partitions like that, it's more a q about protecting from unnecessary writes.
if the device presents as read-only on mount, then Linux is not going to try to write the dirty bit, I assume
@warm stump OK, as long as you're aware of some possible workarounds for this problem that is vexing you. It's OK if you discount them as not applicable in your situation, but thanks for hearing what I had to say.
@ember iris Cheers! I think that's the last piece I need to complete the guide, as long as the Arduino code works, heh. Appreciate the help!
@ember iris Actually (sorry for double-ping), can you do a release? The examples all end up bundled as well so we should do one. It's super minor to 3.0.1 (at least I think we're currently at 3.0.0) will work.
Yup I got it!
It's probably extremely difficult to make the device bulletproof against power loss during a flash write, and there's no journalling / flash-friendly filesystem (that would be recover from having the in-progress block erased or partially written) that is ALSO widely mountable by host computers, so I'm not confident there's a 100% bulletproof change that doesn't give up important functionality.
That's ok, not a problem for me as I had my backup. Just trying to prevent it in case it happens to someone else, it's an event that occurs more often than not in the space of a few months that gets missed in testing. @tulip sleet I'll have a look at what Raspberry Pi OS is doing on a separate device, I think you're right, it probably is that it isn't trying to disk check in the same way as Windows is.
we would have loved to use something other than MSC FAT. MTP (Media Transfer Protocol) used by MP3 players from way backwould have been great, but Apple refused to support it for marketing reasons -- competed with iPods.
MTP is higher level and we could have used a more robust filesystem underneath
mark my words: web workflow over usb networking will be the new wave
someone should get cracking
already got non-standard time protocol on it, otherwise -_(\ (facepalm)
time protocol?
yep, time protocol: https://github.com/TheMindVirus/macropad/tree/archive/sketches/CableTimeProtocol
loosely based on what the time module and rtc provide (though less the rtc because that caused unrelated issues with boot on the device)
[although only related by the fact that FAT liked to timestamp, but there was a gap in between where the device was performing at peak condition]
And released
Perfect, thank you so much!
@ember iris Oh hey. You merged my fourth and final PR needed for Hacktoberfest. Thanks! 😄
That's cause for a celebration of sorts! Quick, turn the lights on and off. The LTR303 can measure if you're partying hard enough!
😂 Well played.
@tulip sleet Ok, so now I can finally remember which leg is which on an LED. But I still can't remember what a good sized resistor is for including in the wiring. I have one wired up here with a resistor, but I didn't get it out of the bag this time, I had it from before, and don't know what it is. This is for a Fritzing diagram so it doesn't need to match what I have in front of me, only need to be a reasonable resistance.
What's a good resistance to choose?
220-1k, depends on the current rating. 1k is safe, but it migh be dim
for testing, sure, don't worry
Ok. This is purely for testing, you wouldn't put this in a project as-is.
I guess I am starting to remember what resistor to use.
like, just test it with the 3.3v pin by hand, and if it works
It works, and the LED hasn't burned out or whatever they do, and it's not too dim. If that's what I chose physically anyway.
(I don't know what's sitting in front of me.)
I'll use 470 for the diagram and call it good.
Thanks!
this one calculates the missing value given the other values: https://ohmslawcalculator.com/led-resistor-calculator
Also bookmarked.
If you've never done it, (and have the resources) it's absolutely worth while to blow some LEDs up. It's really helpful to get a sense of how sensitive (or resilient) different components are. Run an LED at 3.3v with no resistor, 5v with no resistor, then if it's still alive grab a 9v batter and kill the LED with it. I found approaches like that let me sacrifice one component and gave me a better understanding of what limits I can push something to. An LED can do 5v with no resistor for a short period of time, but can't do that with a 9v, but that also means if you mess something up and put an LED on 5v with no resistor you have a moment to catch yourself without a high chance of harm
Hmm. I have the resources for sure, I have a whole pile of bags of LEDs. Never thought to kill one on purpose. I actually asked whether I could attach this LED to 3V long enough to make sure it worked without a resistor (because lazy), and Carter told me not to, hehe. Basically implied that there were no guarantees, so adding the resistor was better. So I did. 🙂
the driving circuitry may also limit the current. an Arduino pin can put out about 40mA, if I remember. Our typical boards are more like 7-12mA per pin.
That's absolutely true, it also strains the device providing source current because the LED with no resistor will try and draw out all of the current a device is willing to output.
But I found that I learned circuit design best (And I am not good at circuit design) after I had an understanding of how far I could push each component. LEDs are a great and low cost place to start getting an intuitive sense of how sensitive some parts are
Nice. Thanks for the advice!
I have (knock on wood) seriously never smoked anything. So I have no concept of what can take what.
I've never purposefully fried a micro, but I've tried to fry different kinds of capacitors, LEDs, etc. It's helped me debug when I get a bad part or when I was frying something else in a bad circuit I designed (I misunderstood how a transistor worked and it was drawing more current than I thought, and because of that I was thermally shutting down a linear power regulator). It kind of helped me learn a sense of, "Something is going wrong, but it's only going wrong a little amount, so I shouldn't have to bother checking these parts just yet. I should check these ones instead first"
it's a really obscure one, it is repeatable but it occurs when a usb hub keyboard's power source is disconnected during drive mount. It seems obvious that it occurs to other devices.
the strange thing about it is no actual data loss occurs, it only looks like it does because the drive reports with default contents when in fact it still has the data which is different...
...but if this new state gets written to the drive then yes it will cause data loss. Why is it returning a default contents folder instead of stopping the mounting process onConnectionInterrupted()...?
a brown-out detector will not pick it up as the power line is still fine, the data lines are what is potentially error prone at that point.
If you don't write to code.py when this happens, unplug the board and plug it back in then on occasion your data will still be there because it didn't do an actual write
(but this varies every time, don't rely on that). It did also send the board into an unknown state at which case it did bring up the RP2 drive like it should. Very stable apart from this one USB event.
another folder to add to the list but only on Linux: System Volume Information but it disappeared on Windows (but belongs to Windows)
linux logs it to /var/tmp on the host drive only, it doesn't write to the disk for the purposes of search indexing unless there is a third-party package (which there isn't on this pi)
so the issue occurs not because something is wrong but because "everything is fine" when it maybe isn't on an undetected USB connection error. WiFi probably has more handling for this
I've smoked a triac, two of them actually. Very loud bang, I definitely hit the ground as the mini fireworks display went off.
Well, loud by the standards of "not expecting it".
Unfortunately it was the END of my debugging session because I knew what was gonna cause the problem I was looking for from that point forward.
Oof, after a lot of debugging, if something just dies on me like that I have to walk away. If I keep at it (speaking from experience) I'll just break more and more things
It's really a pain when the voice in my head is, "Just a little more and I can be done with this project entirely". But walking away and coming back with a fresh mind is so worth it
I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.
@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp...
Automated website update for release 8.0.0-beta.3 by Blinka.
Includes improvements to Pico W support and a fix for non-working ESP32 builds
https://blog.adafruit.com/2022/10/20/circuitpython-8-0-0-beta-3-released/
@tulip sleet Which leg on the LED is the anode? + or - ...
Thank you! I had it right. For once.
Thanks Dan!
Someone here said a mnemonic I still remember: you can chop off part of the longer leg to make a plus sign on that leg, so that one is positive
I only ever remember the other way around because I originally learned the terms in the context of battery cells, so... I don't use the terms
Dan. Or at least he worded it that it's longer, and it takes more lines to draw a + symbol.
So I might have told you that, but Dan is where it came from.
yeah but that doesn't give you the name, and my way of remembering the name gives the opposite name because batteries
(so I don't say it so it doesn't pollute your mind 😉 )
yeah the names are redundant, direction is the important thing
wikipedia has the mnemonic "CCD for Cathode Current Departs", which, OK, until you think about the fact that all circuits are really backwards of the way the electrons (or holes) flow
and don't get started on Zeners
heh since I use this analogy, I just thought of one: fau-Cet: C is the output for cathode 😉
I intended to roll back the toolchain for ESP32-C3 today for 8.0.0-beta.3. However, when I tested the latest main against this rollback, it did not work on QT Py ESP32-C3 (my main C3 testing board). So I did not include it and released beta.3 with C3 boards still not working.
I was confused because I thought I had demonstrated to myself that the toolchain rollback worked, and yet I could not reproduce. I then did a bisect again, with the toolchain rollback in all my builds, and found that ...
right, I never found the names that useful. I always think of the schematic symbol, which tells me what I need to know.
This is ridiculously confusing. I went back to the tip of main and now C3 is working again.
Fixes #7060: ESP32-C3 boards boot-looping.
We still need to explore the root problem of why the newer toolchain does not work. I will open another issue for that.
- Pin the toolchain used for riscv (ESP32-C3) compiles to esp-2021r2-patch3-8.4.0.
- Enable
dualbankfor ESP32-C3 boards except for 2MB flash boards.
Kattni I put together my sequencer board with 16 3v LEDs in the step switches. I learned it really depends on the forward voltage rating of the led. If you have that spec you can easily figure out a safe resistor value to use. The step switch LED’s have a 20ma forward voltage, common for 3v led. At first I used a 68 ohm and it was so bright I had legitimate concerns of it burning out. 500ohm is actually still on the bright end. Didn’t start getting too dim to see until about 3000 ohm. Anywhere around 500 to 1K is a nice safe distance away from 0 ohm while still being bright enough to be useful during the day. You can higher to 1K-2K if you only intend to use it in the dark.
Very interesting addition. I'm trying to decide whether this would be a useful addition for RP2040 or not:
In the ESP32 case it's very neat because there is no other way to bring in native code with a different architecture for the coprocessor, at least without a custom CircuitPython build.
For the RP2040 though, it should already be possible to have native code run on the second core using native modules (.mpy); these are ...
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.2 on 2022-10-14; ESP32-S3-Box-2.5 with ESP32S3
Code/REPL
Contents .env file:
`# To auto-connect to Wi-Fi
CIRCUITPY_WIFI_SSID=YOUR_SSID
CIRCUITPY_WIFI_PASSWORD=YOUR_PASSWORD
# Following are variables used by code.py`
To not publish my router's WiFi login details I show the contents here with 'YOUR SSID' and 'YOUR_PASSWORD' placeholders instead.
Behavior
Immediately after copying the ...
This PR includes:
- https://github.com/adafruit/circuitpython/commit/2285dd1838fba467f800ad6c114569fb07101909 Update espressif risc-v build configuration:
- Use optimization level O2 for now.
- Explicitly state risc-v arch: Fixes #7060.
- https://github.com/adafruit/circuitpython/commit/0d281edc08009fbcc0dc45afa77c6d9a58d70b36 Re-organize espressif
mpconfigport.mk.
@tulip sleet I think toolchain version changes get "baked in" to the environment when you . esp-idf/export.sh, because it calls out adding specific versioned gcc directories to the PATH. This would be one way to get confusing results when trying to switch toolchain versions, if you don't get a fresh shell and re-export each time.
Added the following directories to PATH: ... /home/jepler/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch5-8.4.0/riscv32-esp-elf/bin ...
The Espressif ESP32-S3-Box (Adafruit #5290) (version 2.5, this is) has a touchscreen.

However, as far as my experience goes, CicruitPython V8.0.0-beta.2, does not offer support for the touchscreen of the esp32-s3-box.
I would like the Adafruit CircuitPython team to add touchscreen support for this boar...
Hold it!... I got a fix for #7060.
I think I have a similar issue with a boot-loop on an esp32-s3. See issue #7093
I did get a fresh shell, and was careful to re-export and even double-checked the path. MicroDev has a different fix he PR'd overnight.
Did you find this necessary to prevent boot-loops? If we went to -Os would it stop working?
Also looks like you find this necessary. Do you have any idea why we have to roll back the arch? I did some searching on this in the esp-idf issues and couldn't find anything.
Looks like you came to similar conclusions in a different way. The arch difference is the most mysterious. Happy to approve after I hear your feedback.
The optimization level doesn't affect boot-loops. We have ~30K headroom, so I switched to O2 for now.
The arch is not rolled back here. The ESP32-C3, C2, H2 and even the ULP Coproc on S2/S3 are based on rv32imc.
I missed your initial debug comment where you pointed out that the CP8-beta.2 build was rv32gc.
As @jepler pointed out in https://github.com/adafruit/circuitpython/issues/7060#issuecomment-1281641332, rv32gc supports floating point arithmetic and rv32imc has to emulate it in software, with rv32gc this led to Illegal Instruction exception.
In patch3, gcc was configured "--with-arch=rv32imc", so the default when invoking it without an explicit -march= setting was rv32imc. In patch 5, it was configured "--with-arch=rv32gc", which causes gcc to emit some instructions (which ones?) not present in rv32imc.
jepler@bert:~/.espressif/tools$ ./riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -v 2>&1 | grep -o -e '--with-arch=[^ ]*'
--with-arch=rv32imc
jepler@bert:~/.espressif/tools$ ./riscv32-es...
esp-idf always set the
-march=rv32imcflag for stuff built with cmake, but we never set it before.
Aha, that's the key point I was looking for. I didn't see this.
esp-idf seems to set these flags always, maybe we should copy them:
+set(CMAKE_C_FLAGS "-Os -march=rv32imc -mdiv -fdata-sections -ffunction-sections"
+ CACHE STRING "C Compiler Base Flags")
-mdiv in particular enables use of a division instruction
@MicroDev1 can you set and test these?
Scott switched to -Os because he was running out of space on these builds. I'm not sure why we arent' now. Maybe he was using a bigger CIRCUITPY.
he was running out of space on these builds.
That was because of the incorrect log level setting in sdkconfig which is fixed now.
Maybe we should evaluate other instances where low space played a role.
@analog bridge @onyx hinge next thing I think I will do is to pull in some more recent release/v4.4 commits, some of which might fix some of the remaining wifi instabilities.
I'm glad together we figured out what caused the problem! Thanks Dan, microdev!
I just upgraded CPY to V8.0.0-beta.3. Same result.

I just upgraded CPY to V8.0.0-beta.3. Same result.
Yes, there isn't anything in beta.3 that I would have expected to fix this. (Btw, could you paste text instead of screenshots? It makes it easier to copy/paste or quote.)
Here the output of a 'normal' boot running my project script "MSFS2020_GPRMC-GPGGA_rx".

I believe this is an issue with wifi connection.
Instead of .env, connect to wifi from code.py, I have the board reboot into safe mode.
Since safe mode does not disable wifi autoconnect from .env, that would cause a boot loop, but it's really a reboot caused by the wifi connection.
import wifi
from secrets import secrets
print("Connecting")
wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
socket_pool = socketpool.SocketPool(wifi.radio)
code.p...
@Neradoc I ran your example. Here is it and the REPL output:
import wifi
from secrets import secrets
print("Connecting")
wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
socket_pool = socketpool.SocketPool(wifi.radio)
REPL output:
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
Internal watchdog timer expired.
Press any key to enter the REPL. Use CTRL-D to reload.
Is there anything unusual about your wifi setup? For instance, are the ssid or password strings long? Do they contain non-alphanumeric characters? I see your latest test appears to exclude the .env file altogether (assuming you removed or renamed the file), which is good information to have.
Next I copied a part that I recently successfully used with an UM PROS3:
But it crashed also into safe mode with the 'internal watchdog' error:
import time
import wifi
import socketpool
import ipaddress
from secrets import secrets
use_ping = True
print("Connecting")
try:
wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
except ConnectionError as e:
print("WiFi connection Error: \'{}\'".format(e))
ip = wifi.radio.ipv4_address
pool = ...
@jepler No. both SSID as PASSWORD use normal characters, one dash '-' and one underscore '_'.
These I used in many CPY scripts without any problem.
@MicroDev1 can you set and test these?
The additional C_FLAGS are already present in our config apart from -mdiv which seems to be specific to ULP.
Just throwing my 2 cents in, I have tried two STEMMA-QT boards on my new Feather ESP32-S3 and both report the same issue as well (output for my BNO055 9DoF)
import board
import adafruit_bno055
i2c = board.STEMMA_I2C()
sensor = adafruit_bno055.BNO055_I2C(i2c)
0;🐍Wi-Fi: off | code.py | 8.0.0-beta.1Traceback (most recent call last):
File "code.py", line 4, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring
Occasionally, after a reset of the Feather, it ...
Tested on QT Py ESP32-C3. Thank you for figuring out the arch change issue!
Fixed by #7094. Thanks @MicroDev1!
Proposal to run Build-CI based on file changes specific to a commit instead of diff between base branch and PR branch.
This will likely reduce number of builds run on each commit. Does this approach have any pitfalls?
oh... yes, silly me. 🤦♂️
how about it runs all the failed jobs from previous run and also schedules new jobs based on diff between current commit and last commit with a ci run?
this just makes it even more complicated
I made a sweep through the implementations and came up with this list of limitations. Some are "to be implemented", but many are inherent. Documenting them will save support time.
Thanks @wtuemura and @bergdahl!
Happy to approve. I was waiting until the translation merge was done, so it won't rerun again.
This is excellent! Caught one spelling error. See below.
//| Espressif: available only on ESP32 and ESP32-S2; other chips do not have a DAC.
Fixed! Thanks for spotting that.
Which chip family do you want this on?
@jaunty juniper Thanks for the feedback. How does this look? https://learn.adafruit.com/adafruit-esp32-s3-feather/circuitpython
@tulip sleet Do you remember which issue is tracking ESP32-S3 and the LC709? I'm having trouble finding it.
Cheers.
The touch controller is I2C, and its I2C pins are attached to the standard I2C pins (GPIO8 and 18), it looks like, on the schematic. So a library for the touch controller should be usable from CircuitPython now. We have a TT21010 library: https://github.com/adafruit/Adafruit_CircuitPython_TT21100.
We wouldn't add those definitions to board, etc., they would just be in the library.
OK, Dan, thank you very much! Yes, I saw also in the definitions that I showed above that pins GPIO8 and 18 were assigned. I am going to try it.
ah for the different builds of the S3, yeah that looks fine, thanks 👍
Excellent. I added some to the Overview to call out both as well.
Thanks for taking a look!
@jepler Can you take a look at this?
I will, though it'll probably be next week.
self._sock.bind((host, port))
self._sock.listen(10)
self._sock.setblocking(False) # non-blocking socket
The nonblocking request in question is for the listening socket, as opposed to the connected socket created by accept(). This is just a note for myself.
Can confirm this is working for me as well on both Seeed Xiao ESP32C3 and Adafruit QT PY ESP32-C3. Thanks @dhalbert and @MicroDev1!
Touch is working!

Again, thank you Dan! Closing this feature request.
@PaulskPt is this issue fixed in the 8.0.0 builds?
@wemos Would you like to take a look at this?
No. I had totally forgotten that I had created this issue. Today I created anouther one (#7093) .
We'll use that one.
Closing -- superceded by #7093.
with the MP_WEAK thing, is an empty board.c ok if there's no change ?
Right, just include the boilerplate comment to make that clear.
do you mean completely empty?
I'd prefer an "empty" one like ports/atmel-samd/boards/trinket_m0/board.c' which has the copyright and license boilerplate, etc.
that's perfect
I see the QT PY pico has:
void board_init(void) {
reset_board();
}
the M5Stamp has a CH9102F and also has the JTAG/USB pins broken out, how do I handle the jtag pins in the board definition ? ignore ? can they be used as GPIO ?
It's not clear that needs to be structured that way, but I haven't had time to revisit it.
@tulip sleet I'm watching the PR I approved, and I'll merge it when it passes.
56 in progress checks left.
Queued for ages though.
same here; for some reason it was put at the back of the line even though there were some merges I thought I had done afterward
Odd.
@tulip sleet Merged!
thank you!
I will delete that draft page in the guide now. all the info is spread about elsewhere
Sounds like a good plan.
I am just starting to work on your sleep pin issue
Ooh nice
resolves #6633
Has board.NEOPIXEL, BUTTON and UART().
Pins are named Gx because it's what's on the board and IOx for compatibility with other ESP boards.
Ping to @askpatrickw
@hathach It looks like this is hitting a TU_ASSERT on nRF.
0x0006e40c in usbd_edpt_xfer (rhport=0 '\000', ep_addr=0 '\000', buffer=buffer@entry=0x0, total_bytes=total_bytes@entry=0) at ../../lib/tinyusb/src/device/usbd.c:1304
1304 TU_ASSERT(_usbd_dev.ep_status[epnum][dir].busy == 0);
(gdb) bt
#0 0x0006e40c in usbd_edpt_xfer (rhport=0 '\000', ep_addr=0 '\000', buffer=buffer@entry=0x0, total_bytes=total_bytes@entry=0) at ../../lib/tinyusb/src/device/usbd.c:1304
#1 0x00073cb4 ...
In the following example:
0x500007fc is the address of shared_mem variable.
In a CircuitPython program, how do I determine a permissible address for a shared memory variable? What happens if I specify an address that is in use for some other purpose, such as one used by the CircuitPython or ESP-IDF heaps? Is this function safe to call with 'bad' inputs -- do they lead to exceptions, or do they continue and corrupt memory in use for another purpose?
how do I determine a permissible address for a shared memory variable?
That can be grabbed from the build files ld, map or sym.
What happens if I specify an address that is in use for some other...and corrupt memory in use for another purpose?
This is direct access! We can do some sanitization like in the case ULP:
RTC_SLOW_MEM = 0x50000000
RTC_SLOW_MEM_LEN = RTC_SLOW_MEM + 8192
lower_limit = RTC_SLOW_MEM + loaded_program_len
upper_limit = RTC_SLOW_MEM_LEN
I found the issue. TinyUSB isn't checking that the CDC structures are actually setup and the read can queue a USB transfer. This transfer can happen on the wrong endpoint when the CDC structures aren't ready! So, we check connected before reading.
Check for connected before calling read. Otherwise TinyUSB may setup the read on the wrong endpoint.
Fixes #6018
CIRCUITPY_ESP_FLASH_MODE=qio
Minor change request, INTERNAL_FLASH_FILESYSTEM = 1 is already set in mpconfigport.mk.
This is an attempt to implement access point functionallity for the pi cow.
The access point itself works.
However:
- stop_ap does not work
- You can connect to an access point successfully even when the ap is still running..
(This is due to CYW43_LINK_UP)
Keeping as a draft till I get ap disconnection working
Thanks for tackling it @brazen hatch !
Implements more checks and sleep support enhancement:
- Check memory address range.
- Check firmware size at an earlier stage.
- Check coproc running status.
- Add light and pretend-to-deep sleep support.
I too cannot get my ESP32s to connect to wifi. I have two ESP32-S3s and one ESP32-S2 and all three are giving me "unknown failure" messages. I tried connecting while powering w lipo battery only. No luck. These boards were connecting to wifi a couple months ago but it was a different network. Any suggestions?
When it's gonna be released?
When it's gonna be released?
There will be firmware downloads available as soon as this merge finishes building, in https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin. Look for builds with g5a6fffc in their name, or one later than that.
I'm planning to do an 8.0.0-beta.4 early next week.
You can connect to an access point successfully even when the ap is still running.
This is normal in espressif where you can have independent control of whether STA and / or AP are up.
Oh sorry I didn't phrase it very well.
With the ap open, you can connect to a network and it will connect
But any connections will fail. cyw43 will start crying debug messages.
I just have to fix the stop_ap and call it before a connection.
OK, sorry, missed that this was in draft.
Discovered while working on #7069 -- but this bugfix can be taken separately
.. so remove it from the docs too
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Adafruit CircuitPlayground Express with samd21g18
Board ID:circuitplayground_express
UF2 Bootloader v3.14.0 SFHWRO
Model: CPlay Express
Board-ID: SAMD21G18A-CPlay-v0
Code/REPL
while True:
mic.record(samples, len(samples))
magnitude = normalized_rms(samples)
# You might want to print this to see the values.
# print(magnitude)
# Compute scaled logarithmic...
A few minutes ago I re-flashed the esp-box with tinyuf2 combined.bin (I discovered that I flashed b4 using SPI mode 'DIO' and this afternoon I discovered that the serial output of the MCU says the SPI mode is 'QIO'. I also took the chance to copy the latest CPY version dated today. Unfortunately a script to test the WiFi connection with the AP here in the room resulted in 'WDT expired'. See images below.
,boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378f28
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x15e8
load:0x403b6000,len:0xbf8
load:0x403ba000,len:0x31c8
entry 0x403b621c
I (29) boot: ESP-IDF v4.4.2-378-g9269...
One board build was stuck in a network fetch. Cancelled build run and merged.
I guess no reason to list things we don't use :)
Don't see any particular issues. Since this is experimental I'll approve so people can try it.
Thanks, @Neradoc, LGTM!
Are there any resources for coproc testing available?
I would like to begin testing it
I think MicroDev had a basic example in the PR if you look there. The ESP32-xx datasheets do have some info about the coprocessor and building for it too if I recall
Nice, thank you!
While this PR says it checks the memory address range, it's trivial to HardFauilt CircuitPython using CoprocMemory. Here, the type pointer of a list object is nuked (since the id of an object is its location in memory)
Would it be possible to simply move the address range checking from the Coproc construction to the CoprocMemory construction?
Adafruit CircuitPython 8.0.0-beta.3-10-g773bb99c96-dirty on 2022-10-22; ESP32-S3-EYE with ESP32S3
>>> import coproc
>>> l = []
>>> c = cop...
By the way, I'm planning on trying this module out soon (timeframe uncertain) to interface to an odd Atari keyboard that is a bit of a poor fit for both keypad and PIO, so I may have more questions & hopefully some more concrete & constructive feedback for you when that happens.
Oh it will be so much fun crashing my boards with coproc tomorrow!
I'm getting that with a DEBUG=1 build, it doesn't look like it gives any useful info to me, it just... stops when connecting.
>>> import wifi
D (28309) esp_netif_lwip: LwIP stack has been initialized
D (28309) esp_netif_lwip: esp-netif has been successfully initialized
D (28309) event: created task for loop 0x3fcebd90
D (28309) event: running task for loop 0x3fcebd90
D (28309) event: created event loop 0x3fcebd90
D (28319) esp_netif_objects: esp_netif_add_to_list 0x3fc...
@PaulskPt We talked about doing a similar test on your UM ESP32-S3 ProS3. Do I understand that a similar script did not fail on that board? So it seems to Box-specific?
I can't reproduce it with the Feather ESP32-S3 TFT, it seems to run all fine, wifi.radio.connect or .env.
@Neradoc thank you for your investigation.
@danh. I soldered the pin-strips to my new UM ProS3. Initial tests OK. Then I re-flashed it with tthe tinyuf2 bootloader for CPY. Loaded the really latest (from 2022-10-22) CPY V8. Wrote a similar script to connect to the same WiFi AP in the room here. It works great. I copied output of it to the dropbox folder.
I just copied also an .env file to the CIRCUITPY disk of the UM ProS3. I see that it works. After boot the statusbar shows an IP-addres...
Here REPL output in mu-editor from the WiFi test with the new UM ProS3.
Btw: it's programmed to request date & time string from AIO Time Service every 2 minutes.
WiFi test for UM ProS3
Waiting for mu-editor etc. getting ready
wifi.radio.hostname= 'UMProS3'
wifi.radio.mac_address= f4:12:fa:42:4:ec
pr_scanned_ap():
Available WiFi networks (sorted on: 'rssi')
AP nr 15 SSID: Vodafone-287778_EXT RSSI: -52 Channel: 9
AP nr 12 SSID: MEO-AFM_EXT R...
https://github.com/jepler/ulp-circuitpython huh using ELF files isn't as hard as I'd feared. maybe this can help with (A) building ULP code and (B) accessing variables within the code
but I didn't actually build or load any code yet 🤣
@analog bridge @brazen hatch of possible interest to you
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Seeeduino XIAO RP2040 with rp2040
Board ID:seeeduino_xiao_rp2040
Code/REPL
BROKEN:
#code.py
import gc
from AxDisp import *
print(gc.mem_free())
from AxInput import *
print(gc.mem_free())
last_text_top='test'
text_top(last_text_top)
import time
while True:
print(gc.mem_free())
if Ax1Check():
last_text_mid='True'
text_mid(last_text_mid)
else:
...
Please try with a recent build, after #6789.
Fixed with move to 8.x beta 3. Thanks Neradoc and Dan for your assistance in triaging this!
Submitted all my social media API examples to the adafruit_requests library. Does that count for hacktoberfest or only bug fixes?
The original file missing IO45~IO48 definitions, and IO18/A17 incorrectly points to IO17.
@midnight ember each PR should count equally
Well they're new additions, not really PR's, or did I do it wrong? Can I make a PR for a file that doesn't currently exist? Github is so confusing sometimes.
@midnight ember check your hacktoberfest profile and see what it says? https://hacktoberfest.com/profile/
it might say something like this ... "Waiting [length of time]" with a link to "view on github". If it doesn't appear there, then either hacktoberfest is out of date (it doesn't stay 100% up to date) or your activity was the wrong kind of activity to qualify.
it does need to be a pull request, that's just the rules of hacktoberfest.
so .. based on snooping at https://github.com/DJDevon3/Adafruit_CircuitPython_Requests -- in git/github parlance, you have made a fork, and you've made changes within that fork. but you haven't offered those changes back to adafruit/Adafruit_CircuitPython_Requests, which is called creating a pull request.
you've made 5 distinct commits as github calls them, but if you create a pull request with those 5 distinct commits in them, it will count as 1 pull request towards the hacktoberfest goal of 4 pull requests.
Ohhh
to create a pull request, you have to 'do things' within the github website. https://github.com/adafruit/Adafruit_CircuitPython_Requests/compare/main...DJDevon3:Adafruit_CircuitPython_Requests:main would start creating 1 pull request with all 5 of your individual changes in it.
Sorry still kinda new to working in others repos.
no need to apologize, we were all new at one time or another
and the terminology and the technology is often extremely non-obvious
Could I…. create 1 pull request for each file? 😁
there would be nothing wrong with doing it that way, and some maintainers would even request that you do so. Frequently, people view it as a good idea for each PR to address just one independent thing.
I take it you are doing things strictly by working from the github website, not running the "git" program on your computer? Let me think about how you would split your work into 5 separate PRs that way, it's not how I customarily work.
OK, again, no worries 🙂 I get to learn how to do something on the web, which I simply don't know offhand
Seems more trouble than it’s worth. I could just submit the pr and then keep tweaking my new files?
For additional prs
Is there one of the examples that you're more confident is complete and correct, vs all the others?
Because they could use some cleaning up and the copyright header confused me unsure what to put there.
Probably the YouTube api.
OK let me walk you through the steps you can do in the github website to create a PR with just the YouTube code in it ..
They all work, I checked and double checked they work.
go to your fork and click where it says "1 branch"
now poke the "new branch" button and make the settings look something like this -- the branch name can be what you want but it's important that the branch source be "adafruit/Adafruit_CircuitPython_Requests" and "main"
now you can make github look at this branch which has an independent version of all the files and folders compared to your main branch
now you'll "add file" by upload or editing, as you're familiar with
once you've done that, go back to the page for that branch and it'll say you're "1 commit ahead" and that you can "contribute" your code by creating a pull request
fill the next page out and "create pull request"
once the adafruit gnomes (they're not actually gnomes) look at it, either they'll request further changes from you or merge it.
It's prime time for taking a walk here so i'll be back later -- feel free to mention me here on discord if you get stuck or have any q's about the process
something short & descriptive, like "add-social-media-examples"
oops, lol named it branchy branch
heh - it shouldn't matter too much
you can add details in the PR itself that is probably more important anyway
i must have done something wrong. now my files are gone in my github examples folder 😦
maybe it synced?
what's the repo link?
too confusing just going to do the PR on the main commit with all of them.
only thing i can think of to save all that work too because i was live editing those files in my github/folder. when it sync'd it deleted them all.
rather not have to do all that work again.
i did not have a backup in another folder
they're in the main branch
do a git checkout main
and they should magically reappear
re-order your imports and it should be ok
i named the files with api because they require developer tokens to use, seems like a logical idea to differentiate them from some of the other web scraping examples.
ah i see the errors now thank you
ok made the changes, will it run again on its own or do i need to do something to make it run again?
FYI... I just upgraded the circuit python on my boards. they're working now. 🤗
It failed again - can you run black on your files and then commit again?
using github desktop?
thought that was built in kind of thing
or should i do it via command line first before using github desktop?
yeah, I thought it was part of pre-commit, but I'd try it via the command line, it can't hurt to format them to what pre-commit wants
gonna have to look that one up. been about a month or two since i used it and have since ripped out WSL and ubuntu
pip install black should do it, then black filename.py
i can't find the guide about doing black in adafruit's learn guide on github
maybe that one is only in the guide for making your own board
error: cannot format requests_adafruit_discord_active_online.py: Cannot parse: 1:0: // SPDX-FileCopyrightText: 2022 DJDevon3 for Adafruit Industries
oh it's using // derp
by the way, you should only write "for Adafruit Industries" if Adafruit was compensating you for your work.
Kattni needs to update this guide then. the copyright headers alone caused black and commit to fail. https://learn.adafruit.com/contribute-to-the-adafruit-learning-system-with-git-and-github/add-author-and-license-information
oh dear god i was using headers for arduino 🤦♂️
I'm sorry for that I didn't mention for using ESP32-S3 currently.
all checks passed this time 😁
already wrote my hug report for paul and jeff in the meeting notes. 🙂
Closing, given the age of this. Please reopen with an updated example if you still see this.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cfc-dirty on 2022-10-23; ESP32-S3-EYE with ESP32S3
Code/REPL
# Full code at https://github.com/jepler/ulp-circuitpython
import time
import struct
from coproc import *
from minidump import e, h, en
def storele32(cm, off, x):
print(off, ":=", x)
cm[off:off+4] = struct.pack("<l", x)
def storele16(cm, off, x):
print(off, ":=", x)
cm[off:off+2] = struct.pack(">> impo...
Closing because it does not seem feasible for now.
Closing because Windows 7 has reached end of life.
move the address range checking from the Coproc construction to the CoprocMemory construction
I'd prefer to disable direct construction of CoprocMemory from python side and move it to:
Coproc(buffer, shared_mem_address, shared_mem_length)
Also, the access to memory can be limited and allowed only in the run-to-halt interval.
Closing because this is probably fixed.
Anything that gets rid of the user constructing a CoprocMemory instance that can be used to hose the general RAM of the machine is good, as long as it doesn't remove capabilities.
Why can't it be allowed before run? For instance, in the LED blink example, you might want to pre-load the first blink interval before calling run.
By the way, I'm not sure about limiting the region to be read/written via CoprocMemory. For instance, in the LED blink example a compile-time default could be set ...
I want an extension for VS Code that screams at you when you use // instead of # in a Python file.
More critically, I need the opposite for an Arduino sketch file.
can we also petition so that "else if:" is universally highlighted as an error?
can we add elif to C, javascript and friends ?
can we petition that else if is legit in Python?
Question: in CPY V8 if in boot.py import supervisor supervisor.status_bar.console = False then, in a running CPY script, a KeyboardInterrupt by presing the key-combo 'Ctrtl+c' doesn't work is my experience. Is this behavior correct ?
that would be a bug
Jokes aside, in some circuitmstances this makes sense.
one liner else if though, does not.
thank you!
Correction: I rebooted the board (UM ProS3) while in boot.py status_bar set False. This time I was able to do force a KeyboardInterrupt. Don't know why the same script some minutes b4 did not react on my Ctrl+C while in main() while loop is a try...except block with 'Except KeyboardInterrupt'.
What encodings does CircuitPython support? PR for reference: https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer/pull/29
My inclination is to support changing the encoding, but keep ASCII as the default
UTF8
That's the only one?
yup as far as I know the argument is actually ignored
encodings take much flash I believe
Ahhh, that would make a lot of sense
In that case, I'm tempted to comment what I said before, since MC-based users would expect an unsupported encoding as the default.
b'\xef\xac\x80'
>>> "ff".encode("cp437")
b'\xef\xac\x80'
``` yeah the encoding argument is ignored, giving an incorrect result
I'm trying to implement something similar in micropython (on ESP32, or wherever); namely getting SSL working on the pure-python wiznet driver (which was backported from circuitpython). Findings so far:
- On an ESP32, the SSL library is MBedTLS running on the ESP-IDF. There are micropython and circuitpython bindings to that library, but that have diverged (though there will likely be an SSL context manager coming to micropython soon, so might re-converge at some stage)
- The
socketclas...
BPI-PicoW-S3 has no BOOT0 button, but retains the BOOT0 contact.
Update more detailed description to guide users to enter the bootloader mode.
I, from my end, restarted my investigation. For what it is worth:
The file: mpconfigboard.mk is the file most recently modified: 18 days ago. In this file the flash mode is defined as 'dio' however a serial output at boot of the esp32-s3-box states flash mode 'QIO'. See composite screenshot below:
 recently sent me updated replacement for the three models of his esp32s3 series of boards, I am able to compare the serial output at boot time with the flash definitions in the respective mpconfigboard.mk files of the latest edition of CPY V8. Here is the comparison for the board UM tinys3. As you can see: the same difference as with the esp32s3_box: dio in mpconfigboard.mk versus qio in the serial output at boot time.

I'm thinking of adding typing to some libraries to close out some open issues. What version of Python should I refer to for typing, 3.7?
@proven garnet would know for sure but I think that is right -- 3.7 is the version on Debian Buster, which is also the previous stable version of Raspbian/Raspberry Pi OS which a lot of CircuitPython libraries get used on thanks to Blinka.
Yup! 3.7 is the baseline.
Just flasthed the UM FeatherS3 with CPY V8 latest. Here is the serial output at boot time while running the first WiFi test on this board:
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x1644
load:0x403b6000,len:0xf1c
load:0x403ba000,len:0x31c8
entry 0x403b634c
I (25) boot: ESP-IDF v4.4.2-378-g9269a536ac 2nd stage bootloader
I (25) boot: compile time 11:37:31
I (25) boot: chip...
To make it complete: just flashed also the new UM TinyS3 with CPY latest:
Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf on 2022-10-23; TinyS3 with ESP32S3
Then I ran the same WiFi test. Result: successfull. Received an IP-address. Also a positive ping on 'google.com'.
Below the serial output at boot:
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x1644
load:0x403b600...
Regarding the CPY port definitions for the board 'esp32s3_box', the file: mpconfigboard.mk is the file most recently modified: 18 days ago. In this file the flash mode is defined as
diohowever a serial output at boot of the esp32-s3-box states flash (SPI) modeqio.
Those three CIRCUITPY_ESP_FLASH_* constants are only used to construct the flags to pass to esptool.py...
I'm not sure we want to do this, it trades memory for no new functionality except more exceptions.
Tests cases are changed because "ignore" and "replace" were never supported and because the utf-8 encoding should always be specified by name, rather than depending on the empty string.
(However, the empty string is accepted as a valid encoding name for compatibility with previous versions of CircuitPython)
Because Python3 checks late for the validity of an 'errors' value, this is a n...
today I'm the one having trouble measuring flash size changes, it seemed like this change saved 8 bytes which is nonsense.
Thank you. I also expected an answer like this however I wanted to mention it because it is not correct.
It took me a bit to parse paul's comment on that PR. I think he's repeating that the value does not match the hardware, but he accepts the analysis that it doesn't affect the content of the circuitpython binary.
my understanding also - I will make a sweep of those settings at some point
I can test the ESP box with the bin
I think it might not load at all. I'd expect much worse issues
and it's only if you use the Makefile target to do the loading. If you just use esptool on the command line without spec-ing the args, it should figure it out
we could probably just take away that qio/dio arg
since I think esptool can figure it out?
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf on 2022-10-23; FeatherS3 with ESP32S3
Code/REPL
# SPDX-FileCopyrightText: 2022 Paulus Schulinck
#
# SPDX-License-Identifier: MIT
##############################
"""
This CircuitPython script is created to show how I managed to
sort received WiFi Access Points in one of the following sorting orders:
1) on ssid;
2) on channel;
3) on rssi.
See function 'p...
shakes fist at status bar
How do I obtain CIRCUITPY_CREATOR_ID & CIRCUITPY_CREATION_ID for a Wifi only board (ESP32) ?
@vagrant wind By submitting a PR at https://github.com/creationid/creators
Central place to register creation id creator ids. These are used to digitally identify anything. - GitHub - creationid/creators: Central place to register creation id creator ids. These are used t...
I am the person who is acting on PRs in that repo at the moment so I'll try to help you if I can.
Thx
in the espressif.md file I would say
I'm a little unsure how it's supposed to work honestly -- It's something tannewt set up and left in my hands while on leave
If you are designing PCBs yourself, I think you want to allocate an entire "creator ID" for yourself and administer your own database of "creation IDs" following the style used in the main repo (as a public github repo)
if you're putting CircuitPython onto a board from another maker who is already listed, then you'd put it under their creator id
I think I discovered the origin of this 'behavior':
as soon as I added a file .env containing the WiFi credentials of the WiFi AP to be connected,
the unwanted CPY statusbar lines in between the REPL output of the running script disappeared. See below:
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
]0;🐍192-168.x.yyy | code.py | 8.0.0-beta.3-11-gedce717cf\
WiFi test for board: 'unexpectedmaker_feathers3'
w...
ah ! So yeah the Espressif file is for Espressif boards, not all ESP boards
I am not 100% sure but the file says at the top "Community Allocated Creation IDs for Espressif boards" https://github.com/creationid/creators/blob/main/creations/espressif.md
I am making my best guesses at what tannewt intended and if some allocations are wrong we will live with the consequences..
so on a pico I get +52 bytes in the bin
yeah you're right, it's mimicking USB VID/PID
that's more plausible for sure
with more flexibility, so you can create a creator ID as a community managed list for a vendor who doesn't care (or know) about the thing
if I ran the world there would be a UUID instead, since those need no central allocation, but /shrug
it's nice to have a sort of database, even though it can only be looked up by hand
I have just created my first pull request on creation/creators repository
Hopefully I haven't done anything wrong 🤞
I have a second question. This is the board that I'm going to add to CircuitPython: https://docs.m5stack.com/en/core/fire
The reference docs for M5Stack products. Quick start, get the detailed information or instructions such as IDE,UIFLOW,Arduino. The tutorials for M5Burner, Firmware, Burning, programming. ESP32,M5StickC,StickV, StickT,M5ATOM.
It has a power management IC (IP5306) that can control the battery charge and it talks with the MCU via I2C
Do you suggest to add this library as a frozen module inside the firmware, because is an IC already on the board, or to leave the user free to pick up library from the CircuitPython Bundle?
we usually don't freeze libraries like that, because it makes it harder to update
(in particular frozen libraries take priority over libs in /lib, so an update has to be put in the drive root)
but it's totally possible
libraries get usually frozen on boards where flash or RAM are limited
Thank you for the explanation
I'm getting the same problem on an QT PY ESP32-S2, after upgrading from CircuitPython 7.3.3 to 8.0.0-beta.3.
My program subscribes to a topic on Adafruit IO. It's been very reliable in CircuitPython 7 but is unusable in 8.
I tried hard coding a 1 second timeout in the _wait_for_msg() method, and it fixed the MMQTTException during subscribing. However, the loop() method then fails with:
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 864, in loop
File "/lib/adafruit_min...
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.3 on 2022-10-20; Raspberry Pi Pico W with rp2040
Code/REPL
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
print("test")
led.value = not led.value
time.sleep(1)
Behavior
Board is not always detected as disk in windows 10.
Description
- Boot works always fine, and circuit pyt...
<@&356864093652516868> In just under one hour we'll get together for the weekly status meeting! Feel free to add your status updates and hug reports here: https://docs.google.com/document/d/1YtDimxJ-FXu-88WqLRq-TFmE1q-xTAp-OIEiUpwkFGw/edit?usp=sharing
thanks Paul - I am hosting today but forgot the reminder
sorry to steal your thunder. 🙂
not at all
No notes contribution today, I am too lazy and did too little, here is what I remember:
- I tested beta3 on a few devices especially picow (hug to Dan and Jepler)
- Did some FlipClock test and PR (hug to foamyguy, tekktrik, maybe other)
- acquired: 2 trinket M0, 2 QT Py RP2040 and 2 Xiao RP2040 for future AT(maker) use, USB host trick.
I pasted into status in the notes
Ok, thanks, but that is more reading for you. 🙂
i can handle it 🙂
https://hackaday.io/project/187169-esp32-s3-boy ah the real esp32-s3-boy does have a few more buttons than that.
Join Leon (lemon) Sandoy, an owner of Python Discord, and Pablo Galindo, the 3.11 Python Release Manager and CPython Core Developer, as Python 3.11.0 is released live on stream.
Pablo will be walking through the release process and guests will be joining to talk about the exciting new features to be found in 3.11. At the end of the release we...
Now that we’re halfway through the fourth quarter, it’s probably about time for us to post our third quarter language rankings. We’ve been tied up behind the scenes at RedMonk between projects, our first event in three years and more and haven’t had the time to drop these yet, but the data’s been sitting and
I knew about it ahead of time. No idea how I knew. Didn't realise it wasn't generally known. I would have mentioned it.
Almost any accepted pull request in CircuitPython repos will count towards your hacktoberfest goal
I think "supported board" counts Linux boards, the number of Micropython boards is not included. so it's quite a bit more than 100 by another measure.
I think that plugin is https://marketplace.visualstudio.com/items?itemName=AykutSarac.jsoncrack-vscode -- looks neat
Thank you
Awesome!
The alligator eyes are awesome
thank you, i did the graphics for them too 🙂
Oh, now I can match your discord nickname to your Show&Tell appearance!!!
lady ada and phil just call me DJ but yeah same person 😉
the physical industrial controller for factorio is really cool looking.
@lone axle was the industrial controller on one of your streams or what?
I just wanna see what this looks like
Yes, I streamed a bit yesterday working on it. I'll get a photo.
🐮 🔔 ....we always need more of it.
This is the controller:
this weeks bootloader was informative as always, enjoyed the different topics
kinda want but what would I do with it
thanks! glad you liked it
PARENTS: please carefully inspect your kids’ Halloween candy! We found Doom running inside this Milky Way bar.
Visit the Adafruit shop online - http://www.adafruit.com
LIVE CHAT IS HERE! http://adafru.it/discord
Adafruit on Instagram: https://www.instagram.com/adafruit
Subscribe to Adafruit on YouTub...
ok which house is handing those out, because i want one.
At least to help me understand the English from time to time, I love the notes.
here's what it might look like but I'm with kattni on the utility
Yeah fair enough.
it may be a haunted meeting though
Thank you.
We will definitely still have them, but we're opting not to include them in the meeting video.
I think I would have trouble keeping it scrolled to the right spot as the meeting goes on. And I am definitely one of those habitual "point click and highlight" type people, I imagine it could get distracting.
Any plan to share the UF2 or a guide?
Thanks!
👋
bzzzzzzzzzzz
@thorny jay no guide. source code and binary on github: https://github.com/adafruit/esp32-s3-boy_fw
😂
I don't hear anything, so the noise gate is great
Discord's built in noise suppression is pretty on point
Wish me luck, I will measure "main" with a potentiometer...
I don't use Discord's because I kept being concerned it will block me too. But good to nkow.
I'm surprised there's not a "don't show other people in document" preference in github docs
er google docs
👋
thanks Dan and everyone 🙂
Thanks y'all!
@tulip sleet @onyx hinge What is this? All the normal pull and make fetch-submodules does not make it go away. Untracked files: (use "git add <file>..." to include in what will be committed) ports/espressif/certificates/
that's because I moved/renamed espressif/certificates so it could be shared with pico w
we moved this submodule from here to somewhere else. So you can just delete ti
it should be safe to remove the whole certificates folder with your file manager
@tulip sleet @onyx hinge Ok, so, I'm looking at another board. Is this the only thing needed in pins.c? { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, or do I also need to add something like this to mpconfigboard.h? #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)
@idle owl Is this an alternate i2c port, or an alternate name for the same i2c port?
I don't quite understand the question.
Is this about having 2 names for one thing (like LED and D13 on many boards)?
Ok, so on the Pico, there's no defined I2C anything. Because it wasn't on the silk, so we didn't add it. Now Limor wants STEMMA_I2C() added to the Pico for the PiCowbells STEMMA QT connectors.
So, it's only one name for 2 pins.
ok, I think I glossed over the discussion
so yes you will need to add DEFAULT_I2C_BUS_SDA and SCL
Ok, keen. Got it.
as well as the other thing
Adding initial Grumpy Sloth - Slim Sloth configuration
I found that on the esp32-s3-eye, coproc.halt() frequently caused the main CPU to crash or CircuitPython to otherwise
become unresponsive. After experimentation, I arrived at this alternate reset/halt sequence.
I didn't do any testing on S2.
This has survived dozen of iterations of
import time
import struct
from coproc import *
from coproc_manager import Program
print("waiting 15s")
time.sleep(15)
while True:
program = Program("/a.out-stripped")
shared_mem = program.get_symbol('shared_mem').entry.st_value
print(f"{shared_mem=}")
cm = CoprocMemory(0x50000000, 8176)
c = Coproc(program.code)
print(f"{shared_mem=}")
try:
run(c)
for _ in range(2):
...
do we have (or want to have) a policy on using DEFAULT_I2C_BUS_SCL versus moving to ?
#define CIRCUITPY_BOARD_I2C (1)
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO25, .sda = &pin_GPIO24}}
@onyx hinge So I gave my PiCow to Brian a while back, and have no idea where it is. The two I ordered Friday aren't here yet. If I make a build, can you test to make sure you can connect an I2C breakout to these two pins and use board.STEMMA_I2C() in code to get to it? Means breadboarding the PiCow, I don't know if you've already done that.
I had no idea there was another way to do that. What's the difference? Are there benefits to one over the other? What file does that get added to?
the second way has been added to allow more than one default port
Ohhhh. Right ok.
they are totally equivalent otherwise
That was obvious. 🤦🏻♀️
(the old style is now defined as in terms of the new one)
I think on Pico, it might be worth using that one, since there are so many options, and some thing in the future might specify something other than what the PiCowbell uses.
What is the (1)? Which I2C port its defining? Why wouldn't you start with (0)?
the number of ports
Ohhhh
So that changes if you add another one.
Ok
I assumed that line was needed for each one.
CIRCUITPY_BOARD_I2C_PIN is a list of ports
I guess I can pose this to whomever: Does anyone have a Pico W with header pins on it? Would you be willing to test a CP build for me? It involves hooking up an I2C breakout (STEMMA QT or otherwise), and verifying that a particular piece of code works. I need to write the code first, and maybe test it on Pico to make sure it works there. But then after that, is anyone able to test?
@jaunty juniper I included this in both mpconfigboard.h files#define CIRCUITPY_BOARD_I2C (1) #define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}
which color goes to which pin?
blue to 4 and yellow to 5?
Blue 4, yellow 5 yes.
Uff, yeah
it'll take me minutes and minutes at this rate, be patient with me
No worries. I'm only now setting up to test Pico.
This Pico is doing nothing.
Uff.
Not fighting with this right now. Where's another one.
first things first, this did work for me with whatever build I had on there: ```>>> b = busio.I2C(board.GP5, board.GP4)
b.try_lock()
True
b.scan()
[40]
@idle owl OK I'm ready for your uf2 or whatever
ok two shakes
or you can send me your changes; if they're funky and not working we might want to talk about the changes anyway
Valid. Let me try this over here first.
Oof. The breakout is causing the Pico not to mount. Plug it in, and it fails.
Unmounts CIRCUITPY, and if I unplug power or ground, CIRCUITPY shows up again.
do you have it the right way 'round? There are at least 3 wrong ways.
I'm using STEMMA cable to male headers.... I'm at least relatively sure I have them plugged into the right place....
I don't have a Cowbell yet.
oh
I'm directly into the Pico
Totally different breakout, same issue
something's not right here.
wait maybe I got it
I did!
OK, the singleton works.
Let me get you a build.
Here's what I have for wiring
I accidentally plugged in the STEMMA power pin to the 3V3_EN pin instead of 3V3.
haha ENable.
So uh.... I think I'm missing something for building for Pico W. That output looks way different.
And there is no uf2.
you may need to install "cmake" somehow, just guessing
but that's just guessing without seeing the messages
Oki.
This looks like where it failed? ../../py/qstr.h:42:14: fatal error: genhdr/qstrdefs.enum.h: No such file or directory 42 | #include "genhdr/qstrdefs.enum.h"
OK that's not what I expected then
do a clean then get the full output of make and I'll squint at it with you
not sure what's going on there
Hmm.
the problem isn't with cmake, that part seems to have gone OK
I updated it anyway, if it needed it.
can you "git stash" or otherwise save your changes, and see if before your changes it built for you?
wild
but you successfully built the non-"w" version?
just PR what you have and I'll test from the Actions build
Yes. I can build non-W.
I told you to clean but I didn't tell you a specific commandline. Can you : make BOARD=raspberry_pi_pico_w clean ?
That's what I did. But I'll try it again.
is that what you did?
Trying it without -j
🤷🏻♀️
Wow that's slow. Didn't realise how much of a difference that made.
If this fails, I'll PR it.
@onyx hinge I did a smart!!!
It worked!
Uff, sorry. 😄
but let's move on with testing your uf2
>>> import board
>>> b = board.STEMMA_I2C()
>>> b.try_lock()
True
>>> b.scan()
[40]
wtf? 7.2.0-alpha.2-543-gedce717cf-dirty
Ooof mine is the same
What did I do wrong? I branched off of main!
"git fetch --tags origin"
assuming origin is adafruit/circuitpython
do you call it upstream? anyway
adafruit is what I call it
Always for remotes, it's the username for the remote
Ok, so how did this happen?
I did git pull adafruit main from main and then did make fetch-submodules. Then branched.
This is the commit I'm on edce717cf which is latest according to GitHub.
Also oof, I do have a Proto Cowbell, heh.
"git fetch --tags adafruit"
Did that
The version number comes from the "tags" which don't come by default from "fetch" or "pull"
Hmm
I thought seeing "7.2.0-..." was what we were trying to solve, no?
you might have to clean after that too
yes
ok so rebuild and see what happens?
I'm going to do Pico because I can do it faster
OK
Oh come on.
The same error just happened for Pico as well.
Guess it'll be slow after all. Bleh.
that's odd, very odd
Worked the first time. 🤷🏻♀️
waits impatiently
There it is.
There we go.
Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf-dirty on 2022-10-24; Raspberry Pi Pico with rp2040
OK, I think this is good to PR.
I've tried my usual tricks to make a rare parallel build error into a repeatable one (the trick of being kattni and having her computer is not available to me) and I still don't get it here. makes it hard to work on.
Uff.
😕
So wait.
Before I hit go on this.
Should we add board.I2C() too at this point?
@tulip sleet Thoughts? ^ I don't know
I can ping Limor on this if needed, but I'm wondering if we're doing this, should we do it.
We avoided it because lack of specifics on silk.
The board itself doesn't have designated I2C pins. When a STEMMA picowbell is attached, the adapter has STEMMA I2C pins
i would say no, beacuse the bare board has nothing to indicate default I2C pions
All PiCowbells will have STEMMA on those pins. That's why she asked for this.
Ok, thanks for input
Tested successfully on Pico by myself, and on Pico W by Jeff.
I chose to use the #define CIRCUITPY_BOARD_I2C_PIN method in case there is some hardware in the future that defines a different I2C, or in the event that they choose to specify a default for the Pico at some point.
Wheeee
@idle owl ```jepler@bert:~/src/circuitpython/ports/raspberrypi$ make -f Makefile BOARD=raspberry_pi_pico_w clean; make -f Makefile BOARD=raspberry_pi_pico_w -j12 build-raspberry_pi_pico_w/autogen_display_resources-en_US.o V=1
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-raspberry_pi_pico_w
mkdir -p build-raspberry_pi_pico_w/genhdr
GEN build-raspberry_pi_pico_w/autogen_display_resources-en_US.c
GEN build-raspberry_pi_pico_w/genhdr/mpversion.h
GEN build-raspberry_pi_pico_w/genhdr/moduledefs.h
GEN build-raspberry_pi_pico_w/genhdr/qstr.split
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.collected.h
QSTR updated
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.preprocessed.h
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.enum.h
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.generated.h
CC build-raspberry_pi_pico_w/autogen_display_resources-en_US.c
Wait, so this? make -f Makefile BOARD=raspberry_pi_pico_w clean; make -f Makefile BOARD=raspberry_pi_pico_w -j12 ?
yes
Yes, same failure
not quite
but OK
make -f Makefile BOARD=raspberry_pi_pico_w clean; make -f Makefile BOARD=raspberry_pi_pico_w -j12 build-raspberry_pi_pico_w/autogen_display_resources-en_US.o V=1 was the intended command
also what's make --version for you?
do you have gmake --version?
Not found.
if not can you brew install it? https://formulae.brew.sh/formula/make I don't know brew except that I think it's what you use on macs
Where does make even come from?
Yeah I'll try brew installing it
It's not currently brew installed
I use gmake for tinuUF2 because it requires 4.2+
Apple installs some very old versions of unix software like make but they don't update it
Fair enough
I think after that brew install you should have gmake --version at 4.3. Then you would gmake BOARD=... and see if the outcome is any different for you
I did switch my CP build to gmake too
I have no proof or even a solid indication that it's the old version of make, but it's something to try.
I think it worked. It's not done yet but it's past that point.
Waiting for completion before I say for sure, obvs.
🎉
@onyx hinge It worked!
interesting to know! mind trying it 2x more just to see if it was first timer luck? with a clean each time?
Sure
if so we'll need to add to documentation that a current version of make is required due to 🤷 gremlins
we don't deliberately use any newer features of gmake but it's what's on the github actions, and on my desk and dan's desk so it is what gets tested
in tinyuf2 it's because it uses $(file < ...) which is 4.2
OK I built make 3.81 and can confirm I get this error building
Ooooh ok
I'll file an issue about documenting it
No idea how to update that manually. And this terminal window anyway, is still using 3.81. I think I have to change something somewhere to make it use the brew version of it.
But gmake works fine.
Thanks, Jeff!