#circuitpython-dev
1 messages ยท Page 18 of 1
yeah so this is just the one we at boardsource used for our keyboards in qmk I swore it ascii table for bs(boardsource) or something but I cant figure out now how we came up with this number. What do we need to put there? We are happy to change it.
I think you'd actually want None. You can always add an empty Group from user code if that's what you want. (This might be trickier internally and you could hide the empty internal Group its easiest. .root_group should be None though.)
I also wonder if None shouldn't trigger the terminal when user code is done. That'd make disabling the terminal easier (https://github.com/adafruit/circuitpython/issues/2791).
You'll want to use an officially sanctioned USB vendor id (VID). Raspberry Pi lets you use theirs for the RP2040 if you request it. You can also buy your own for $6000 if you are going to make many USB enabled boards. Open source hardware and software can request one from https://pid.codes
We may need to also make a check specifically for setting to CIRCUITPYTHON_TERMINAL as well to do this setup that sets the positon and starts the terminal.
I will give try it out with None and see if I can get that working.
Do you know where to look to find the code causes the initialization of the terminal for the first time when the device b...
@onyx hinge why is the lwip lib in ports/raspberrypi ?
@slender iron good question! It should probably be moved up to lib/ so we can potentially use it in another port. If such a port is planned.
and even potentially the common-hal/socketpool would also be shared
that is, what is currently ports/raspberrypi/common-hal/socketpool would have to go in a place shared among ports
ya, some of it probably can. the esp versions is the rtos version
k, I'll move it and use in shared bindings
won't consolidate any code though
nah not right this second
I'm slightly worried there could be confusion/incompatibility if you end up including both headers from esp-idf's lwip and from this lwip within an espressif build. hopefully such problems would be visible at build time
like, if some macro is defined in a different way
ya, that could be a problem
the other option is to require one of the common-hal headers to include it
is this for macros/enumerated types like SOCKETPOOL_SOCK_DGRAM?
common_hal_socketpool_socket_setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));
so IPPROTO_TCP and TCP_NODELAY
can you just use common_hal_socketpool_socket_settimeout ?
or is this "nodelay" different than a timeout of 0?
oh yeah I vaguely know about this thing you're mentioning
you set it before a send so that it writes immediately
since you can't flush a socket ๐
looks like we have enums for the others already
This is a little ambiguous. Maybe more like already in station mode or already connected to an access point.
Differences from espressif, from above and from testing:
- Station and AP canโt operate simultaneously
-- if device AP is started, device Station can't connect to an external AP (RuntimeError: Already in access point mode.)
-- If device Station is connected to an external AP, device AP can't be started (RuntimeError: Already connected to station.) - once an AP is started, it can't be stopped without a power cycle or
microcontroller.reset() - AP channel can only be set once after ...
@slender iron are there times that circuitpython code would need to set this flag in order to work properly too?
maybe? CPython does allow you to set it
micropython doesn't have NODELAY according to a quick full text search
hum is it different (not setsockopt)? #define tcp_nagle_disable(pcb)ย ย ย tcp_set_flags(pcb, TF_NODELAY)
they have setsockopt for SOF_REUSEADDR and IP_{DROP,ADD}_MEMBERSHIP but not seeing NODELAY
we just always set REUSADDR on listening sockets I think
I had done it with sockopt for esp
I mean I think it may be different for the lwip "no_sys" case
๐ the proof of the pudding is in the eating
and by works, I mean compiles
in raspberrypi, socketpool_socketpool_obj_t is small at 44 bytes (phew). the pointed-to object like struct tcp_pcb is a bit bigger but only a few hundred bytes. and it may come from that small lwip-only heap rather than the CP heap.
ya, that's my guess
do you know if you need to enlarge the lwip heap for web workflow? since you might have more sockets active than a standard web server or web fetcher..
ya, maybe
someone will let us know
looks like I do need to do nagle directly
@gilded cradle why does the code editor try to do import .code in the repl?
Where are you referring to?
It might have been from https://github.com/circuitpython/web-editor/pull/34
It's probably a bug
Changed the messages up a bit.
These should be a lot simplier.
- once an AP is started, it can't be stopped
Or even have its settings changed.
You get one shot. :sweat_smile:
Everything I've tried is working as expected. Just ran an adafruit_httpserver on the wifi AP, and connected with a CircuitPython client and got served. I'm going to approve this and defer to one of the core devs to decide to merge. It would be nice to get this out there for more folks to poke at it :-)
- Except for circuitpython.local which depends on MDNS and will be done in a follow up PR.
Progress on #7214
can you just say a few words about what's going on with this removal?
I won't leave a final review since the build is failing and I'll have to do it anyway. ... I have some questions/comments, but they're mostly for my understanding.
does this need to close the underlying socket, or is the invariant that the underlying socket is already always closed?
is the invariant here that the "sock" socket is guaranteed not open, so that it doesn't need to be closed or otherwise operated on?
change is to add --specs=nano.specs. Not sure what this does. availability of some needed functions?
I have done more testing using my 4 QT-PY ESP32-S2's. They will often run for a dozen hours and then all core crash within minutes of each other. I've been checking the memory and there doesn't appear to be any leaks.
I've been trying to come up with a way to reliably reconnect the WiFi when it's disrupted. Pinging the gateway, and then reconnecting on no response, does work most of the time. However, certain types of disconnections seem to always cause a core crash.
All 4 QT PY's a...
On espressif port (ESP32-S2), you can call connect() whenever needed with negligible penalty even if the device is already connected, so there's no harm and no need to ping.
The truest test of whether the deice is connected is checking for an IPv4 address; if there is an IPv4 address, then the device is connected to the AP. This is how it's tracked internally on espressif port.
btw: The [docs](https://docs.circuitpython.org/en/latest/shared-bindings/wifi/index.html#wifi.Radio.co...
@anecdata The crashes occur on wifi.radio.connect(). They don't occur on the pings. That's why I'm trying to minimize the reconnects. Thanks, for the tip on the ipv4_address! I will try setting up one of the QT PY's with an ipv4_check instead of pinging to determine if the WiFi connection has dropped.
How did you determine that the connect() is triggering the hardfault?
btw, espressif boards will automaticvally connect to the AP with the best signal, among multiple of the same SSID:
Another thing that need to be considered is that the reconnection may not connect the same AP if there are more than one APs with the same SSID. The reconnection always select current best APs to connect.
<https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/wifi.html#wi-fi-reco...
Further critical fixes were made in that code today, now at version 1.5.3.
I have relied on the print statements. I have a print statements on the line before and after wifi.radio.connect. When a crash occurs the preceding print statement prints but the subsequent one never prints.
There is only 1 access point in the house.
I was using the RSSI code because I was having signal strength issues with 2 of my QT PY's which have external antennas instead of built-in on the board. The built-in antennae seem to work better although it doesn't matter when everything ...
@tulip sleet when you get time https://github.com/adafruit/circuitpython/pull/7162
I'd like to get it in before starting working on #7244, might as well refactor more common code while I am diving into the Makefiles.
Np, I think I was waiting for the build to finish and then forgot
This is what I was thinking. Thank you for verifying that it's already using DMA to PWM. Knowing that really helps. I have some questions about how the API calls to RawSample from the audio pipeline work, but I'll save those for later. I think I'm going to study the code a bit more and then open an issue to ask questions and such.
alias cpb='make -j4 V=1 BOARD=raspberry_pi_pico_w' in ~/.bashrc
reload the shell and
cpb clean
cpb DEBUG=1
๐
this saves so much time
should I tell you about ctrl+r?
well..
most I do is Ctrl + L
I will eventually go implement all the keybinds in ljinux, so I'll learn em
I have a large set of aliases like that for the common boards
honestly.. wow
this is an amazing set of aliases
unset make-atmel-aliases
unset make-cxd56-aliases
unset make-mimxrt10xx-aliases
unset make-espressif-riscv-serial-aliases
unset make-nrf-aliases
unset make-espressif-xtensa-serial-aliases
unset make-rpi-aliases
unset make-espressif-xtensa-usb-aliases
unset make-stm-aliases
good point that I can unset the alias making routines
I also added V=1 to all the makes and V=0 to all the cleans
and added -clean for all
cuz free storage, am on a pi400
i keep this file (and other similar stuff like my emacs setup) in a private git repo
so I can use it on all my dev machines
a .dotfiles repo tldr
we all got one
I just build, but per my usual over-engineering nature I have a python script that does all the work of going into the port directory and do the things. And has board name tab completion and some aliases.
./build_cp.py -b adafruit_feather_rp2040 -b magtag -b cpb --repo latest --repo pr-7247
and after a few minutes I have 6 new uf2 in a build directory
sounds good too; I often recompile and reload every few minutes, so that was my target use
over-engineered solutions are the best solutions
yeah I do the install part very manually still, though I have a espinstall alias for esptool, and I'm testing methods of installing a .env on ESP32/C3 boards automatically
gnu screen keystrokes could work
you know, starting a detached session with a name, and sending keystrokes to it
technically all I need is ampy, but I wanted something small and self contained that also does retries (and warns me) if I forgot to reset the board or it's somehow stuck
Is there any news on this bug? It pervents us supporting Circuit Python on some of our products
well, if the screen contains Adafruit CircuitPython it's good, else, needs reset
pretty sure there is a func for that
also there was a PR I was working on a while ago where I put a script on the board that made it test the PR and reboot in UF2 mode, that was kind of fun, no need to touch the board during testing, just build and cp
sounds complicated
well on ljinux reboot accepts modes
uf2, bootloader, etc..
and I just do it that way
soon enough, when I have ssh working, it's gonna be poggers
I am debating as if I should implement a trully compatible ssh circuitpython server or just yoloing it in a diy protocol
though telnet should be easier
and here is an example additional output of that build command:
######################################################################
adafruit_feather_rp2040 ๐ 709524 bytes (latest) โฑ 0:48
adafruit_feather_rp2040 ๐ 709692 bytes (pr-tester) โฑ 0:55
adafruit_magtag_2.9_grayscale ๐ 1341104 bytes (latest) โฑ 2:40
adafruit_magtag_2.9_grayscale ๐ 1341584 bytes (pr-tester) โฑ 2:25
circuitplayground_bluefruit ๐ 527684 bytes (latest) โฑ 1:02
circuitplayground_bluefruit ๐ 527844 bytes (pr-tester) โฑ 1:00
######################################################################
ohh icons
(it can also give a delta of file size with a green or red flag)
@dhalbert fixed it. I just reviewed and merged. :-)
Do you know where to look to find the code causes the initialization of the terminal for the first time when the device boots up? I think something somewhere may call show(None) to get the terminal showing after boot up, if so it'll need to set it to CIRCUITPYTHON_TERMINAL instead.
I think the first time is in common_hal_displayio_display_construct (board_init calls it.) Subsequent sets back to terminal are done in reset_displays I believe.
I removed it from each port because the implementation was the same or worse. Now there is a shared implementation in supervisor/. I did this here because workflows use an override_fattime call to set the file modification time based on the API transaction's time rather than the internal RTC.
Yes, that should be true. I'll add a check just in case. (Maybe you could get a second websocket request at the same time the first is open.)
It should have never been used. This is really to set the memory so it reads as closed before it is used. Happy to rename if you have a better name suggestion.
Its to make sure we use the size optimized c library (newlib-nano). We now need strncasecmp for case insensitive string comparison.
It is still below. (New line 847) This diff isn't great because most of the logic here was kept the same even though it was moved to a non-allocating version of accept that the allocating version uses.
No, I added support for empty host "" to bind to all IPs of the interface. It also doesn't need to run a resolve then.
You can also do a DEBUG=1 build to get a back trace when the crash occurs. There is a backtrace decoder in ports/espressif/tools
#circuitpython-dev on Discord is the best place to ask dev questions.
Nope, it isn't high on our (Adafruit-funded) list. We're always happy to help others fix things though. The places to start are the implementation and #circuitpython-dev on our Discord.
I'd also suggest comparing the full assembled versions between MP and CP. Its possible the bug is somewhere else besides the noblock.
Never tried to build CP. Is there a build guide for the QT PY ESP32-S2 or are there any prebuilt UF2's with debug enabled?
@rdagger See https://learn.adafruit.com/building-circuitpython/ and particularly https://learn.adafruit.com/building-circuitpython/espressif-build. If you have or can set up a Linux box, that's generally easiest. The DEBUG=1 build might be too big, and you may need to disable some features. Setting CIRCUITPY_ULAB=0 is often enough, because that's large. We can help you with builds in https://adafru.it/discord in #circuitpython-dev.
@dhalbert fixed it. I just reviewed and merged. :-)
noticed that laterโฆthanks @dhalbert for the fix!
This pulls in the latest frozen libraries. The main one I need updated was PortalBase, but thought I'd update the others as well.
I was thinking 8.0.0 branch, but this could probably be applied to the 7.3.x branch as well.
I was thinking 8.0.0 branch, but this could probably be applied to the 7.3.x branch as well.
I have to make a new release for 7.3.x to get the update. Is there a particular fix you want people to have?
Did you use make update-frozen-libraries at the top level? Usually I do this just before a release, but we will probably not make a release until early next week.
Did you use
make update-frozen-librariesat the top level? Usually I do this just before a release, but we will probably not make a release until early next week.
Yep, that's exactly what I did. We can close this if you'd rather wait until just prior to release.
I have to make a new release for 7.3.x to get the update. Is there a particular fix you want people to have?
Nothing major. It just updates the status lights to be consistent with the documentation.
OK, thanks, let's wait. We'll definitely do it before the next beta release so we get the absolute latest libraries.
I tried this on the tip of main with an open network on a spare router I have, both unconnected to the Internet and also (briefly) connected. I repeated a (slightly modified) standard CircuitPython internet test several times with a soft restart in between, and could not cause an error.
I am going to close this for now. Please reopen or resubmit if you still see this problem with the latest 8.0.0. I did not...
My first thought is I would probably just listen to the keydown event for arrows and send it via serial.
However, there are some other cases to watch out for:
- Clicking on different locations with the mouse moves the cursor and it's a different variation of the same problem.
- Pasting text in can present another similar problem and there are a variety of ways to do this, so it's not as easy to prevent. Here are some ways I can think of that this can be done:
- Pressing Control...
In the course of testing #6897 (could not reproduce), I found that the signatures for wifi.Radio.connect() and wifi.Radio.start_ap() did not correspond exactly to what these functions took, and that arg validation could use some improvement.
- Corrected type annotations for
wifi.Radio.connect()andwifi.Radio.start_ap(). - Use
b""andNonewhere appropriate in those methods, rather thanMP_OBJ_NULL, which doesn't have a direct analog. - Use bitmask values for wifi.AuthMode ...
@tulip sleet is channel still optional in start_ap? I'm not real savvy on the signatures
it has a default value of 1 if not given
Optional[] is short-hand for Union[... | None]
ok thanks, I just wasn't clear on why some have the Optional] tag and some don't
ah
Optional was being used to mean "optional: there's a default value", which is not what it means
also I think in the old code it might not have been possible to give the empty string as a password?? I wasn't sure, and rewrote the checking logic to be clearer.
I half-remember worrying about avoiding glitches when changing the duty cycle. I think that was in some other port, though.
Should this be fixed for 8.0.0?
I'm a bit confused as to what to do next:
- Move this code to
deinit(). - Move this code somewhere else and call it from
PulseOut(). - In deinit(), just disconnect the pin from the PWM peripheral and pull it low. Would that work without waiting?
I thought you might say that. I've joined, and I'll ask there instead then. Thanks for the help thus far!
I honestly feel like pio and coproc cover the need for multi core just fine
on microcontrollers polling and hardware updates is all we needs cores for
so proper modules using those, can be made non-blocking
the rest of the stuff, can be done with a single thread
non-blocking read โ
webserver โ
an entire fricking shell โ
I've been working on audio generation for a synthesizer, which is heavily CPU bound. This isn't just polling and hardware updates, and it would dramatically benefit from using a separate core, because it is timing sensitive. That said, I think coproc might still cover that.
coproc's shared mem should be ideal for audio
I really need to get to making some modules with it
its very good practice
Yeah, that sounds right. What I would like to be able to do is put all of the audio generation stuff on the second core (RP2040) and do the user interface stuff on the first core, so that the UI stuff doesn't interfere with the audio. Shared memory is ideal for communicating with the audio generator.
rp2 is plenty fast, with some optimised work it should be doable regardless of the ui
However yes, tapping into the 2nd core would be immensely useful for this.
I should take a look as to how the built-in modules use the 2nd core.
First time trying to build CircuitPython and I'm getting the following error during make command for adafruit_qtpy_esp32s2: "failed to clone components/esptool_py/esptool"
Right, I'm currently working on this in a single thread, using the existing audio libraries, and it's keeping up really well. The problem is that I have to loop my waves when playing, because I can't do precision timing to avoid gaps or clicks when changing samples. I'm actually here for some help writing a new class based on RawSample that uses a FIFO buffer (which is how a lot of PC audio systems work), so I can keep a sample playing and add to it as needed. That said, if I wanted to use a more advanced display in the future, that could end up using enough additional CPU time to make using the second core a necessity.
@eager vortex did you do make fetch-submodules at the top level?
@slender iron I ran the command in the circuitpython folder.
please post the full output
rdagger@UbuntuVM:~/Downloads/circuitpython/ports/espressif$ make BOARD=adafruit_qtpy_esp32s2 DEBUG=1
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
IDF_PATH=/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf cmake -S . -B build-adafruit_qtpy_esp32s2/esp-idf -DSDKCONFIG=build-adafruit_qtpy_esp32s2/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="esp-idf-config/sdkconfig.defaults;esp-idf-config/sdkconfig-debug.defaults;esp-idf-config/sdkconfig-4MB.defaults;esp-idf-config/sdkconfig-esp32s2.defaults;boards/adafruit_qtpy_esp32s2/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja -DCIRCUITPY_ESP32_CAMERA=1
Including esp32-camera
COMPONENTS = esptool_py;soc;driver;log;main;esp-tls;mbedtls;mdns;esp_event;esp_adc_cal;esp_netif;esp_wifi;lwip;ulp;wpa_supplicant;freertos;bt;usb;esp32-camera
-- Initialising new submodule components/esptool_py/esptool...
Cloning into '/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf/components/esptool_py/esptool'...
fatal: unable to access 'https://github.com/espressif/esptool.git/': Could not resolve host: github.com
fatal: clone of 'https://github.com/espressif/esptool.git' into submodule path '/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf/components/esptool_py/esptool' failed
Failed to clone 'components/esptool_py/esptool'. Retry scheduled
Cloning into '/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf/components/esptool_py/esptool'...
fatal: unable to access 'https://github.com/espressif/esptool.git/': Could not resolve host: github.com
fatal: clone of 'https://github.com/espressif/esptool.git' into submodule path '/home/rdagger/Downloads/circuitpython/ports/espressif/esp-idf/components/esptool_py/esptool' failed
Failed to clone 'components/esptool_py/esptool' a second time, aborting
CMake Error at esp-idf/tools/cmake/git_submodules.cmake:48 (message):
Git submodule init failed for components/esptool_py/esptool
Call Stack (most recent call first):
esp-idf/tools/cmake/build.cmake:77 (git_submodule_check)
esp-idf/tools/cmake/build.cmake:175 (__build_get_idf_git_revision)
esp-idf/tools/cmake/idf.cmake:50 (__build_init)
esp-idf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:18 (include)
-- Configuring incomplete, errors occurred!
make: *** [Makefile:330: build-adafruit_qtpy_esp32s2/esp-idf/config/sdkconfig.h] Error 1
I think it was a VM networking issue. Looks like it's cloning now.
Networking issue? It's failing to clone the esp repository from Github. Is there a way to do that manually?
Oh nice! Looks like you figured it out.
btw: Is the build going to be too large with the DEBUG=1?
it will tell you if it's too big for the board
@tulip sleet Oof, wait, did we fix LC709203 and ESP32-S2? I totally forgot I was using it in this code I have here.
I did not have difficulty with LC709203F on S2, only on S3. I proposed some changes to the library for S3 which worked for me, but a user said they still have trouble.
Oh excellent! I'm using S2 specifically. So that works. Thanks!
CircuitPython version
adafruit-circuitpython-microbit_v2-en_US-7.3.3.combined.hex; microbit_v2
Code/REPL
code.circuitpython.org
Behavior
Uncaught (in promise) TypeError: navigator.bluetooth.getDevices is not a function
Argh: NetworkError: Connection failed for unknown reason.
Description
Additional information
No response
I was able to build with DEBUG=1. For some reason the I2S is not working but I don't really need it to test the WiFi. I will left you know how it goes and thanks for the build help.
- If I have a pixelmap and access outside of the bounds CP crashes
@gamblor21 do you raise an exception like IndexError? or crash more severely than that like a hardfault crash or something?
I'm seeing this when I attempt to access outside of the bounds, and it seems like reasonable / expected behavior to me for the error case.
Traceback (most recent call last):
File "code.py", line 26, in <module>
IndexError: index out of range
So I know CP won't deep sleep when connected to computer USB, or does "fake" deep sleep anyway. Does that apply to USB power alone? e.g. Plugging it into the wall via USB for power.
Or does it even matter? Can a Feather with TFT stay on constantly without an issue?
its usb data
so a wall plug should allow deep sleep
(but its not really that needed)
Ok, what about the second thing... ah ok
I wasn't sure if there was an issue powering it constantly.
not that I know of
have a good night!
You too!
There are at least two things that could be out of range
- the indices used to construct the PixelMap
- the indices used to index into the PixelMap
it wasn't clear which one of the two was causing the problem .. an example program could be helpful!
Recommend simply disabling the new module on this board...
Error: Build bluemicro833 for ru took 31.40s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/nrf'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
237588 bytes used, -20 bytes free in flash firmware space out of 237568 bytes (232.0kB).
I had my matrix temporarily mounted in my window. I plan to take it down tomorrow and will do some more testing to find out how to reproduce the error I saw.
It was not just an exception but some type of hard fault (or infinite loop as I lost USB).
@jepler I am late for the party, from what I could understand, Ctrl-C isn't sent to tinyusb since the rx buffer is already full !! If it is the case then indeed, we couldn't resolve this without dropping characters unless as you mentioned we use an additional channel such as modem/control signal. Let me know which modem signal that you plan to use and isn't supported yet by tinyusb, BREAK seems to be a great choice.
1230984 bytes used, 337784 bytes free in flash firmware space out of 1568768 bytes (1532.0kB).
67784 bytes used, 194360 bytes free in ram for stack and heap out of 262144 bytes (256.0kB).
Just in case anyone cares about free board storage.
Hi, the code for the editor is in https://github.com/circuitpython/web-editor/. The BLE code on this has never worked great despite trying many things and getting BLE fixed should happen soon. I had been pulled off the project for a couple of months to get some other things done, but have resumed this week. There's a similar issue at https://github.com/circuitpython/web-editor/issues/26. I think your error message may pinpoint the an underlying issue better though.
Since the repo is owned ...
New issue is here: https://github.com/circuitpython/web-editor/issues/40. I just noticed you had the microbit v2. There was an existing issue at https://github.com/circuitpython/web-editor/issues/10 from before a major code rewrite that may be related.
I was unable to reproduce the problem with your test program on 7.3.3 or 8.0.0 beta(s). I have a powered speaker (Bluetooth speaker with aux input) connected to a Trellis M4. However, I tried a different test program that just plays mono wav files in sequence. I note that if I use stereo output and play mono files, every other play has a buzzing noise superimposed. The test program is a simplification of https://learn.adafruit.com/abc-soundboards-with-neotrellis/code: the important part is:
...
I don't think this is important to do because it only impacts the offline serial terminal. I'd rather focus on code.cp.org
I don't think this needs to be in 8.0.0 because its been this way a while. I'm not sure exactly what the right fix is.
Right, that's what I'm focusing on. I was just adding my thoughts to the mix.
@onyx hinge any opinion on what I do with a modified version of lwip? I'm thinking gh.com/adafruit/lwip like I normally do
@slender iron seems fine to me
The battery charge rate control pin appears to be not defined on Seeed XIAO nRF52840 Sense. This pin controls the rate at which any attached battery is charged. This pin sets the charge current to either 50mA or 100mA. Currently there is no way to utilise the higher charge rate.
The version of CircuitPython in use is Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Seeed XIAO nRF52840 Sense with nRF52840
Looking at pins.c, the following pins for battery interfacing are defined:
``...
@slender iron I thought maybe you fixed the trailing dot problem for espressif ๐
haha, nope
Even before this is added to the board definition, that pin should be available as microcontroller.pin.P0_13.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Raspberry Pi Pico W with rp2040
Code/REPL
import board
import digitalio
import asyncio
async def blink(pin, interval):
with digitalio.DigitalInOut(pin) as led:
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = not led.value
await asyncio.sleep(interval)
async def main():
print("Started")
t1 = asyncio....
I think this may be #7173. In trying to make asyncio testable on host computers during the build I introduced a bug which I tried to fix in #7138 (in beta 4) but the fix was wrong; #7173 (which is not yet in the released version) I hope fixes it fully.
If you're able to grab a "very latest" build and let us know if it's working (such as https://adafruit-circuit-python.s3.amazonaws.com/bin/raspberry_pi_pico_w/en_US/adafruit-circuitpython-raspberry_pi_pico_w-en_US-20221123-3056365.uf2) it wo...
While testing #5932, I discovered a different problem, which is that mono files played back on SAMD51 on stereo channels caused a buzz every other time. This was due to not checking the number of channels when setting up the DMA's.
Now, a mono file will play in only one channel if there are stereo channels. If two DMA's are set up (depends on the channel order), then the mono file would play twice as fast (I guess double incrementing is going on). This may be fixable but I think requires s...
CircuitPython version
adafruit-circuitpython-espressif_esp32s3_box_lite-en_US-8.0.0-beta; ESP32-S3-BOX-Lite
Code/REPL
import wifi
wifi.radio.start_ap("esp32", "password123")
Behavior
Board disconnects from serial connection, when code above input into REPL, it returns:
Running in safe mode! Not running saved code.
You are in safe mode because:
Internal watchdog timer expired.
### Description
_No response_
...
This seems to fail when just trying to connect to an AP as well.
wifi.radio.connect("ssid", "password")
CircuitPython version
main branch
Code/REPL
~/circuitpython/ports/raspberrypi$ make -j8 BOARD=raspberry_pi_pico_w
Behavior
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
CMake Error: The source directory "/home/m1cha1s/circuitpython/ports/raspberrypi/build-raspberry_pi_pico_w/pioasm" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:66: recipe f...
Did you make fetch-submodules from the root of the repo (~/circuitpython)?
I'd also check for an incompatible make version: https://github.com/adafruit/circuitpython/issues/7117
We haven't determined a compatibility range or minimum version for cmake, but I have cmake version 3.18.4.
What cmake and (g)make versions do you have?
The error message says that "The source directory" doesn't exist but the path it gives has the form of the target directory (because it contains "/build-"). The full output of `make V=2 -j1 -f Makefile BOARD=raspberry_pi_pico_w bui...
Hi,
I am from Cytron technologies. Please help to add this new board - Maker Feather AIoT S3
Thanks.
I somehow got my hands on a lolin s2 mini with no embedded psram..
Ebay sure works wonders..
Well, time for custom builds
I will prolly pr it, cuz it is a mass produced board.
tinyuf2 was happy with it and even does the cool pwm trick
just, no psram
so, circuitpy doesnt boot
blinks in 1s intervals
yeah tinyuf2 usually doesn't use the PSRAM
I mean, from the quick read I gave it, it doesn't seem to use it at all?
right
Oh hello there
Adafruit CircuitPython 8.0.0-beta.4-45-g30563655d7-dirty on 2022-11-25; S2Mini_nopsram with ESP32S2-S2FN4R2
Board ID:lolin_s2_mini_nopsram
UID:487F30CD8167
Well, today I happened to receive a lolin s2 from ebay that happens to have no psram.
Looks exactly the same as the original.
The original one is supposed to have 2mb, but this one does not.
The current circuitpy builds do not work with it, and instead bootloop cause of the missing psram.
This pr duplicates the currrent board configuration, with the changes needed.
Tested it. If I haven't forgotten any files, it is ready to go.
Hello, someone can help me to understand which part of the Keypad library process a key push in background?
this function scans in the background:
https://github.com/adafruit/circuitpython/blob/30563655d7d9920bec326cbe607a2e5f16cf95f9/shared-module/keypad/__init__.c#L42-L58
It is scheduled here:
https://github.com/adafruit/circuitpython/blob/30563655d7d9920bec326cbe607a2e5f16cf95f9/supervisor/shared/tick.c#L102-L104
It calls this:
https://github.com/adafruit/circuitpython/blob/30563655d7d9920bec326cbe607a2e5f16cf95f9/shared-module/keypad/__init__.c#L124-L129
And ultimately calls this for example for an instance of Keys:
https://github.com/adafruit/circuitpython/blob/30563655d7d9920bec326cbe607a2e5f16cf95f9/shared-module/keypad/Keys.c#L91-L111
wow! you're a hero. Thanks too much!
Added board definition for ESP32 devkit v1 board.
My DEBUG=1 build on the QT PY ESP32-S2 crashed as expected but unlike the regular builds it did not go into safe mode. Instead the Mu terminal locked up and the QT PY drive completely disappeared. Is it still possible to retrieve the debug data?
if you can you want to connect to the uart pins with a UAB-UART module, it should give you the debug output there regardless of the native USB, I don't remember if you need to set the debug pins in mpconfigboard.h
Unfortunately, the board is in an enclosure so I can't get to it without unplugging it. I assume all the debugging info will be lost if the power is lost. I have a fifth QT PY board (still in the package) that I can try again with. What's the best software and connection method for debugging (I assume Mu is a poor choice).
Is there any chance to be more specific over which make/model board this is, as there are 3 version of the ESP32 Devkit V1 that I have come across - 30/36 and 38 pin?
as a serial monitor, we tend to like tio around these parts, it's simple, auto-reconnects, and the dev has been quite active recently
Thanks, I will give Tio a try.
Will Tio work with USB because I'm using all the GPIO pins except A3?
it's just a tool to connect to the serial port, like Mu does but in a simpler and more flexible way, the problem is that since USB is handled in software on the board, if the board crashes you lose USB and therefore the serial port, that's why you might not see the entire debug output
outside of connecting to serial pins with a device like adafruit's "serial friend", I don't know how to solve that
OK. I can run the program without the display to free up some pins. btw: I'm trying to connect to the QT PY now with Tio through the USB and not sure what to put for the port. dmesg | grep tty shows the following:
[ 6.684960] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[110677.156943] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[111731.154188] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Never mind I got it.
Is it possible to redirect the serial to the stemma QT port SCL and SDA pins? I'm not using the port. Would I use mpconfigboard.h?
I think so ? I'm not sure how though, somebody else would have to pitch in
The latest commits disable this on the device that was too large, and move it to _pixelmap. I've also made a first draft version of the python layer code that integrates with this new core class.
I think the remaining open items for consideration are:
- The python layer's home. I've currently left it in
adafruit_led_animation.helperbut perhaps we want to createadafruit_pixelmapfor it? If anyone has thoughts on this I'm happy for input. I can cookie cut a new library and move the...
Sorry for the delay in testing, I hope to get to it tomorrow again.
Is this process possible on esspressif port? Specifically Feather ESP32-S2 TFT? https://learn.adafruit.com/debugging-the-samd21-with-gdb/setup and/or is this the right or best way to find the specific error output from a hard fault that I'm trying to debug?
@eager vortex You might not have to. I know with I2C, you can setup a device and specify what pins you want, without certain bounds. It might be possible to setup a raw serial port specifying the pins for the QT port, without having to redirect anything in the underlying code. I can't really help with doing that, but this might help:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial
The first code example contains this line: uart = busio.UART(board.TX, board.RX, baudrate=9600)
If you swap board.TX and board.RX with the pins for the QT port, that might work.
It should be possible I am just not sure how off the top of my head. You could look up espressif esp32-s2 idf gdb debugging or something similar and may find out how.
perhaps the pin labeled DBG would be used for this? I see that on the silkscreen but not mentioned in the pinouts page. I do remember the jlink think needing to connect to specific pins.
Nice, thank you for the point in the right direction, I'll poke around some!
Ok, now I have my own question:
In RawSample.c (https://github.com/adafruit/circuitpython/blob/main/shared-module/audiocore/RawSample.c), there is a function audioio_rawsample_get_buffer_structure. One of the arguments is *single_buffer. It is always set to true. I need to know what it is for.
Background: I'm trying to write a new audio sample class that uses a FIFO instead of a static buffer, to allow for real-time audio generation. My current options for the FIFO are a rotating queue or two buffers that are swapped between "frames" (like double buffering with video output). That argument sounds relevant to the double buffering option.
I think (haven't used this myself) it is future proofing if the buffer structure has multiple buffers in the future. So it is indicating the buffer structure is just one buffer. Maybe for say stereo samples or something or chained in the future
I thought it might be for stereo, in which case it isn't relevant to my use case. If it's for chaining though, that's basically what I'll be doing if I go with the double buffering approach (which I'm seriously considering, because the rotating queue has a potential problem when wrapping).
I don't know, I guess I'll be presenting the buffer to the caller as if it was just a single buffer rather than a FIFO or something else. The chaining is an implementation detail that the caller shouldn't be exposed to, I think...
Thanks! Even if you weren't able to provide a solid answer, you did help me work through the reasoning!
Yeah looking at it I wonder if the idea too was if you have RawSample vs AnotherSample classes maybe...
Perhaps. Maybe I just need to start writing the code, and if I'm wrong someone will point it out when I put in the pull request.
WaveFile.c actually sets it to false. I'll bet I can work out what it is for by comparing them!
Well, it looks like WaveFile.c is using two buffers in rotation, so it appears to be for chaining. I'll have to look through the code a bit closer to make sure I understand what it is doing, but I think this answers my question! Thanks again. Mentioning other classes reminded me that the WaveFile object exists! It also establishes a pattern of using double buffering for a FIFO, making it an easier decision for me.
Glad to help. I know sometimes just talking to someone else helps
Indeed!
@slender iron Do you know when audioio_wavefile_get_buffer() gets called? Specifically, is it called before the previous sample is done playing, or is it called as soon as it is complete? I need to know if I can reliably use the ..._get_buffer() call to know when the playback is finished using the last buffer it was given (using a pair of rotating buffers as a FIFO). (The user needs to be able to ask if my new audio sample class is ready to accept more input.)
The problem is the UART has to survive a core crash. Doesn't sound like modifying the build is trivial, so it will probably be easier to write a slimmed down version of my code to free up RX and TX. Unfortunately, I already printed PCBs to hook everything up. I guess in the future I'll try to leave the UART pins free or pick a board with debugging pins.
Ah, yeah, that would definitely do it. I thought you might be talking about the default serial in a context where my suggestion wouldn't work, but since I have no clue how you would work around that, I suggested what would work if you didn't mean that. Maybe my suggestion will help someone else. I hope you are able to figure this out.
not sure what happened to CIRCUITPY_DEBUG_UART_RX/TX ?
or if that has anything to do with anything
Do these error messages mean that there is not enough room to make the build that I attempted? I am used to a slightly different looking error in that case, but I don't do DEBUG builds much, perhaps that influences the output?
โฏ make BOARD=metro_m4_express DEBUG=1 -j 8
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-metro_m4_express/genhdr
GEN build-metro_m4_express/genhdr/moduledefs.h
QSTR updated
/home/timc/bin/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-metro_m4_express/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE'
/home/timc/bin/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 27884 bytes
collect2: error: ld returned 1 exit status
make: *** [Makefile:399: build-metro_m4_express/firmware.elf] Error 1
For a pixel string N long the range checks were lettings pixels[n] go through (and crash) where pixels[n-1] is the last valid value. Two range checks were inclusive of the top index value.
Other out of bound errors were being caught properly.
mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index);
mp_arg_validate_index_range(i, 0, self->len - 1, MP_QSTR_index);
Ah, thank you for catching this! @FoamyGuy I'll let you decide whether to use the commit suggestion button or to incorporate it locally, whatever works better with your workflow.
CircuitPython version
adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_GB-7.3.3 ,
latest magtag ,
Adafruit CircuitPython 7.3.3
Code/REPL
import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
import time
from adafruit_magtag.magtag import MagTag
import adafruit_minimqtt.adafruit_minimqtt as MQTT
from secrets import secrets
magtag = MagTag(
)
[...bunch of nonrelevant constants ...]
if use_live:
try:
...
Comment on slices: I did figure out how to implement the get slice, I could try to (figure out how to and) push a commit to this branch. I think it is worthwhile in the core. It was a 25% speed increase over doing it in Python.
- Try 8.0.0-latest beta or even "Absolute Newest".
- Is it the case that the "bad" one seems bad when the "good" one is powered off?
- Try erasing the entire flash on the bad one with
esptool.py erase_flash, and then reload the UF2 bootloader: https://learn.adafruit.com/adafruit-magtag/install-uf2-bootloader
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4-29-g2c479f4fc-dirty on 2022-11-26; Adafruit Metro M4 Express with samd51j19
Board ID:metro_m4_express
UID:B54635543254375320202039372C0BFF
Code/REPL
>>> from displayio import Group
>>> g = Group()
>>> g = Group(scale=2) # >> from adafruit_display_text import label
>>> import terminalio
>>> label.Label(terminalio.FONT) # >> from adafruit_display_text import LabelBase
>>> import terminalio
>>...
I also tested this on a Feather S2 TFT with a DEBUG build and it seems to run successfully there without a HardFault. So this seems to be somehow tied specifically to SAMD port and DEBUG version of the build as far as I can tell.
Trying to distill the issue further down into the bare minimum needed to reproduce I also tried removing Label from the mix to find the root cause, but was unsuccessful.
I created this class which is structured similarly to LabelBase
import displayio
class HardfaultCheck(displayio.Group):
def __init__(self, x=0, y=0):
super().__init__(x=x, y=y, scale=1)
self._local_group = displayio.Group()
self.append(self._local_group)
I imported this and c...
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-11-26; on Raspberry Pi 4 b
Code/REPL
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Dotstar painter! Can handle up to ~2300 pixel size image (e.g. 36 x 64)
import gc
import time
import board
import busio
import digitalio
FILENAME = "blinka.bmp"
IMAGE_DELAY = 0.2
REPEAT = True
BRIGHTNESS = 0.3
PIXEL_DELAY = 0.001
dotstar =...
This PR adds Github-codespaces support. Currently only supports Cortex-M builds. Creates a build-environment for CP with a few clicks.
is anything beyond uncrustify used in the code format / pre-commit process for the core repo? I've noticed that my local pre-commit is allowing if(){ with no space before the first paren. But once it gets into github and the action runs it fails for pre-commit and shows that it has changed to if (){ with a space.
I have this version which is same as actions as far as I can tell.
โฏ uncrustify --version
Uncrustify-0.72.0_f
I also tried running uncrustify on the single file directly and it doesn't change anything locally.
the formatter is supposed to be run from pre-commit, not sure what would be going different for you. That's the uncrustify version I have, too.
tools/codeformat.py is the script to invoke to format code, not directly uncrustify
I see. Running codeformat.py directly on the file does make it change locally to include the space. I guess my pre-commit is causing a difference somehow.
In my local instance it seems somehow specific to shared-module/displayio/display_core.c when I run pre-commit run --all-files it seems to ignore improper formatting in that file. Other files are getting checked and changed as appropriate though. If I run codeformat.py directly it finds and fixes the improper format in display_core.c.
I added a print statement inside of codeformat.py and in the case where display_core.c is the only file with improper formatting when I run pre-commit I do not see my print message, so it seems not to run codeformat.py for some reason when that file is the one with improper formats. When I change other files and run pre-commit I see my message printed a few times so I know it's running successfully sometimes, just not when that file is the one with improper format. Very weird ๐ป .
I was able to walk my dad through sending me the code.py file off of a Feather I installed as the new receiver in his mailbox notifier system. Took four minutes, and that included him going back to get the USB C cable out of the wall, not realising he needed that as well. Also worth noting: he's on Ventura, 13.0.1. Mounted immediately, and I had an email with my code within a minute. (I forgot to get my final version of the code before leaving it for him, and there are still a couple of updates I'd like to make. ๐ )
Also I couldn't update my GitHub repo with the latest code and build without the final code.
Evidently yes.
Thanks Dan!
- Try 8.0.0-latest beta or even "Absolute Newest".
- Is it the case that the "bad" one seems bad when the "good" one is powered off?
- Try erasing the entire flash on the bad one with
esptool.py erase_flash, and then reload the UF2 bootloader: https://learn.adafruit.com/adafruit-magtag/install-uf2-bootloader
TL;DR:
- it's Wifi signal related,
- board hard restart (button) and turn off-on produce more often success than soft restart,
- likely (but not f...
The latest commits implement the display.root_group = None behavior this is now showing nothing on the display instead of the CIRCUITPYTHON_TERMINAL
However I have noticed that after you set root_group to None it will raise an AttributeError if you then try to access root_group before setting it to something else. I'm working on resolving that. I am making a single test script that will test and report all behaviors as well to make it easy to verify things are working as expected in al...
It turned out that we needed an additional check for NULL internally to prevent the fill_area code from trying to access properties on a null object which was leading to hard fault.
It was making it to here inside of Group fill_area: https://github.com/adafruit/circuitpython/blob/1f3b2433c04be44dfb325c7300a83f9efc26e894/shared-module/displayio/Group.c#L377 then having the hard fault.
I added the check to fix it here in display_core instead of inside Group. It made more sense to me for...
The latest commit returns None properly after it's been set as the root_group. This script tests and reports each behavior:
import time
import displayio
import board
import terminalio
from adafruit_display_text import bitmap_label
from displayio import Group
WAIT_TIME = 1 # second(s)
main_group = Group()
def check_root_group():
print(f"root_group is None ? {board.DISPLAY.root_group is None}")
print(f"root_group == displayio.CIRCUITPYTHON_TERMINAL ? {board.DISPLA...
@lone axle For the PixelMap PR would you like me to provide the get slice code I quickly tested. I think adding it is worthwhile as the speed increase was substantial.
The code needs to be cleaned up still and can be merged with the set slice code to reduce size still
Yes, that would be awesome. Thank you!
Did you want me to figure out pushing my own commit (which I can do just never done it) or I can post the code. It really isn't that long. Probably will be tomorrow, don't think I'll have time today.
Whatever is convenient for you. I'm happy to work it in however needed.
Let's move this to the forums, since this does sound like some kind of hardware problem, not solvable in software. Open a thread here: https://forums.adafruit.com/viewforum.php?f=60, refer to this issue, and I'll pick up the discussion there. If you have bought this recently, and we determine the problem is hw, we can replace the board. You might visually compare the component sides of both boards to see if you see any difference. But the radio components are all inside the module. The antenn...
Well, today I happened to receive a lolin s2 from ebay that happens to have no psram.
Looks exactly the same as the original.
Is it clear it's genuine? Was it advertised as a Lolin S2 mini, or a different model?
its been a while since I did audio code. I think its called to get then next buffer as the previous one is played.
I want to open a serial connection with my QT PY ESP32-S2 so I can debug a core crash. Iโm trying to use a Raspberry Pi. I have the RX and TX pins of the Pi connected to A1 and A0 on the QT PY which are supposed to be U1 TXD and U1 RXD. I have also tried the QT PY pins labeled TX and RX. Iโm unable to connect using Tio. Iโm using the command tio /dev/ttyAMA0. I have the Piโs serial port enabled and the Piโs debugging console disabled. I need the wired serial approach instead of USB because when the QT PY crashes it takes down the USB.
Can anyone help with this error:
Warning, treated as error:
/home/runner/work/circuitpython/circuitpython/.devcontainer/Readme.md:document isn't included in any toctree
How can I fix this?
I'm not sure that the debugging serial output is exposed on any of the pins on that device. I was just debugging a core crash on Feather TFT with same main chip. The debugging output and backtracke came through the pin labled DBG on that device which shows a name of TXD0 on the pinout diagram: https://learn.adafruit.com/assets/109051
the feather also has U1TXD and U1RXD like the QTPY so I think that means neither of those are the debug pin.
I'm not certain though, don't have much experience with QTPY form factor. The pinout here does have them colored purple which is debug, so maybe they are meant to be on those pins afterall? https://learn.adafruit.com/assets/107493
If you have access to a Feather S2 though it's worth trying on that since the debug pin is exposed for certain and labeled.
My crash is specific to the QT PY ESP32-S2. Are you using a 2-wire serial connection for debugging or a JTAG?
when you say "I"m unable to connect", what do you mean?
I used this FTDI cable: https://www.sparkfun.com/products/9717 I only connected ground and RX on the table to the Feather. I would assume other USB to serial converter cables or breakouts would work, but this was what I had on hand.
I tried MTDI and MTDO but they don't work with a serial connection. I suppose they are for a JTAG but I think I would also need MTCK and MTMS which are not exposed. Seems like there should be a way to get a wired serial output other than USB.
are you trying to get DEBUG=1 output or are you trying to write explicitly to a UART?
I was trying to find out if there is a way to enable the ESP debug output to 2 arbitrary pins in mpconfigboard
it is possible in sdkconfig, let me find an example
I'm just trying to get DEBUG=1 output.
look at, say, adafruit_qtpy_esp32_pico/sdkconfig; if you uncomment the stuff it says to uncomment, you can try that. But it was for plain ESP32
<@&356864093652516868> Weekly audio meeting start in about ten minutes! Add your notes to the notes doc if you haven't already but wnt to.
https://docs.google.com/document/d/1teUnR_VtWJ7LLngZ9pD38pyB_qpLpL5NZDVHXbybU1U/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for November 28, 2022 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to pa...
So copy and uncomment the last 15 lines from the pico sdkconfig and append it to the S2 sdkconfig? I assume I need to change the UART_TX_GPIO and UART_RX_GPIO pin numbers? Can I use GPIO40 and 41 which is SCL1 and SDA1 on the STEMMA QT connector?
Thanks for fixing this! Looks like mono in -> stereo will require refactoring since the dma setup code also manages the input buffer that would need to be shared.
yup, you could try that
I wrote a program to check whether pull noblock worked to my understanding. It implements a glitch-free PWM with 16-bit high- and low times.
I'm on an Adafruit MacroPad but this should work on any RP2040 board with board.LED as a GPIO pin.
The LED alternates between "dim" (duty cycle 128 on : 16383 off) and "visibly flashing" (duty cycle 32767:32767)
This is my full code, running on CircuitPython 8 beta with current adafruit_pioasm:
import array
import time
import...
@slender iron do I need to review the lwip changes too or just #7247?
I reviewed the changes since the first time, looks fine for the actual code.
The "ci_changes_per_commit" change is beyond my understanding, so I hope it's right.
Is the pin numbering the same as GPIO so I would just use 40 and 41?
I'm not likely to finish this in the near future. Please feel free to pick up any part(s) of this if you have an interest.
@plucky tulip If you're listening in, you don't need to do anything but hang out. If you're interested in participating by talking, please let us know so we can get you added to the necessary role. If you want to participate text-only, please add your notes to this document. Hug reports are thank-yous to folks, and Status Updates is what you've been up to recently, and what you'll be up to until next week. Here is the document: https://docs.google.com/document/d/1teUnR_VtWJ7LLngZ9pD38pyB_qpLpL5NZDVHXbybU1U/edit?usp=sharing
Ok, thank you ๐
also, lurkers welcome โค๏ธ
You're quite welcome! And welcome to the meeting!
i lurked for like 3 months before the first time i participated. ๐
10K! I bet anne is ecstatic.

lwip stuff should be with the next PR, not this one
aha
๐ some amazing milestones! ๐
Visited @PCB_Africa Gearbox Europlacer to witness the first pieces of the first run of production of Rasberry Pi @Raspberry_Pi Pico in Kenya. And they asked me to help cutting the ribbon. I'm so happy to see these #MadeInKenya @LatiffCherono @KamauFabLab @MikeBuffham @EbenUpton
Likes
235
Cyber Monday today on Adafruit.

thanks. I'm rusty
I randomly noticed that it's possible to get download stats for releases .. so we could also track bundle downloads probably? I wonder if it's worth entering an issue asking for it to be added to adabot, or if that's drowning in feature requests anyway. https://tooomm.github.io/github-release-stats/?username=adafruit&repository=Adafruit_CircuitPython_Bundle
Get the latest release stats like download counts, release dates, author on any GitHub project
We want 100!
approaching that 100 milestone for blinka boards
@turbid radish there's a PR for an additional board, so we should be at 100 soon
Once it passes review that is
should ask about getting an artwork for the milestone
I haven't figured out how to propose a change like that but I've seen the button before because I make all kinds of mistakes
Hi, thanks for adding. It looks like it's not passing the checks because you have some non-standard features:
AI and IoT. We generally try and keep the features narrowed down to a list that several boards share.
this is currently stubbed out:
void common_hal_wifi_monitor_construct(wifi_monitor_obj_t *self, uint8_t channel, size_t queue) {
mp_raise_NotImplementedError(translate("wifi.Monitor not available"));
}
is that what was causing the audio issues? that's awesome. thanks dan!
Got an Adafruit Step Switch but want the LED in a different color? No worries I will show you how.
Adafruit Step Switch: https://www.adafruit.com/product/5499
4-pin 3mm RGB LED: https://www.aliexpress.us/item/2251832580507733.html
Github Project Page: https://github.com/DJDevon3/My_Circuit_Python_Projects/tree/main/Boards/espressif/Adafruit QT...
I don't know!
I could not reproduce the reported issue
@tulip sleet I am not sure if you saw my earlier post about making pre-release build appear as latest on github โ๏ธ
Its methods & properties were incorrectly documented as being directly in 'wifi'
I saw that feature of GitHub but was not sure whether we should do that or not; it depends on who looks on that list (maybe both users of stable and unstable)
@lone axle Thanks for the PR!
Does the NeXT keyboard have a help button?
No. It has a power button but it doesn't work yet (so I do have one feature left to implement I guess)
it's on its own pin, specifically so that it could wake the computer.
i have some code that takes UTC (if it's in unix timestamp) and with a timezone offset in secrets.py will automatically adjust to your local time. not sure if that will be helpful.
brb hot gluing my neopixels, sounds like a great idea
CP drag & drop FTW
This is the LoRa version of the Mailbox Notifier. I'll get the Feather-receiver code up on GitHub soon.
Everyone going back through old issues in git is helpful. I had 2 old ones that should have been closed a while ago. The reminders are helpful!
Yup! Looking to make it compliment circup.
Is this the one from last year or a new rev tekktrik?
It also lets you say "LEDs 12 - 23 are a virtual LED strip of its own"
Same one, now delightfully done and optimized to make by hand
@onyx hinge Can you update the Google Calendar as well? You should have access through your Adafruit email. If not, I can do it.
because the vertical/horizontal use could be treated as a 7-segment display but with pixels.
@idle owl deleting the "CP Weekly - Jeff" from December 26, or is there more than that?
could actually make generating text more efficient? dunno.
Is it clear it's genuine?
It would be safe to assume it is not.
Was it advertised as a Lolin S2 mini, or a different model?
Yes, it was advertised as a Lolin S2 mini, see for yourself, here is the listing.
Here are the photos of what I received:

 and a call from Python to a function for writing the buffer? I'm still working out the architecture for this, and I just realized that the potential problem here is that the user tries to write the buffer and that write is interrupted by the ..._get_buffer() call, such that the audio system thinks the current buffer contains less data than the user has written to it. If this can happen, triple buffering will be necessary to avoid it. (If you're not sure, that's fine. I can always work it out with trial and error, but I would rather not if I can avoid it.)
7101 is probably ready for merge
Marking as ready for review, but requires https://github.com/adafruit/esp-idf/pull/7 to be reviewed & merged first.
@serene token the get_buffer call will be done between VM byte codes and when you call RUN_BACKGROUND_TASKS from C. So, if you are copying to it from C code, you don't need to worry about an interrupt.
it will use the buffer directly if its in the right format for the output
otherwise it'll make its own
Ah, that makes sense. So as long as I make the buffer write a C level method it will be fine. Thanks! Knowing that really helps. I don't think I'll need to triple buffer then, even if it might have to copy the buffer sometimes.
I feel like I'm almost to the point where I can start writing code! I think I'll have a few other questions about CircuitPython development in general, and I might need some help working out the bindings stuff, but I can ask when I get to those.
Anyhow, that really helps. Thank you!
Hi, is there a likely reason that the ESP32-C3-DevKitM-1-N4 isn't on circuitpython.org (but the DevKitC is)?
Or did someone just not get around to PRing the .org repository?
(https://github.com/adafruit/circuitpython/tree/main/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4)
Or did someone just not get around to PRing the .org repository?
I think you're right.
following a question in #help, I was searching for CONFIG_LWIP_MAX_SOCKETS and it looks like it is defined to 8 for all Espressif builds, since the default sdkconfig was changed in https://github.com/adafruit/circuitpython/pull/6181
Am I missing something ?
Should it be changed back (to 4) on S2 or C3 ?
@tulip sleet I also can't see it getting built in Actions - does that only happen once it's on the website?
I can have a go at the website PR
Here is the notes document for next Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1ptMf7fIRq2yolUExcbnVyn5A8O00i6YRinAmMOWrUH8/edit?usp=sharing
I can't get the serial to work for the DEBUG=1 output. I tried a build with GPIO 40, 41 and GPIO 5, 16 (TX, RX). When I connect with Tio I get nothing. Tried reversing TX and RX. Tried different jumper wires. Tried different baud rates. Am I missing something?
@eager vortex is your modified code pushed anywhere?
Unfortunately, its been a while since I worked on the Raspberry Pi bare metal port and it isn't currently a priority. Let me know if you'd like to try and debug it and I'd be happy to give pointers.
You could try it without the COMPUTED_GOTO flag. Looks like that's where its happening: https://github.com/adafruit/circuitpython/blob/main/py/vm.c#L1240
I don't think you should be adding an uncrustify.cfg file. Please remove it from the PR.
The listing even says: "ESP32 S2 Mini WIFI IOT Board ESP32-S2 4MB FLASH 2MB PSRAM For Arduino".
I would rather not add a counterfeit board. If it were clearly marked as a no-PSRAM version, that would be different, but I don't want to encourage these counterfeits that appear to be one thing but are really another. It will be a support headache.
What beta are you using? Please also try the absolute latest build to see if this has been fixed already. Thanks!
This is a BOX Lite board. I fixed the regular BOX, but I don't have a Box Lite to test.
Are you referring to my CircuitPython program that is causing the core crashing or my custom build of CircuitPython?
custom build
No, but I can post them online for you. I have 3 versions. One without any modifications to sdkconfig, one using GPIO 40, 41 for console UART and one using GPIO 5, 16. Do you want all 3?
whichever one you think should work ๐
I'm not gonna test it myself. I just want to double check the changes
Do you want the UF2 file?
no, the source code
I didn't make any changes to the source code except modifying sdkconfig. I just needed a build with DEBUG=1.
I uncommented and copied the last 17 lines from the QT PY ESP32 Pico sdkconfig to the end of the QT PY ESP32-S2 sdkconfig. I tried 40, 41 and 5, 16 for the console UART pins.
my guess is that the pins are being reset by circuitpython
did you do a full rebuild after setting them?
you should still see some rom second stage bootloader output before it stops
full rebuild means a clean and then build
This is my first attempt at building. I just deleted the build-adafruit_qtpy_esp32s2 folder. Then I ran esp-idf/install.sh and then source esp-idf/export.sh and then make BOARD=adafruit_qtpy_esp32s2 DEBUG=1
Should I just use make clean BOARD=adafruit_qtpy_esp32s2 DEBUG=1 ?
the clean can go at the end
Tracking issue for PR #6119.
Currently stalled.
I ran with clean and it looks like it just performed an rm =rf build-adafruit_qtpy_esp32s2. What do I do afterwards?
I'm getting a cmake error. xtensa-esp32s2-elf-gcc is not a full path and was not found in the path
We discussed closing draft issues that are stuck in the CircuitPython meeting on 2022-11-28 in In the Weeds.
Closing for now. Can be reopened. Tracking in issue #7266, which will remain open.
the idf install and export should have set that up I think
I ran export again and now it seems to be building. Thanks!
- Tracking issue for #6979.
I have cookie cutted a repo for PixelMap to live in, it's pushed here: https://github.com/FoamyGuy/Adafruit_CircuitPython_PixelMap I think I finished up everything that I can until the Adafruit repo is created. Once that is created there are a few more steps I can do for RTD then it'll be ready for the webhook setup. @idle owl when you have a sec can you fork this or create Adafruit_CircuitPython_PixelMap under the Adafruit org?
We discussed closing draft issues that are stuck in the CircuitPython meeting on 2022-11-28 in In the Weeds.
Closing for now. Can be reopened. Tracking in issue #7267, which will remain open.
- Tracking issue for #6819. Awaits further work on the board.
We discussed closing draft issues that are stuck in the CircuitPython meeting on 2022-11-28 in In the Weeds.
Closing for now, but feel free to reopen. Tracking in open issue #7268.
I think you need one more case to be backwards compatible. show(None) should still set the display back to the terminal. root_group = None will not.
Closing for now, but feel free to reopen.
We do not fork libraries. The easiest way to do it is for you to transfer the repository to the Adafruit account. It may not let you, though, in which case, transfer it to me, and I'll get it on Adafruit. You can find the "transfer" option in the Settings on the GitHub repo.
@slender iron I closed some draft PR's. The remaining ones are upcoming Adafruit products, recent WaveShare boards waiting for VID/PIDs, and the ESP-IDF 5.0 PR, which I would consider "in active development". The ones I closed I consider "stuck" or dormant.
Ah, thats right I do remember that process now. I do think it didn't let me go directly to Adafruit last time. I'll try to make sure and initiate transfer to you if it doesn't let me.
The rebuilt UF2 loads OK but I'm still not getting any serial output on RX and TX pins which are connected to my Pi's TX and RX pins. I'm using tio /dev/ttyAMA0
What should I see on the serial output?
Thank you!
@eager vortex you should see info about what is booting. did you double check the pin numbering?
to match the qtpy pins
see ports/espressif/supervisor/port.c. it should prevent CONFIG_CONSOLE_UART_TX_GPIO and RX_GPIO from being reset
I'm using the GPIO pin numbering. I tried 40,41 and 5, 16. 5 and 16 should match TX and RX. I'll check out port.c
looks right to me too (at least TX does)
@eager vortex have you just tried busio.UART(board.TX, board.TX) in CircuitPython with baudrate 115200 to check that tio is working with those pins and your USB-to-serial setup?
Great idea. Will try.
Ok, I know we're moving to the .env file, which I don't use for personal projects, but obviously am using for Adafruit projects. Is there ANY way to make it work with " instead of only with ' around the strings? Almost every time I use it, something errors in a really weird way, and I bang my head against it for a while before realising I used " in my .env file. It's beyond frustrating. @slender iron Is this an unchangeable feature of .env files, or was it a choice on our part in our CircuitPython use of it?
console isn't the same thing as idf debug
I get error: ValueError: TX in use
its possible but would add a non-trivial amount of code to do right because it has to handle escape sequences
(iirc)
Sigh.
Why did it change to .env instead of secrets.py, anyway?
@idle owl file an issue. its a good point
Ok, will do. It feels like something we're going to run into.
secrets.py clashes with a native CPython module called secrets
I use a file called keys.py that has the same basic format of the .env file. Series of strings assigned to variables. Surrounded by "" ๐
But I understand. I never liked secrets.py either.
๐
Ohhh....
.env matches how you could do it in CPython too
I assume .env is short for 'envelope'?
it's for environment variables
Oh XD that makes sense too
by the way @slender iron creating and editing .env on mac is doable but a pain that is not beginner friendly, any idea ?
@jaunty juniper my intention was always that ESP32 builds would be loaded and configured through the website
you could use python's dotenv module to edit it
compare right now where you can just copy and edit secrets.py for any current learn guide, like say the weather monitor, and doing it with .env, which is an invisible file by nature
Oh yeah, you can't see dot files by default, can you...
I open command line and do touch .env but that's beyond many folks, I know. I also copy from board to board once I have one, but you have to make it first. Does TextEdit not allow you to save .files?
the Finder let you rename them
Yeah, have to save as a format and then rename
looks like textedit gives a warning but lets you create it
except you have to be really careful to not end with .env.txt or .env.rtf
which you can then rename from BBEdit
I did that
there's also the command-shift-G trick to go to a file by name in the Finder even if invisible (that does tab completion)
but it would be nice not to have to do that too
I forget that it doesn't show hidden files by default. I have them exposed.
I unhide everything, but that's probably not safe for many users
I don't, it's a visual clutter nightmare
... remind me never to show you my files
I don't have a good answer for you
would it break dotenv irreparably if we also accepted something like env or env.txt ?
it wouldn't match https://github.com/theskumar/python-dotenv#python-dotenv
@lone axle Here is your new Adafruit library: https://github.com/adafruit/Adafruit_CircuitPython_PixelMap
TypeError: function expected at most 65535 arguments, got -2 I think I wrote a bug
Thank you!
I was not stating my position well during the meeting, but I was trying to cite https://en.wikipedia.org/wiki/Goodhart's_law and ask whether this method of targeting a low open PR count is good, or just picking any lever available to move a measured value in the right direction. "When a measure becomes a target, it ceases to be a good measure"
I was able to verify the P'
I suppose it would be a little strange to add aliases to CircuitPython: .env --> env.txt or something (alias could be pre-installed with default code.py)
i's UART is working.
I verified the PI's UART is working by connecting to the QT PY using pins A0 and A1 and RX and TX. However, I still don't get any DEBUG=1 output on the GPIO pins I specified in the build.
I'm ok using it as a forcing function to take action on open PRs
Are there any prebuilt firmware available for the QT PY ESP32-S2 with DEBUG=1 and serial UART pins defined?
hmm at least this works in python-dotenv:
>>> import dotenv
>>> dotenv.load_dotenv("env.txt")
True
>>> os.getenv("CIRCUITPY_WEB_API_PASSWORD")
'passw0rd'
yes, and we used to read .txt too
Thought it was txt, couldn't remember
In the build I specified 5 and 16 for TX and RX. I tried testing the Pi's UART using Mu and busio.UART(rx=board.A0, tx=board.A1). It worked. I could not use busio.UART(rx=board.RX, tx=board.TX) because I got an error that they were in use.
oh and .py.py and .txt.txt too ?
A0 is GPIO18 and A1 is GPIO17. RX is GPIO16 and TX is GPIO5.
for qtpy esp32 pico?
For QT PY ESP32-S2
you only really need TX working
Ideally, I would like to GPIO pins 40 and 41 which are SCL1 and SDA1 because they are free for my current project. Yes just TX.
it should be flexible enough to go on one of those pins
Supporting those combos too covers some cases I've seen, like where you have extensions hidden and try to save by typing the full extension and it appends an extension anyway
Altho I'd guess .py.txt or .txt.py are more common
Is the problem that I copied the last 17 lines of sdkconfig for the Pico because the S2 did not have a section for ESP_LOG output?
I don't think it should be a problem
there is an sdkconfig file under the build directory that has the "final" values
gaierror(-2) is raised in the failure case of getaddrinfo. This is compatible with cpython's socket module.
Typical session:
>>> import socketpool
>>> import wifi
>>> socket = socketpool.SocketPool(wifi.radio)
>>> try: socket.getaddrinfo("boo", 0)
... except socket.gaierror as e: ee = e
...
>>> type(ee)
>>> ee.errno == socket.EAI_NONAME
True
>>> ee.strerror
'Name or service not known'
>>> raise ee
Traceback (most recent call last):
File "", line 1, in
File "", li...
For compatibility with 7.x, code can catch OSError and check for e.errno == -2
I am used to macos simply making the extension visible if you re-add it, but yeah I'm not sure how windows does it, I just didn't remember those
Here's the ESP_Console section:
CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_USB_CDC is not set
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
CONFIG_ESP_CONSOLE_NONE is not set
CONFIG_ESP_CONSOLE_UART=y
CONFIG_ESP_CONSOLE_MULTIPLE_UART=y
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set
CONFIG_ESP_CONSOLE_UART_NUM=0
CONFIG_ESP_CONSOLE_UART_TX_GPIO=5
CONFIG_ESP_CONSOLE_UART_RX_GPIO=16
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
The new commit makes show(None) go back to current behavior of showing the terminal. I've updated the tester code in the previous comment with a few additional cases that test and check the show() function.
Currently, all strings assigned to variables in the .env file must be wrapped in single quotes ('). I feel we should add the ability to use double quotes (") as well.
I am consistently creating .env files using double quote (") wrapped strings, because that is what I'm used to with CircuitPython/Python. There are a couple of problems here. One: the code fails with really obtuse errors when the .env file is not formatted properly, which leads to lengthy unnecessary troubleshooting, an...
Hidden files and extensions are handled separately in Windows, so you can't rename something to make it hide, but if you have extensions hidden, I'm pretty sure you have to unhide extensions in file explorer's settings... hard to remember because I haven't changed my Windows settings for that in a while and just have everything unhidden
@slender iron Issue filed. Feel free to further label and milestone it.
@slender iron am I correct that this changed the number of sockets from 4 to 8 on all Espressif builds ? https://github.com/adafruit/circuitpython/pull/6181
thank you!
in ports/espressif/esp-idf-config/sdkconfig.defaults
looks like it would. I don't remember deliberately doing it
but march was a long time ago
@eager vortex sorry, I'm out of ideas. I'd need to try it myself to get it working
Thanks a lot for all your help!
@jaunty juniper I'm confused, that was a deletion from S3, so it would be back to 4 for all?
look into sdkconfig.default it changes from 4 to 8
(the diff for that file is not unfolded by default because it's big)
oh, thanks, the diffs weren't loaded so search didn't find it o_O
yep
CONFIG_LWIP_MAX_SOCKETS was changed (accidentally) to 8 for all Espressif builds in the default sdkconfig #6181
Can it be the cause of potential memory issues, especially on smaller RAM builds ?
Should it be changed back (to 4) on S2 ? Or C3 ?
Some background here (and in the PR). It's slightly more involved than just processor variant... whether there's PSRAM, for example to take the heap. Plus, we now have the capability for reserved espidf memory in PSRAM with CIRCUITPY_RESERVED_PSRAM= in .env.
oh I need to learn about CIRCUITPY_RESERVED_PSRAM
I completely missed CIRCUITPY_RESERVED_PSRAM, do we want to make the max sockets more flexible in that case ? With a higher hard limit and a separate soft limit checked in code that can be changed with an environment variable ?
Congratulations, everyone! Thanks for keeping up with this, @makermelissa!
Looks good to me!
This adds both cpy-MAC.local and circuitpython.local support.
Fixes #7214
This was leftover from when we thought we could get browsers to let us cross domain request to local. However, they block it. So, this isn't needed.
FWIW, I think I skipped double quotes since it has more escape sequences (format spec).
I agree the failure mode isn't clear. I'm not sure where to show an error though because the file is usually parsed outside of user code.
@anecdata How many devices do you have on the network? Are you relying on web workflow to start wifi or are you starting it everytime yourself in code.py?
Typically less than half a dozen CircuitPython devices with web workflow enabled. I don't have any collisions in the lower three octets of the MAC.
Currently on devices where web workflow is enabled, web workflow starts up wifi.
This seems like we'll need to add the mac address to the instance name to make it unique. That may be causing the collision.
The IDF public API doesn't provide a way to read back the "mangled" hostname or instance name unfortunately. That causes the mismatch.
I'll explore more tomorrow. Thanks for the details!
(Motivated in part by #7270 and in part by my own experiences.)
I have been thinking about alternatives to dotenv. I have seen these issues with the current scheme:
- The dotenv syntax is poorly specified and isn't consistent between Javascript, Python, shell, and other implementations.
- To the beginning user, the syntax is unique, different, and idiosyncratic.
- We don't implement the whole syntax anyway.
- The syntax is hard to parse properly, and uses up more code space than a si...
Hi, sorry for the inconveniences, I have made changes on the errors. Please me to add the board again. Thanks
Maybe I am just being too grumpy. But the details of the sh-like syntax for dotenv are not familiar to many, and surprise even experienced people.
There is configparser in CPython, which does something like INI files, but its API requires reading something to parse and then fetching values from the object of parsed values. That is not so convenient.
We could narrow what is allowed in .env files:
- all values must be in double quotes: no bare values, no single quotes. Or allow sin...
I don't think you're being grumpy, I think you're looking out for the interests of users. If you were being grumpy, you'd demand that it match ksh93's parsing of single-quoted strings exactly :rofl: (that's me, I'm that person)
I'd probably call the file settings.txt or cpsettings.txt. I would probably suggest NOT having a bunch of alternative filenames.
It'd be nice if we could avoid creating our own language or our own parser API.
Implementing os.setenv() is probably hard, beca...
toml doesn't have any unquoted string values, but it does have "=" rather than ":" syntax.
If I am correct, for web-workflow to work, the only way is to add a .env config via repl?
Yes, typed values is why I avoided YAML. INI, restricted .env, or TOML are all strings only. Strings only has actually been a problem when people want to specify boolean values. There's no consistent mapping. General primitive-typed config values conflict with environment variables.
toml doesn't have any unquoted string values, but it does have "=" rather than ":" syntax.
Only issue with TOML and INI are the section names, but we could say we ignore section names for now, or just say ...
How about the board acting as an AP and hosting a basic html page to get wifi credentials?
how would you want to get it into AP mode? Maybe a special UF2?
but if you can do that, you can load .env on CIRCUITPY
via the BLE workflow ๐
maybe press boot when the LED blinks green on boot, but that's starting to be a lot of blinks on boot
Since wifi credentials are a key element of this...
Wi-Fi SSIDs can most definitely contain unicode, etc. In fact, an SSID can (in theory) be any bytes, there is no restriction in spec. It is up to the receiver of that SSID to parse it as intended (or not).
Not a special firmware, the default firmware will init AP
I have no need of the wifi workflow if I have USB access. I don't want it to start an AP.
is it safe to have it on by default, requiring to connect at least once to disable it ? Some specialized devices do that, but for a dev board I don't know
For, esp32 and esp32c3
I think that will be a pain. I have dealt with various AP-initiating gadgets recently and it is painful multistep process
Thonny et al via USB serial are the alternative to that,
Thonny actually works pretty well
the trouble with the AP-initiating thing is switching networks on the host. Also, in a classroom or other multi-board situation, identifying the board, preventing malicious access, etc. are issues
That's a fair point.
Hello, I was told a while ago that this is the correct channel to ask questions about developing custom C-Modules for CircuitPython.
My university has currently tasked me with figuring out how one can catch interrupts, using C code, on a GPIO pin and then store a timestamp on when the interrupt has happened. The board we are using is an ESP32 S2.
I already looked through a bunch of modules, like frequencyio, rotaryio, keypad, countio which all seem to program a PCNT unit which modifies a counter who's value can be get / set. This does not use an interrupt handler directly though or at least it seems so. The wifi modules seems to use an event handler and callback, which could be useful, but this also seems to be very specific to the Wifi module.
I probably am missing something here, maybe there exists another fancy module which I could inspect?
Or is it not possible to accomplish this?
ports/espressif/common-hal/psio/Ps2.c uses a falling edge pin interrupt, and even does some time checking as well. That's probably the most straightforward example. Interrupts are also used in PinAlarm.c.
Implementations like keypad don't bother with interrupts because polling gives good enough results despite the latency.
I see. Thank you a lot for the swift response! ๐
Thanks.
There's a bit of weird string handling translating between the different APIs but I didn't succeed in spotting any problems in them.
No testing performed.
I tried to reproduce this in Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit QT Py RP2040 with rp2040 using @todbot's original reproducer script but failed.
To simulate interaction with the CIRCUITPY filesystem I ran a script which writes 16kB of random data and then waits 4 seconds before doing it again. I let it run for dozens of iterations.
When I flashed back to 7.1.0, the reproducer DID work, corrupting CIRCUTIPY.
I suspect that the re-worked auto-reload in 7.2.x prob...
Am looking for a CircuitPython port of the Arduino library https://github.com/4-20ma/ModbusMaster library that will enable half-duplex communication using a MAX485 hardware device
@marsh pike sorry Iโm not around to help. It is early in the morning here. Iโll be around in two hours or so and can follow up on the issue then
Ok, I am not sure that I still will be here, but anyway ping me.
Wikipedia says that the TOML "specification includes a list of supported data types: String, Integer, Float, Boolean, Datetime, Array, and Table."
inifile is extremely ill-defined; there's no standard for quoting or escape sequences. Heck, it's not even universal whether '#' or ';' is the comment character.
I saw a comment on the Discord that it was changed from secrets.py to .env because secrets.py clashes with a CPython module called secrets. And here people are saying it can't go in boot.py because wifi workflow starts before that. But would it be an option to use a different py file in some way? Users already know the syntax, and the parser is implemented already.
I have a question for @gilded cradle and the 100st Blinka board. The last 5 are RP2040 board, so I assume that is when you run the board in MicroPython (rather than CP) but you want to use a CP library. As opposed to a SBC that run Python3 and you want to use a CP library and add Blinka or other with pip.
Is there a place where using blinka with MP is described? Thanks.
Yeah, not all of the boards run linux. For the Pico (with MicroPython), I have a guide here: https://learn.adafruit.com/circuitpython-libraries-on-micropython-using-the-raspberry-pi-pico. There's another way that's covered by a bunch of the other RP2040 boards in this guide: https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico
I was checking https://learn.adafruit.com/circuitpython-on-raspberrypi-linux (linked in the Blog post) but that is mostly Raspberry Pi minded.
Yeah, that was written before the Pico and RP4040 chips came out
That one is heavily Linux oriented.
I've reproduced something similar on the samd51 xplained board from microchip. This is with an old random 7.0 alpha, not current.
The first time, an error occurs constructing the SDCard object:
=== import board
=== import sdioio
=== import storage
===
=== sdcard = sdioio.SDCard(
=== clock=board.SDIO_CLOCK,
=== command=board.SDIO_COMMAND,
=== data=board.SDIO_DATA,
=== frequency=25000000)
===
Traceback (most recent call last):
File "<stdin>", line 8...
Ok and the other learn guide you linked to is to use an RP2040 to have GPIO on a computer that have no GPIO (things you would do in the past with a MCP2221 or a FT232H).
Yeah, Blinka runs on your computer in the one Carter wrote
I think that if it is confusing for someone involved like me, then it might be confusing for someone from outside. ๐
Understandable. Do you think maybe linking to the other guides might be helpful?
So we have 3 kind of Blinka usage:
- On a SBC
- On a MP board
- On any computer running Python with an USB port where you plug an MCP2221 or FT232H or Pico with a special firmware
Or meta guide that link to the 3?
Yeah, that's all I can think of.
Perhaps. However, having a shared page that describes the Blinka types and including that in each guide might make more sense.
Yeah, I don't know very well the templating system in learn guide, but yes you can write a "sub-page" and include it in each.
Yeah, we often times write one page and then "mirror" it into applicable guides (where changing the original content also changes on the mirrored pages). It was before the templates, but is still useful in this type of situation where it doesn't need to be tailored to the specific guide.
I was just thinking more of an overview that covers the flavors of Blinka and links to the main guide of each.
Ok, so in the RP2040 scenario, for the 5 (?) Adafruit board such as QTPy 2040 you would run Raspberry Pi version of MicroPython and then add Blinka...
Which board did you have in mind?
Now the Pico board is very special then... you can use it in scenario (2) and (3) !!!
yeah
Very very interesting...
There are so many possibilites!
I thought maybe you were considering running Blinka on a specific board and were asking specific questions.
Yes, it really is flexible, but also can be touchy at times.
CircuitPython version
adafruit-circuitpython-same54_xplained-en_US-7.1.0.uf2
adafruit-circuitpython-same54_xplained-en_US-7.3.3.uf2
Code/REPL
# no code.py
Behavior
[tio 11:41:26] Connected
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
...
Oh yeah, the MCP2221 and FT232H are more like the 3rd situation you mentioned, but no firmware loading necessary.
Maybe we could think of "feature" or a way to distinguish in the list of board. Maybe "SBC" or "RP2040". Not sure what make sense.
Raspberry Pi (and/or GPIO Zero) had a "remote GPIO" solution using a PiZero as a GPIO extender for??? a PC.
Yeah, I'm not sure. Maybe Linux-based SBC or something like that.
Yeah: (1) Linux based (2) MicroPython based (3) External GPIO
It could maybe even be it's own category like the Processor family is for CP boards.
But Pico is (2) and (3) so it need to be non excluding somehow.
Ok, found an "issue", for those https://circuitpython.org/blinka?sort-by=downloads&manufacturers=Adafruit the installation instruction are linking to downloading CircuitPython...
Right. It could be written like the features, but I was thinking a separate filter area.
Where https://circuitpython.org/blinka/mcp2221/ and https://circuitpython.org/blinka/ft232h/ link to learn guide that explain how to use that board.
Good catch.
Ok, I will create issues, we can discuss there. ๐
Thanks
is there/could there be a mode for generic PC in Blinka ?
I think that the adafruit_GPS library could probably be used with pyserial on any PC if it wasn't for the blinka dependencies in the imports since busio.UART is supposed to be compatible with it
I think there is. I think it's mostly been used for running it in a desktop environment. I believe @lone axle was the one who added/uses it though, so he's more familiar.
I made a layer that makes a Blinka_DisplayIO Display object that outputs into a pygame window instead of a phyiscal display. So I know at least the portions of Blinka that are used for DisplayIO do work under "generic linux" PC.
To use GPS maybe it would need a "generic" implementation for busio.UART that uses pyserial or similar internally but presents the needed API for the driver to use it as though it were busio.UART.
What exactly do we have? GPIO + I2C + SPI + what else? and what do we miss?
I'm not sure. Honestly I've only used it very minimally with actual hardware. I use it a lot more on the PC only as a "displayio emulator" basically
what I wanted to test is simply passing a pyserial.Serial instance and see what happens, when I have time
For linux systems, I don't think we actually use busio for serial. We pretty much just have users straightup use pyserial. There's an issue to wrap it in busio here though: https://github.com/adafruit/Adafruit_Blinka/issues/332
ah thanks ๐
@marsh pike I'm at my desk now.
I tried the given sdkconfig to build my example. But it works, no issue.
can you push your example in a github repo
I'll try and get it breaking today
do you want to try getting circuitpython going?
I can add the logs too
I used the code from https://github.com/espressif/esp-idf/issues/8569#issuecomment-1329315953 and your sdkconfig for ESP32-S3 8R8 chip
@marsh pike I'm building circuitpython for the s3 usb otg board now
will replicate it there first
@marsh pike it still happens: ```
I (6022) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
Try to get spinlock
spinlock is taken
Run esp_ipc_isr_call_and_wait
call IPC_ISR
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40379857
@dhalbert I'm sorry to refloat this issue. I'm getting the same HCI error with CP 7.3.3 and Nina 1.7.4.
"adafruit_airlift/esp32.py", line 193, in start_bluetooth
_bleio.BluetoothError: Timeout waiting for HCI response
I've tried multiple CP versions without success: 6.3.0, 7.1.0, 7.1.1, 7.2.1, 7.2.2, 7.3.3 and 8.0.0-beta.4.
Only with version 7.1.1 (I believe it was the first one after the solution merged) I got a different error:
"adafruit_ble/__init__.py", line 13...
Yes they used the default Pico PID. The problem is that it conflicts in VSCODE plug-in as it's detected to have a different name than the pico with ร pico PID which crashes the vscode plugin (in my opinion, that plug-in could benefit from a refactor to avoid crashing in this instance, it's a bit too strict of a PID check)
I made a graphic that lays out how the I2C address conflict affects the 7-segment display backpacks. Who I should I submit it to to be included in the multiplexer guide as a caveat when working with I2C address conflicting backpacks?
I think the visual reference will also help people conceptualize how the pca948 multiplexer works too. My initial understanding of it was completely wrong. A graphic like this could have really helped.
atmel samd's "sdio" driver only works with non-sdhc cards !? continues investigating
I slightly disagree with closing this, but okay. I had only rarely observed audio causing a corruption of CIRCUITPY.
My main concern for this issue was two-fold:
- Playing audio with audiomixer sometimes crashes the supervisor (but doesn't corrupt CIRCUITPY, as seen in my video above)
- The audio artifacts are disruptive to the point of potentially damaging to downstream audio systems
That one's got me a bit concerned now with my new audio project. That's not good.
How long do you recommend I run your code.py script + my CIRCUITPY writing / reloading code before I conclude that there is no CircuitPython crash or CIRCUITPY corruption happening anymore? 100 reloads? 1000 reloads?
Before this, CircuitPython was unusable on the SAM E54 XPLAINED devkit. After this, I'm able to initialize the following cards successfully:
- Lexar Platinum II 32GB full-sized SD HC card
- unbranded 2GB microSD card
- Kingston 2GB microSD HC card
This is using the built in full sized SD card slot on the devkit.
Before the second change, after any attempt to construct an sdioio.SDCard instance (failed or successful) the pins would remain "in use" and a new instance could not be co...
In my experience (as seen in the above video), simply resetting the board shows the problem immediately.
Iโm stuck trying to debug the core crash. I tried multiple custom builds of CircuitPython using DEBUG=1 but I havenโt been able to collect any data yet because the core crash takes out the USB serial before any data is displayed. Iโve tried to implement a console uart to catch the debug data but I canโt get it working. The QT PY ESP32-S2 does not have a 'Send ESP_LOG output to TX/RX pins' sample in the sdkconfig file so I copied the section from the QT PY ESP32 Pico sdkconfig. I modified ...
Awaiting your test on a Grand Central, but code looks OK.
The -Os vs -O2 could be the lack of a volatile somewhere. Otherwise I'm thinking it represents some other unitialized value bug.
I retested with a BNO055 on Feather ESP32-S3 with the latest build, and it still fails. It works fine on ESP32-S2, and also with bitbangio.I2C(). This may have the same root cause as #6311.
Pushing this forward to 8.x.x because I don't see an upstream fix in sight.
Pushing this forward to 8.x.x because I don't see an upstream fix in sight.
I just tested this on a QTPy RP2040 running CircuitPython 8.0.0-beta.4-55-gd364d1c51, using audiopwmio into audiomixer, and the results are much improved! See attached video. (audiopwmio seemed to be the worse offender, compared to audioio and audiobusio)
There is still the very disruptive audio glitching that happens if the device is hooked to a host OS (presumably as TinyUSB MSD uses up the cycles as CIRCUITPY is mounted). But I have not been able to get it to hard crash ...
Also tested with Grand Central M4, SDIO Breakout, and 2GB non-branded card, with the following code:
import board
import sdioio
import storage
with sdioio.SDCard(
clock=board.SDIO_CLOCK,
command=board.SDIO_COMMAND,
data=board.SDIO_DATA,
frequency=25_000_000) as s:
print(s.count() * 512 / 1000 / 1000)
deep sleep fails on the s3 at the start of app_main before we've done anything
fun fact, running adafruit_gps on my mac with pyserial works. My GPS module does not get a fix inside my office, but that's a different question...
@dhalbert Switching samd51 to -O2 produces a similar problem on GCM4, USB CDC disconnects, CIRCUITPY not accessible, safe mode not working. I'll file a fresh issue about this, but for now I'd like to just switch SAME51 (which is all of 1 board) to match SAMD51, even if -O2 not working feels like a nasty surprise.
Time to take the Mac outside
CircuitPython version
8.0.0-beta.4-50-g4af95f1cb1 (local build) on grand central m4
Code/REPL
no code.py
Behavior
When the Makefile is changed to use -O2 instead of -Os, USB CDC immediately disconnects. Safe mode doesn't help. mass storage doesn't mount.
This is similar to #7277 except on SAMD51; it doesn't show up in default builds because they're using -Os optimization.
Description
No response
Additional information
_No respo...
FYI I just loaded CP 8.0.0-beta.4 on my Xiao ESP32-C3 - much more stable than beta.3 - remaining connected instead of being bombed out both on serial and WebREPL
@ok1rig Did you ever test the Pico W with Pico W CircuitPython on a non-Windows machine?
I was unable to reproduce with a Pico W on a Windows 10 Dell laptop. I wonder if it is peculiar to your particular Pico W. Do you have another one or just the one?
So, we talked about this yesterday with no decent conclusion, as far as I know. I'm doing a guide page on creating your .env file on CIRCUITPY. How are we supposed to tell people to create the file initially? Is this something we're glossing over right now? I can rename it to "Your .env File" and discuss only the contents if that's what we're doing. But I wanted to know if there was a single way to create and access the file that works across all OSs.
I don't want this page to turn into an epic saga about all the ways to do it on each OS.
Unfortunately I think you might need a section per OS...
We couldn't even settle on a decent way to do it on MacOS. I'm not sure what to do with that.
I have to explain something about it because it's necessary for this code to work. But I'm not sure getting into that level of detail is meant for this page.
We might need a shorty guide on that separate eventually.
Computer, delete MacOS. Seriously tho, it does seem like a mess to try to make it concise... Maybe a page per OS so you can skip the irrelevant stuff?
And since there's multiple ways to do it on MacOS, just pick what seems easiest for the guide? More advanced users might know how to do it anyway
I'm not at all sure what would be easiest. I know how I do it, and that would not work for beginners.
Yeah advanced folks won't have an issue.
Is there any tool that could be used to do it easily?
I'm not sure.
Turns out Liz wrote up a page on the contents. I can use that for now. But this needs to be addressed at some point. Somehow.
In rp2040, there are two DMA channels used. First, DMA channel 1 sends a batch of samples, then it triggers (chains to) channel 2. Channel 2, on completion, chains back to channel 1.
The DMA completion signal also sets a bit in the value called "dma->channels_to_load_mask", which is later checked by dma_callback_fun. When bits in this value are set, it copies fresh audio data into one of the buffers.
I think the problem is that the audio DMA comes from RAM, so it can continue while ...
@idle owl can mu create the .env file? or are you concerned about esp32?
Even if Mu creates it, if you have hidden files hidden in Finder, which is the default and safer for beginners anyway, you'll never see the file again. Right?
A tool to make and edit .env for you would definitely be good. Even if there's a version per OS
That's my concern. You create it and can't find it to edit it later.
TextEdit can create it.
I have hidden files exposed, so I'm unsure.
I think its ok to teach hidden files and how to make them visible
I would like to have another name that could be used besides .env. Did you see https://github.com/adafruit/circuitpython/issues/7274
CPython's dotenv file uses it just fine
Neradoc pointed out that they do create a visual mess in Finder. Not everyone is going to be wanting that.
Hidden files I mean.
I also think we need to take a step back and make sure this is what we want to ship in 8.0.0 because we will be stuck with it for a long while.
Yeah, I'd think that people who are doing this sort of stuff will also know not to mess with other files
if we have a choice between "slavish consistency with dotenv" and "actually works better for users, especially new or less experienced users", I know which we should pick.
Ok. Moving on, I don't want to be blocked on this. Thank you for the discussion.
I did not connected to non-win pc. I have another board, but it behaved the same. Boards are from very early pre-order, bottom is shown "0622" (I guess, 6th week of 2022) and then "3.15" which I do not have clue what it could be.
Right now, because of some design decisions in CircuitPython, it's either "really inconvenient" or "maybe actually impossible" to use regular Python code to set the Web Workflow wifi details & the Espressif "reserved PSRAM" details. That's the main driver of adding some kind of new-to-circuitpython file format in 8 for these things; it's a convenient coincidence that it can also be used via os.getenv and/or dotenv.
Thinking about this since I saw the issue filed last night, and given t...
Right now, because of some design decisions in CircuitPython, it's either "really inconvenient" or "maybe actually impossible" to use regular Python code to set the Web Workflow wifi details & the Espressif "reserved PSRAM" details.
In main.c, I think it might be possible to call supervisor_workflow_reset() (which also starts the radio-based workflows) only after boot.py runs. Or the reset could be called with a bool arg that determines whether to actually start the workflows or ju...
Is something like "open REPL in Mu and type these exact commands" not sufficient and/or cross-platform enough to create .env file across all CirPy types?
it's a multi-step process. on most boards, you have to remount the filesystem as r/w in boot.py
not an issue on non-USB boards like ESP32
right, sorry
np ๐
At one point the psram allocation had to happen before circuitpython heap allocation. I'm not sure if that's true now.
Adding -u ld_include_highint_hdl forces the linker to keep the high priority interrupt handler that calls the ipc_isr handler.
The deep sleep is waiting for this interrupt to be handled on core 0 before sleeping from core 1.
Fixes #6090
That is, before any circuitpython heap was ever allocated. I think that's not true anymore, because it's done via a supervisor allocation.
I would be interested in knowing how you figured this out!
@onyx hinge Looking at pushing my slice commit to your PR. First time trying to push to a diff repo like this (so maybe I'm doing it all wrong) but I am trying to push to your fastpixelmap branch and it is failing. Guessing permission issue?
Could be, want to paste the whole message?
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/jepler/circuitpython.git/'
I can also just pull the change out to a comment. It is small enough
yes seems like it's a permissions problem based on that message
foamyguy must have additional permissions compared to you. I could poke around to try and see what's up, but I wouldn't want to change anything. Just sharing the patch via a comment seems like the way to go.
Works for me!
I can't reproduce this, but I'm not sure if I followed the steps as you intended. wifi is set up via wifi workflow.
Adafruit CircuitPython 8.0.0-beta.4-30-g070bb35b07-dirty on 2022-11-28; Adafruit Feather ESP32-S3 Reverse TFT with ESP32S3
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import ssl,wifi,socketpool
=== import adafruit_requests as requests
=== socket = socketpool.SocketPool(wifi.radio)
=== https = requests.Session(socket, ssl.create_default_context())
=== TEXT_UR...
What testing did you perform? Is this change alone sufficient to make protomatter work on such boards?
I haven't tested this.
I have a UM FeatherS3, QT Py S3, and Adafruit Feather S3. Is the devkit S3 specifically needed for this test or would one of the boards I have be ok? Also what version of CP should I test this with?
I installed the latest (unstable) version on my esp32-s3-tft board and tested the deep sleep mode, powered by battery - unsuccessful - the display and the sensors are always on.
DerBroader71 The board definition is for the board that looks like the one on this image. tannewt removed the uncrustify.cfg file.
@lone axle for the fastpixelmap slice changes is it easier for me to pull the changes to a comment or I can send you my source files (3 of them) to merge yourself? I tried to commit with Jeff and we figured this was easiest
I'm good with anything. Whatever is easiest for you. I'll get it merged in later on tonight. Thank you!
Iโll get it set when Iโm home from work later today. Going to to test our the helper class you released too
subject to change, this corresponds to revision B prototype
untested (except for loading on a qt py rp2040 and seeing that it comes up to the repl)
@ladyada
@m1cha1s You were using URL links instead of @ references to tag people. Did you mean to do that? I edited the previous post to change them to @ references.
I approved and merged https://github.com/adafruit/esp-idf/pull/7. Could you change the esp-idf submodule commit to the merge commit for https://github.com/adafruit/esp-idf/pull/7? Thanks.
[adafruit/circuitpython] Pull request review submitted: #7204 return to using python 3\.x for builds
I approved and merged https://github.com/adafruit/esp-idf/pull/7. Could you change the esp-idf submodule commit to the merge commit for https://github.com/adafruit/esp-idf/pull/7? Thanks.
@jepler Did you back out all the French spelling changes? That was the thing I was worried about. If so, I'll approve.
Needs a re-merge from upstream.
@jepler Could you look this over before we merge? Thanks.
@bill88t There are now merge conflicts that need to be resolved.
@jepler I think you have passed this on, but is it meeting with your approval with the current changes?
Tested. espressif and raspberrypi now both handle URLs with FQDN with trailing dot (including mDNS .local/.local.). Thanks!
UPDATE: Waveshare had replied to me but my mail considered it as spam. Here is the email:
Waveshare Support (Waveshare)
Nov 21, 2022, 14:18 GMT+8
Hi,
Sorry for replying late.
We have approved your USB PID application for "RP2040-LCD-1.28"
Vendor ID = 0x2E8A
Product ID = 0x1039
See: https://github.com/raspberrypi/usb-pid
The table will be updated soon
@DJDevon3 You should be able to reproduce this on any of the S3 boards although I've only tested a few.
@jepler You do have to rename the .env file so the web workflow doesn't load. I've tested using both the old secrets file and manually typing the ssid/password into the wifi.radio.connect call on the following. (I can dig out more S3 boards if we need a bigger sample)
Adafruit CircuitPython 8.0.0-beta.4-35-gf637332de-dirty on 2022-11-18; FeatherS3 with ESP32S3
Adafruit CircuitPytho...
Everything I've tried is working as expected. Just ran an adafruit_httpserver on the wifi AP, and connected with a CircuitPython client and got served. I'm going to approve this and defer to one of the core devs to decide to merge. It would be nice to get this out there for more folks to poke at it :-)
I'm seeing something weird today, anybody else feel like a quick check if they can reproduce it? RP2040, recent main plus some irrelevant local changes.
Open the repl. import time then time.sleep(60). If you hit ctrl-c once, it'll sleep a bit more THEN show a KeyboardInterrupt. If you ctrl-c twice, it'll KeyboardInterrupt promptly after the second one.
8.0.0-beta.4-51-g286efc18fc-dirty
still prompt for me on 8.0.0-beta.4-59-g2f5ec1cab
OK, good! it must just be something on my end.
@BeatArnet Shutting down things on the board is up to user code, not CircuitPython's core. You may actually want a sensor on to wake the microcontroller.
According to the examples, this code should work:
Create a an alarm that will trigger 120 seconds from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 120)
# Exit the program, and then deep sleep until the alarm wakes us.
print ("120 seconds full deep sleep")
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
# Does not return, so we never get here.
Built and tested locally.
1259888 bytes used, 308880 bytes free in flash firmware space out of 1568768 bytes (1532.0kB).
69044 bytes used, 193100 bytes free in ram for stack and heap out of 262144 bytes (256.0kB).
One thing I noticed however, these messages pop up whenever a device connects.
DHCPS: client connected: MAC=8a:ab:19:62:52:ad IP=192.168.4.16
The build is not a debug build. I'm pretty sure they should be disabled on regular builds.
shared/netutils/dhcpserver.c:268
Why isn't there 'some' condition? This needs to be silenced in some way..
perhaps
diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c
index a61501c93c..d396a2ba56 100644
--- a/shared/netutils/dhcpserver.c
+++ b/shared/netutils/dhcpserver.c
@@ -265,9 +265,9 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p,
d->lease[yi].expiry = (mp_hal_ticks_ms() + DEFAULT_LEASE_TIME_S * 1000) >> 16;
dhcp_msg.yiaddr[3] = DHCPS_BASE_IP + yi;
opt_write_u8(&opt, DHCP_OPT_MSG_...
I think @makermelissa has a box lite.
@BeatArnet It should shut down the microcontroller (not the display or sensors). What happens on the serial output?
Oh I thought it was a submodule. Thankfully it is not.
Imma test it just in case (w & wo/ debug), and we are good to go.
e.g., the country code as used by cyw43_arch_init_with_country in picow.
Otherwise, the radio may unintentionally use frequencies prohibited by national regulations.
This mostly affects access point mode.
Thanks for working on this! No testing performed.
Is the new comment more useful than the old one?
I filed https://github.com/adafruit/circuitpython/issues/7285 about this as I could not find an existing issue
Currently, CYW43_NETUTILS gates both dhcpd functionality and trace functionality. That's the reason this file has to be included. If the size difference matters this could be changed.
I believe you, but is there an upstream bug about it so we can track the missing functionality?
I'll rebase.
The french translation leaves ล but still changes a smart-quote to a regular quote.
@eager vortex are you around?
For alternative name to .env I would like to suggest dotenvโ (or dotenv.txt` if this is easier for Windows user using notepad) just because that is funny but easy to remember.
root_group = &circuitpython_splash;
Thanks for the update. I suggested a different version that doesn't add an additional function call. It'll need to be moved to other show() functions for the other display classes too.
Just a few ideas:
- Whatever the name/syntax, I would love to see adafruit.io to be updated so that recovering you keys and storing them for CircuitPython is as simple as possible.
- Please also consider to also look at wippersnapper that has it's own configuration file that contain the same things: ssid+password+adafruit.io keys+timezone.
- Maybe wippersnapper should be able to detect and use the same file that CircuitPython is using...
- Also, don't forget the quantity of learn guide ...
Please add doit_ to the start of the board name (its folder) because that is the manufacturer.
Glad they got one! I'd like to wait until the listing is public because I've had other folks get it wrong.
I'm waiting for someone to test this.
We could place the audio buffer fill functions in RAM but that would only help if the samples and any code to generate them were in ram as well.
Here are some random thoughts from me:
.env is the most common way for storing secrets with CPython and containers that I've found. I think matching that has value. I'd target compatibility with CPython's version only so that Blinka examples can use the same code. I'd be ok switching to double quotes only. It was my intention to only handle a subset already since we don't do the substitution stuff.
I wouldn't want to invent our own syntax because then we don't get any existing tooling...
@tannewt Thanks for the valuable advice. Now display and sensors are shut down when in deep sleep. Unfortunately I can not measure the power consumption because my power meter is attached to the USB-cable and as far as I know, deep sleep is only simulated when attached to a USB power.
WipperSnapper uses .json for credential storage. An benefit to having a CircuitPython secrets stored as json is a CircuitPython application could import the json module and the library's developer perform simple validation around the .json file (could be validating the format of a MAC address, enforcing string length for tokens, etc) for their library/application's use-case.
A thing to note would be deciding how CPY will handle memory allocation if this route is taken. If a user, for...
That sdkconfig seems to work for me. Here is my build:
Part of the output is:
I (1380) cpu_start: Pro cpu start user code
I (1380) cpu_start: cpu freq: 240000000
I (1380) cpu_start: Application information:
I (1385) cpu_start: Project name: circuitpython
I (1391) cpu_start: App version: 8.0.0-beta.4-194-g2f5ec1cab-dir
I (1398) cpu_start: Compile time: Nov 30 2022 11:16:1...
I would love to see adafruit.io to be updated so that recovering you keys and storing them for CircuitPython is as simple as possible.
@dglaude Is there a method/technique you've liked so far and have felt is simple?
This is a good discussion but should probably be held in another place.
@tannewt I've changed the name. @dhalbert thx for the fix :).
@BeatArnet CircuitPython should deep sleep if USB data is not connected. The deep sleep is done based on enumeration status, not power. Adafruit carries USB cables with charge/data switches for this reason.
Bug Confirmed
Likely related to 6791 first reported in August and by many others since then.
This is the issue that was discovered to only be present on USB/Serial not wifi workflow.
import ssl
import wifi
import socketpool
import adafruit_requests as requests
from secrets import secrets
wifi.radio.connect(secrets["ssid"], secrets["password"])
socket = socketpool.SocketPool(wifi.radio)
https = requests.Session(soc...
Thanks for working on this! No testing performed.
Ok, I improved upon the old comment.
I am pretty sure there isn't.
But I do not hold the technical knowledge to push such an issue ahead.
I would really prefer someone else more knowledgeable handled this.
However should nobody step up, I will do it.
I would be happy to prototype and pull request a "toml subset" parser in C. It's similar to ideas discussed above.
- the filename is "/settings.toml"
- on any board that supports
os.getenvvia this file,/settings.tomlis created as empty when CIRCUITPY is formatted - the content is assumed to be in UTF-8 encoding
- the supported data types are string and integer
- only basic strings are supported
- integer support to be determined. It may be only integers supported by `strtol...
This seems excellent to me. I didn't realize TOML had a "root table", which makes things simpler.
In the long run we can add os.environ() support, so that these persistent values could be computed in boot.py. But we don't have to do that now. This proposal nicely simplifies explanations of the format, parsing, and file creation on OS's that don't deal with dotfiles well.
Now when DEBUG=1, dhcps should announce connections.
This debugging info is useful and shouldn't be barriered behind the header file.
Testing, and I am done with this pr.
won't this turn the debug messages back on? is that what you intended?
I'm trying to make a "partitions-4MB-no-ota-no-uf2.csv" to make it easier to make DEBUG build, is that correct ?
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
# bootloader.bin,, 0x1000, 32K
# partition table,, 0x8000, 4K
nvs, data, nvs, 0x9000, 20K,
app, app, factory, 0x10000, 2048K,
user_fs, data, fat, 0x210000, 1984K,
When DEBUG=0 the user shouldn't see them.
When DEBUG=1 you probably want them.
It builds (w & wo/ debug) but doesn't work though, and I am not sure why.
Idk how to fix it, and it really doesn't matter.
I will continue testing locally, and follow up with more pr's on picow ap.
As much as this one is concerned, done.
The only board without PSRAM I have is a Feather HUZZAH32 (v1) and it freezes on import _bleio, using the artifacts.
I might try to get a local debug build running later (also trying to make a 4MB-no-ota partition scheme to make it fit).
@anecdata Could you please give me more details of your network setup and what code is running on each device and what device it is? I was able to get the IDF to mangle the instance name but not the hostname.
I might try to get a local debug build running later (also trying to make a 4MB-no-ota partition scheme to make it fit).
It may be easier to turn off large things: CIRCUITPY_ULAB = 0, etc.
Pico W changes assumed that f_write could handle a NULL fourth argument. It can't.
Not sure what all is useful to you... Multiple industrial-strength APs, all with the same SSID(s). Relatively complex home network wired / wifi, but robust. A lot of devices on the network, a bunch of Apple devices, some Raspberry Pi, myriad other things. There are a lot of CircuitPython devices, though only a handful running web workflow (and none anymore doing non-web-workflow mDNS).
Typically I'm using Safari to interact with the web workflow pages, could be something to do with Mac cac...
@tulip sleet want the debugging story?
sure ๐
@lone axle No rush on this but was the adafruit_pixelmap module ready pending _pixelmap release or you still working on it? I did find some issues with individual pixels I can make an issue if you want. Just was not sure if you were done yet
it is pending the _pixelmap release and additional testing. Definitely make an issue if you found something. Thanks for trying it out.
I am seeing the samething as @dhalbert
code.py output: Traceback (most recent call last): File "code.py", line 49, in <module> File "adafruit_airlift/esp32.py", line 186, in start_bluetooth File "adafruit_airlift/esp32.py", line 145, in reset RuntimeError: ESP32 did not respond with a startup message
Folks, I have a question about compiling a CP image. Can I add a frozen module like adafruit_pixelbuf.mpy? It is not listed in the /frozen folder. Ideas ?
Or do I need to download the .py version and link to it in the .mk file?
you can add anything in the frozen directory to then add them to FROZEN_MPY_DIRS, it must be a directory, and it must be python files, they will be converted to MPY
if you want to add it to a PR, it should be a submodule like the other ones
Ah! Looking at the other folders in the frozen dir, they have all this other info in there, so I was not sure if I needed to get all that info for adafruit_pixelbuf
yeah they are git submodules, they all come from their own repositories
Okay, I saw that info on the Learn page for frozen modules. I will add it via GIT then.
but what to you want to do exactly ? adafruit_pixelbuf is builtin
Compiling for the Trinky M0. I already have DotStar compiled into the base.
I did not see that as a built-in, so I dropped it into /lib. And works great. Just trying to save some "disk" space.
@tannewt Thanks for doing that. I guess I'm missing something because I'm still not getting any serial communication. Did you use pins TX and RX (5 & 16)? I tried wiping the Pi just to be sure. Is there any special UART settings? I'm just using:
pi@raspberrypibplus:~ $ tio /dev/ttyAMA0
[tio 17:33:25] tio v1.32
[tio 17:33:25] Press ctrl-t q to quit
[tio 17:33:25] Connected
I should see something on TX when I reboot the QT PY right?
I already dropped a bunch of other built-in modules (USB_MIDI, etc.) to make space.
have you tried CIRCUITPY_PIXELBUF = 1 in mpconfigboard.mk ?
Nope!
if it fits, I think it should be fine
I will try it now ๐
if not, I don't think the python version will fit either
Well well well... I did not know you could include those libraries so easily! I removed the adafruit_pixelbuf.mpy from the /lib and dropped the new binary on the chip and WOW! Works like a charm! And only added 2676 bytes to the build!
Thank you so much @jaunty juniper
Mind blown! Life changed!
The CIRCUITPY_PIXELBUF = 1 enables a C implementation of adafruit_pixelbuf. It is not the same as the Python version of the library. It is faster and smaller, but it does not fit on the smallest boards.
Okay, understood. Seems to have compiled in my Trinket M0 build. But I took a bunch of other stuff out I don't need.
So it is not a compiled .py file then, as such.
Maybe I said that wrong, but I dig it.
right, it's just the same functionality. But we only did that with a few libraries (pixelbuf and busdevice). There's no reason you would have known that. I just wanted to make clear that CIRCUITPY_PIXELBUF = 1 is not including compiled Python code.
C for the win. Thank you so much. This channel has been such a help to me as a newb to compiling my own CP binaries.
@dhalbert ready for hopefully one last review
Looks good! More bytes to use up :)
btw: when I uploaded your firmware I got the following upon boot:
Adafruit CircuitPython 8.0.0-beta.4-59-g2f5ec1cab-dirty on 2022-11-30; Adafruit QT Py ESP32S2 with ESP32S2
Is that the correct version? I also tried doing a factory reset of the QT PY and loading your UF2 again just to be sure.
After merging this, I got an email from weblate:
<h2>Could not merge the repository.</h2>
<p>Weblate could not merge upstream changes while updating the repository.</p>
<pre>Auto-merging locale/nl.po
Auto-merging locale/fr.po
Auto-merging locale/fil.po
CONFLICT (content): Merge conflict in locale/fil.po
Automatic merge failed; fix conflicts and then commit the result.
(1)</pre>
<h2>Typical workflow for fixing merge conflicts</h2>
<ol>
<li>
Co...
@atomic summit The TinyPico D4 build of CP seems to have some memory overrun issues. I haven't been able to reproduce the conditions in a test script only when I'm running larger (1000+ lines) programs. Without a reasonable sized demonstration script I'm not sure if I should open an issue or not. Objects in my programs are being clobbered as they run. There also seems to be a relationship with how much I store on the Flash filesystem but I can't really wrap my head around how that could be.
Hiya. Without an issue, I'm not sure how it can be tracked down. It could be something about the version of the IDF CP is being built against, or maybe some PSRAM IDF settings are not setup properly. There are work arounds required for PSRAM+FLASH on the original ESP32. See if you can find a more manageable repo - or if not, submit your current code that triggers it, if you are able to do so. I don't really see how it can be fixed without an open issue with repo steps.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.4-58-gc8390a791 on 2022-11-30; TinyPICO with ESP32-PICO-D4
Code/REPL
Delete everything from the TinyPico flash and copy the attached PyDOS.py file.
import PyDOS
At the /> prompt type: dir
Behavior
Starting Py-DOS...
Warning wild card length set to: 11
(4071120)/>dir
0 16
<> <>
Traceback (most recent call last):
File "", line 1, in
File "PyDOS.py", line 1208, in
Fil...
I'm using the TinyPICO V2
so, if we make a creator ID for the Circuitpython repo as mentioned in the creationid repo (so people can just pick a creation ID for a one-off board to reduce friction, the CP repo being the reference list of creation IDs), what shall we pick ? 0xDEAD_BEEF ? 0xC001_C0DE ? 0x0531_8008 ?
I got a debug=1 build that does output what is expected up until doing import _bleio in the REPL, after which it prints nothing, it just stops responding.
...doing import _bleio in the REPL, after which it prints nothing, it just stops responding.
@Neradoc, thanks for testing.
It's a bummer that this doesn't work. Our implementation is based on BT-5.0 and the commit that enables BT-5.0 on esp32 (https://github.com/espressif/esp-idf/commit/02636688eb08d3e86dc47aaf49c2ba2f265518f9) isn't in the release/v4.4 branch.
I did a hacky patch of idf's BT Kconfig to enable BT-5.0 on esp32 and was hoping that it works,
I think we shoul...
Strange behaviour: The first time, the code is running, the deep sleep works fine, but from then on the program start immediately after going to deep sleep. A code snippet at the end of the code:
5" warten bis zum tiefen Schlaf gewechselt wird
print ("5 Sekunden bei voller Leistung")
time.sleep(5)
p.value = False # Display und Sensoren ausschalten
Create a an alarm that will trigger 10 seconds from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 4)
#...
I've been doing tests with the following python code, adapted from the zeroconf library examples:
from zeroconf import ServiceBrowser, ServiceListener, Zeroconf
from zeroconf import ZeroconfServiceTypes
class MyListener(ServiceListener):
def update_service(self, zc: Zeroconf, type_: str, name: str) -> None:
info = zc.get_service_info(type_, name)
print(f">>> Service {name} updated")
print(" ", info.server)
def add_service(self, zc: Zeroco...
If you don't do the light sleep first, does it make any difference?
Side comments: you don't need to del all those things. They will be removed anyway. del is not guaranteed to happen right away in any case.
Also, could you paste code with the < > button? You can add py after the first set of triple-backticks to get it to do syntax coloring. I edited your post to do that: you can take a look at the markup by editing to see the raw text and then cancelling.
The other folks' changes look good, no testing performed
For a pixel string N long the range checks were lettings pixels[n] go through (and crash) where pixels[n-1] is the last valid value. Two range checks were inclusive of the top index value.
Other out of bound errors were being caught properly.
I tried it last night quickly and it worked. Was going to do a little more testing tonight if I have the time but seems good to me.
People could still PR to https://github.com/creationid/creators. We could pick a block for one-off assignments. I didn't see a discussion about a creator id for the circuitpython repo.
I know I should open an issue, that's the thing I was proposing here https://github.com/creationid/creators/pull/26#issuecomment-1327914072
i don't have a clever choice. Maybe CCCC for CircuitPython?
I think we want one creator id for circuitpython contributors
and then say the cp repo is the source for creation id numbers