#circuitpython-dev

1 messages ยท Page 18 of 1

manic glacierBOT
#

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).

#

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.

https://github.com/FoamyGuy/circuitpython/blob/ef3398422a88f72cf5863e768f6a5f705d1ffb9e/shared-module/displayio/display_core.c#L168-L173

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...

slender iron
#

@onyx hinge why is the lwip lib in ports/raspberrypi ?

onyx hinge
#

@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.

slender iron
#

instead of top level lib

#

I want to use its defines for shared-bindings ๐Ÿ™‚

onyx hinge
#

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

slender iron
#

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

onyx hinge
#

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

slender iron
#

ya, that could be a problem

#

the other option is to require one of the common-hal headers to include it

onyx hinge
#

is this for macros/enumerated types like SOCKETPOOL_SOCK_DGRAM?

slender iron
#

common_hal_socketpool_socket_setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));

#

so IPPROTO_TCP and TCP_NODELAY

onyx hinge
#

can you just use common_hal_socketpool_socket_settimeout ?

#

or is this "nodelay" different than a timeout of 0?

slender iron
#

its different

#

tcp gloms writes together by default

onyx hinge
#

oh yeah I vaguely know about this thing you're mentioning

slender iron
#

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

manic glacierBOT
#

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 ...
onyx hinge
#

@slender iron are there times that circuitpython code would need to set this flag in order to work properly too?

slender iron
#

maybe? CPython does allow you to set it

onyx hinge
#

micropython doesn't have NODELAY according to a quick full text search

slender iron
#

maybe they skip the constant but still have setsockopt

#

(which we could do)

onyx hinge
#

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

slender iron
#

I had done it with sockopt for esp

onyx hinge
#

I mean I think it may be different for the lwip "no_sys" case

slender iron
#

hrm

#

let me see if it works ๐Ÿ™‚

onyx hinge
#

๐Ÿ‘ the proof of the pudding is in the eating

slender iron
#

and by works, I mean compiles

onyx hinge
#

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.

slender iron
#

ya, that's my guess

onyx hinge
#

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..

slender iron
#

ya, maybe

onyx hinge
#

someone will let us know

slender iron
#

looks like I do need to do nagle directly

slender iron
#

@gilded cradle why does the code editor try to do import .code in the repl?

gilded cradle
#

Where are you referring to?

slender iron
gilded cradle
#

It's probably a bug

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

#

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...

manic glacierBOT
#

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 ...

analog bridge
tulip sleet
#

Np, I think I was waiting for the build to finish and then forgot

manic glacierBOT
brazen hatch
#

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

stuck elbow
#

should I tell you about ctrl+r?

brazen hatch
#

well..
most I do is Ctrl + L

#

I will eventually go implement all the keybinds in ljinux, so I'll learn em

tulip sleet
tulip sleet
brazen hatch
#

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
tulip sleet
#

good point that I can unset the alias making routines

brazen hatch
#

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

tulip sleet
#

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

brazen hatch
#

a .dotfiles repo tldr
we all got one

jaunty juniper
#

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

tulip sleet
#

sounds good too; I often recompile and reload every few minutes, so that was my target use

brazen hatch
jaunty juniper
#

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

brazen hatch
#

gnu screen keystrokes could work

#

you know, starting a detached session with a name, and sending keystrokes to it

jaunty juniper
#

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

manic glacierBOT
brazen hatch
jaunty juniper
#

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

brazen hatch
#

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

jaunty juniper
# jaunty juniper I just build, but per my usual over-engineering nature I have a python script th...

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 
######################################################################
brazen hatch
#

ohh icons

jaunty juniper
#

(it can also give a delta of file size with a green or red flag)

brazen hatch
#

anyways imma go do my linux mpi (Message Passing Interface) essay

#

bb

manic glacierBOT
#

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.

manic glacierBOT
manic glacierBOT
#

@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.

manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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:

  1. Clicking on different locations with the mouse moves the cursor and it's a different variation of the same problem.
  2. 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() and wifi.Radio.start_ap().
  • Use b"" and None where appropriate in those methods, rather than MP_OBJ_NULL, which doesn't have a direct analog.
  • Use bitmask values for wifi.AuthMode ...
crimson ferry
#

@tulip sleet is channel still optional in start_ap? I'm not real savvy on the signatures

tulip sleet
#

Optional[] is short-hand for Union[... | None]

crimson ferry
#

ok thanks, I just wasn't clear on why some have the Optional] tag and some don't

#

ah

tulip sleet
#

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.

manic glacierBOT
#

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?
brazen hatch
#

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 โœ…

serene token
#

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.

brazen hatch
#

coproc's shared mem should be ideal for audio

#

I really need to get to making some modules with it

#

its very good practice

serene token
#

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.

brazen hatch
#

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.

eager vortex
#

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"

serene token
#

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.

slender iron
#

@eager vortex did you do make fetch-submodules at the top level?

eager vortex
#

@slender iron I ran the command in the circuitpython folder.

slender iron
#

please post the full output

eager vortex
#

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.

serene token
#

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.

eager vortex
#

btw: Is the build going to be too large with the DEBUG=1?

tulip sleet
idle owl
#

@tulip sleet Oof, wait, did we fix LC709203 and ESP32-S2? I totally forgot I was using it in this code I have here.

tulip sleet
idle owl
manic glacierBOT
#
  1. 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
idle owl
#

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?

slender iron
#

its usb data

#

so a wall plug should allow deep sleep

#

(but its not really that needed)

idle owl
#

Ok, what about the second thing... ah ok

#

I wasn't sure if there was an issue powering it constantly.

slender iron
#

not that I know of

idle owl
#

Got it.

#

Thanks!

slender iron
#

have a good night!

idle owl
#

You too!

lone sandalBOT
manic glacierBOT
#

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).
manic glacierBOT
#

@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.

manic glacierBOT
manic glacierBOT
#

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 ...

manic glacierBOT
#

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:
...

manic glacierBOT
slender iron
#

@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

onyx hinge
#

@slender iron seems fine to me

slender iron
#

I've added "secondary hostname" support

#

for circuitpython.local

manic glacierBOT
#

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:
``...

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

35975

Roles

36

onyx hinge
#

@slender iron I thought maybe you fixed the trailing dot problem for espressif ๐Ÿ˜‰

slender iron
#

haha, nope

manic glacierBOT
manic glacierBOT
#

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....
manic glacierBOT
#

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...

manic glacierBOT
#

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...

manic glacierBOT
#

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_

...
manic glacierBOT
#

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...

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

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...

orchid basinBOT
brazen hatch
#

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

jaunty juniper
#

yeah tinyuf2 usually doesn't use the PSRAM

brazen hatch
#

I mean, from the quick read I gave it, it doesn't seem to use it at all?

jaunty juniper
#

right

brazen hatch
#

huh even though I disabled psram it doesn't boot.. sus

#

it looks fine though

brazen hatch
#

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
brazen hatch
#

the ram, it's scares me

#

I better port ed, nano ain't for this stuff

manic glacierBOT
#

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.

abstract stump
#

Hello, someone can help me to understand which part of the Keypad library process a key push in background?

abstract stump
manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

35991

Roles

36

eager vortex
# tulip sleet it will tell you if it's too big for the 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?

jaunty juniper
#

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

eager vortex
#

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).

manic glacierBOT
jaunty juniper
#

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

eager vortex
#

Thanks, I will give Tio a try.

#

Will Tio work with USB because I'm using all the GPIO pins except A3?

jaunty juniper
#

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

eager vortex
#

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?

jaunty juniper
#

I think so ? I'm not sure how though, somebody else would have to pitch in

manic glacierBOT
#

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.helper but perhaps we want to create adafruit_pixelmap for it? If anyone has thoughts on this I'm happy for input. I can cookie cut a new library and move the...
lone axle
serene token
#

@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.

Adafruit Learning System

The next step in learning CircuitPython.

blissful pollen
lone axle
#

Nice, thank you for the point in the right direction, I'll poke around some!

serene token
#

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.

blissful pollen
serene token
#

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!

blissful pollen
#

Yeah looking at it I wonder if the idea too was if you have RawSample vs AnotherSample classes maybe...

serene token
#

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.

blissful pollen
#

Glad to help. I know sometimes just talking to someone else helps

serene token
#

Indeed!

serene token
#

@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.)

eager vortex
serene token
#

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.

jaunty juniper
#

not sure what happened to CIRCUITPY_DEBUG_UART_RX/TX ?

#

or if that has anything to do with anything

lone sandalBOT
manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

36006

Roles

36

lone axle
#

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
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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:
...
manic glacierBOT
manic glacierBOT
#

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
>>...
manic glacierBOT
#

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...

manic glacierBOT
#

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 =...
lone sandalBOT
manic glacierBOT
lone axle
#

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.

onyx hinge
#

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

lone axle
#

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.

lone axle
#

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 ๐Ÿ‘ป .

idle owl
#

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.

stuck elbow
#

is that what they call "over the dad updates"?

#

OTD

idle owl
#

Evidently yes.

manic glacierBOT
#

Thanks Dan!

  1. Try 8.0.0-latest beta or even "Absolute Newest".
  2. Is it the case that the "bad" one seems bad when the "good" one is powered off?
  3. 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:

  1. it's Wifi signal related,
  2. board hard restart (button) and turn off-on produce more often success than soft restart,
  3. likely (but not f...
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

36024

Roles

36

manic glacierBOT
#

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...

manic glacierBOT
#

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...
blissful pollen
#

@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

lone axle
blissful pollen
lone axle
manic glacierBOT
#

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...

manic glacierBOT
slender iron
eager vortex
# jaunty juniper not sure what happened to `CIRCUITPY_DEBUG_UART_RX`/`TX` ?

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.

manic glacierBOT
lone axle
#

the feather also has U1TXD and U1RXD like the QTPY so I think that means neither of those are the debug pin.

lone axle
#

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.

eager vortex
tulip sleet
lone axle
#

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.

eager vortex
#

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.

tulip sleet
jaunty juniper
#

I was trying to find out if there is a way to enable the ESP debug output to 2 arbitrary pins in mpconfigboard

tulip sleet
#

it is possible in sdkconfig, let me find an example

eager vortex
#

I'm just trying to get DEBUG=1 output.

tulip sleet
#

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

eager vortex
#

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?

manic glacierBOT
manic glacierBOT
#

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...
onyx hinge
#

@slender iron do I need to review the lwip changes too or just #7247?

manic glacierBOT
eager vortex
idle owl
#

@tulip sleet Looks like we have someone new!

#

Worth doing the pre-meeting runthrough.

manic glacierBOT
idle owl
#

@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

midnight ember
#

also, lurkers welcome โค๏ธ

idle owl
midnight ember
#

i lurked for like 3 months before the first time i participated. ๐Ÿ˜‰

lone axle
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

The Python on Microcontrollers Newsletter exceeded 10,000 subscribers today! Thank you! This newsletter is the place for the latest news involving Python on hardware to include CircuitPython, Microโ€ฆ

midnight ember
#

10K! I bet anne is ecstatic.

lone axle
turbid radish
slender iron
onyx hinge
#

aha

lone axle
#

๐ŸŽ‰ some amazing milestones! ๐Ÿ“Š

onyx hinge
midnight ember
#

Cyber Monday today on Adafruit.

storm minnow
midnight ember
slender iron
#

thanks. I'm rusty

onyx hinge
turbid radish
#

We want 100!

midnight ember
#

approaching that 100 milestone for blinka boards

gilded cradle
#

@turbid radish there's a PR for an additional board, so we should be at 100 soon

#

Once it passes review that is

onyx hinge
#

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

orchid basinBOT
manic glacierBOT
midnight ember
#

is that what was causing the audio issues? that's awesome. thanks dan!

tulip sleet
#

I could not reproduce the reported issue

analog bridge
#

@tulip sleet I am not sure if you saw my earlier post about making pre-release build appear as latest on github โ˜๏ธ

manic glacierBOT
tulip sleet
idle owl
#

@lone axle Thanks for the PR!

midnight ember
#

Does the NeXT keyboard have a help button?

onyx hinge
#

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.

midnight ember
#

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.

onyx hinge
#

brb hot gluing my neopixels, sounds like a great idea

midnight ember
#

CP drag & drop FTW

idle owl
#

This is the LoRa version of the Mailbox Notifier. I'll get the Feather-receiver code up on GitHub soon.

midnight ember
#

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!

proven garnet
#

Yup! Looking to make it compliment circup.

midnight ember
#

Is this the one from last year or a new rev tekktrik?

onyx hinge
#

It also lets you say "LEDs 12 - 23 are a virtual LED strip of its own"

proven garnet
idle owl
#

@onyx hinge Can you update the Google Calendar as well? You should have access through your Adafruit email. If not, I can do it.

midnight ember
#

because the vertical/horizontal use could be treated as a 7-segment display but with pixels.

onyx hinge
#

@idle owl deleting the "CP Weekly - Jeff" from December 26, or is there more than that?

midnight ember
#

could actually make generating text more efficient? dunno.

manic glacierBOT
idle owl
#

But yes, that's what I'm referring to.

analog bridge
#

Majority of the PRs are board related

#

Draft due to no PID/VID

onyx hinge
#

@idle owl OK, check my work?

analog bridge
#

-is:draft

#

this filters out the draft PRs

idle owl
midnight ember
#

the one i had that was going to turn into a draft was a project idea i started on that fizzled out. it's better in my opinion just to have people close them and open a new pr at a later time. drafts shouldn't even exist in my opinion. either they're open and worked on or they should be closed. drafts are just stuff in limbo.

#

i ended up closing my issue than to do a draft because i can always resubmit it as a PR in the future.

plucky tulip
#

That is a fair point, because someone might think that their PR might be "ignored"

lone axle
#

Perhaps way out of left field, not sure if it's worthwhile or not. But if there were a separate fork in github then perhaps stale PRs could be moved to the other fork unless / until they start getting action again?

serene token
# slender iron its been a while since I did audio code. I think its called to get then next buf...

Ok, one more question then: Is it using the buffer directly or copying it?

I think I might end up having to triple buffer it, so that one is playing, one is queued up to play next, and one is open for writing. I hate to do that, due to the extra memory it requires, but it might be necessary. If it's using it directly though, it might work with just two.

Actually, another question: Do you know if there is potential for race conditions between ..._get_buffer() 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.)

crimson ferry
#

7101 is probably ready for merge

manic glacierBOT
analog bridge
#

@slender iron @tulip sleet Github Projects, more advance milestones

#

Thanks!

slender iron
#

@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

serene token
#

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!

wheat siren
tulip sleet
jaunty juniper
#

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 ?

wheat siren
#

@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

tulip sleet
#

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

eager vortex
# tulip sleet yes

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?

slender iron
#

@eager vortex is your modified code pushed anywhere?

manic glacierBOT
eager vortex
slender iron
#

custom build

eager vortex
#

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?

slender iron
#

whichever one you think should work ๐Ÿ™‚

#

I'm not gonna test it myself. I just want to double check the changes

eager vortex
#

Do you want the UF2 file?

slender iron
#

no, the source code

eager vortex
#

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.

slender iron
#

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

eager vortex
#

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

eager vortex
#

Should I just use make clean BOARD=adafruit_qtpy_esp32s2 DEBUG=1 ?

slender iron
#

the clean can go at the end

manic glacierBOT
eager vortex
slender iron
#

make again

#

sdkconfig changes won't rebuild the IDF code automatically

eager vortex
#

I'm getting a cmake error. xtensa-esp32s2-elf-gcc is not a full path and was not found in the path

manic glacierBOT
slender iron
#

the idf install and export should have set that up I think

eager vortex
#

I ran export again and now it seems to be building. Thanks!

manic glacierBOT
lone axle
#

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?

manic glacierBOT
idle owl
tulip sleet
#

@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.

lone axle
#

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.

eager vortex
#

What should I see on the serial output?

slender iron
#

@eager vortex you should see info about what is booting. did you double check the pin numbering?

#

to match the qtpy pins

tulip sleet
#

see ports/espressif/supervisor/port.c. it should prevent CONFIG_CONSOLE_UART_TX_GPIO and RX_GPIO from being reset

eager vortex
#

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

tulip sleet
#

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?

idle owl
#

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?

slender iron
eager vortex
#

I get error: ValueError: TX in use

slender iron
#

(iirc)

idle owl
#

Sigh.

storm minnow
#

Why did it change to .env instead of secrets.py, anyway?

slender iron
#

@idle owl file an issue. its a good point

idle owl
#

Ok, will do. It feels like something we're going to run into.

slender iron
#

secrets.py clashes with a native CPython module called secrets

idle owl
#

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 "" ๐Ÿ˜‰

slender iron
#

๐Ÿ™‚

storm minnow
#

Ohhh....

slender iron
#

.env matches how you could do it in CPython too

storm minnow
#

I assume .env is short for 'envelope'?

jaunty juniper
#

it's for environment variables

storm minnow
#

Oh XD that makes sense too

jaunty juniper
#

by the way @slender iron creating and editing .env on mac is doable but a pain that is not beginner friendly, any idea ?

slender iron
#

@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

jaunty juniper
#

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

storm minnow
#

Oh yeah, you can't see dot files by default, can you...

idle owl
jaunty juniper
#

the Finder let you rename them

storm minnow
#

Yeah, have to save as a format and then rename

jaunty juniper
#

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

storm minnow
#

I did that

jaunty juniper
#

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

idle owl
#

I forget that it doesn't show hidden files by default. I have them exposed.

storm minnow
#

I unhide everything, but that's probably not safe for many users

jaunty juniper
#

I don't, it's a visual clutter nightmare

storm minnow
#

... remind me never to show you my files

slender iron
#

I don't have a good answer for you

jaunty juniper
#

would it break dotenv irreparably if we also accepted something like env or env.txt ?

slender iron
idle owl
onyx hinge
#

TypeError: function expected at most 65535 arguments, got -2 I think I wrote a bug

lone axle
#

Thank you!

onyx hinge
#

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"

crimson ferry
#

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)

eager vortex
#

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.

storm minnow
slender iron
eager vortex
#

Are there any prebuilt firmware available for the QT PY ESP32-S2 with DEBUG=1 and serial UART pins defined?

jaunty juniper
#

hmm at least this works in python-dotenv:

>>> import dotenv
>>> dotenv.load_dotenv("env.txt")
True
>>> os.getenv("CIRCUITPY_WEB_API_PASSWORD")
'passw0rd'
slender iron
#

those are 25 and 26 right?

#

(pins A0 and A1)

slender iron
storm minnow
#

Thought it was txt, couldn't remember

eager vortex
#

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.

jaunty juniper
#

oh and .py.py and .txt.txt too ?

eager vortex
#

A0 is GPIO18 and A1 is GPIO17. RX is GPIO16 and TX is GPIO5.

slender iron
#

for qtpy esp32 pico?

eager vortex
slender iron
#

you only really need TX working

eager vortex
slender iron
#

it should be flexible enough to go on one of those pins

storm minnow
#

Altho I'd guess .py.txt or .txt.py are more common

eager vortex
slender iron
#

I don't think it should be a problem

#

there is an sdkconfig file under the build directory that has the "final" values

manic glacierBOT
#

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...
jaunty juniper
eager vortex
#

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

manic glacierBOT
#

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...

storm minnow
idle owl
# manic glacier

@slender iron Issue filed. Feel free to further label and milestone it.

jaunty juniper
slender iron
#

thank you!

jaunty juniper
#

in ports/espressif/esp-idf-config/sdkconfig.defaults

slender iron
#

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

eager vortex
crimson ferry
#

@jaunty juniper I'm confused, that was a deletion from S3, so it would be back to 4 for all?

jaunty juniper
#

(the diff for that file is not unfolded by default because it's big)

crimson ferry
#

oh, thanks, the diffs weren't loaded so search didn't find it o_O

jaunty juniper
#

yep

manic glacierBOT
manic glacierBOT
jaunty juniper
#

oh I need to learn about CIRCUITPY_RESERVED_PSRAM

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

(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...
orchid basinBOT
manic glacierBOT
#

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...

analog bridge
#

If I am correct, for web-workflow to work, the only way is to add a .env config via repl?

tulip sleet
#

or via USB MSC

#

out of band in some way

manic glacierBOT
#

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 ...

analog bridge
#

How about the board acting as an AP and hosting a basic html page to get wifi credentials?

tulip sleet
#

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

jaunty juniper
#

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

manic glacierBOT
analog bridge
#

Not a special firmware, the default firmware will init AP

tulip sleet
#

I have no need of the wifi workflow if I have USB access. I don't want it to start an AP.

jaunty juniper
#

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

analog bridge
#

For, esp32 and esp32c3

tulip sleet
#

I think that will be a pain. I have dealt with various AP-initiating gadgets recently and it is painful multistep process

tulip sleet
#

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

chilly jay
#

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?

tulip sleet
#

Implementations like keypad don't bother with interrupts because polling gives good enough results despite the latency.

chilly jay
#

I see. Thank you a lot for the swift response! ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
slender iron
#

@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

marsh pike
manic glacierBOT
manic glacierBOT
thorny jay
#

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.

gilded cradle
# thorny jay I have a question for <@478616919721771019> and the 100st Blinka board. The last...

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

Adafruit Learning System

A simple way to get I2C, SPI, GPIO, ADC, PWM, and NeoPixel support on any PC with USB.

thorny jay
gilded cradle
#

Yeah, that was written before the Pico and RP4040 chips came out

#

That one is heavily Linux oriented.

manic glacierBOT
#

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...
thorny jay
gilded cradle
#

Yeah, Blinka runs on your computer in the one Carter wrote

thorny jay
#

I think that if it is confusing for someone involved like me, then it might be confusing for someone from outside. ๐Ÿ™‚

gilded cradle
#

Understandable. Do you think maybe linking to the other guides might be helpful?

thorny jay
#

So we have 3 kind of Blinka usage:

  1. On a SBC
  2. On a MP board
  3. On any computer running Python with an USB port where you plug an MCP2221 or FT232H or Pico with a special firmware
thorny jay
gilded cradle
gilded cradle
thorny jay
#

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.

gilded cradle
#

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.

thorny jay
#

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...

gilded cradle
#

Which board did you have in mind?

thorny jay
#

Now the Pico board is very special then... you can use it in scenario (2) and (3) !!!

gilded cradle
#

yeah

thorny jay
#

Very very interesting...

#

There are so many possibilites!

gilded cradle
#

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.

manic glacierBOT
gilded cradle
#

Oh yeah, the MCP2221 and FT232H are more like the 3rd situation you mentioned, but no firmware loading necessary.

thorny jay
#

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.

gilded cradle
#

Yeah, I'm not sure. Maybe Linux-based SBC or something like that.

thorny jay
#

Yeah: (1) Linux based (2) MicroPython based (3) External GPIO

gilded cradle
#

It could maybe even be it's own category like the Processor family is for CP boards.

thorny jay
#

But Pico is (2) and (3) so it need to be non excluding somehow.

gilded cradle
#

Right. It could be written like the features, but I was thinking a separate filter area.

thorny jay
thorny jay
#

Ok, I will create issues, we can discuss there. ๐Ÿ™‚

gilded cradle
#

Thanks

jaunty juniper
#

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

gilded cradle
lone axle
#

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.

thorny jay
jaunty juniper
lone axle
#

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

jaunty juniper
#

what I wanted to test is simply passing a pyserial.Serial instance and see what happens, when I have time

gilded cradle
# jaunty juniper what I wanted to test is simply passing a pyserial.Serial instance and see what ...

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

GitHub

UART is missing: baudarte in_waiting timeout enter() exit() reset_input_buffer() I don't actually need these on Blinka right now, but because Blinka is used by pylint to check metho...

jaunty juniper
#

ah thanks ๐Ÿ‘

slender iron
#

@marsh pike I'm at my desk now.

marsh pike
slender iron
#

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

marsh pike
slender iron
#

@marsh pike I'm building circuitpython for the s3 usb otg board now

#

will replicate it there first

slender iron
#

@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

manic glacierBOT
#

@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...
manic glacierBOT
midnight ember
#

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.

onyx hinge
#

atmel samd's "sdio" driver only works with non-sdhc cards !? continues investigating

manic glacierBOT
#

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:

  1. Playing audio with audiomixer sometimes crashes the supervisor (but doesn't corrupt CIRCUITPY, as seen in my video above)
  2. The audio artifacts are disruptive to the point of potentially damaging to downstream audio systems
midnight ember
#

That one's got me a bit concerned now with my new audio project. That's not good.

manic glacierBOT
#

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...

#

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 ...

manic glacierBOT
#

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 ...

slender iron
#

deep sleep fails on the s3 at the start of app_main before we've done anything

jaunty juniper
#

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...

manic glacierBOT
manic glacierBOT
#

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...

rugged spindle
#

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

manic glacierBOT
manic glacierBOT
idle owl
#

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.

storm minnow
#

Unfortunately I think you might need a section per OS...

idle owl
#

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.

storm minnow
#

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

idle owl
#

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.

storm minnow
#

Is there any tool that could be used to do it easily?

idle owl
#

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.

manic glacierBOT
#

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 ...

slender iron
#

@idle owl can mu create the .env file? or are you concerned about esp32?

idle owl
storm minnow
#

A tool to make and edit .env for you would definitely be good. Even if there's a version per OS

idle owl
#

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.

slender iron
#

I think its ok to teach hidden files and how to make them visible

tulip sleet
slender iron
#

CPython's dotenv file uses it just fine

idle owl
#

Neradoc pointed out that they do create a visual mess in Finder. Not everyone is going to be wanting that.

#

Hidden files I mean.

onyx hinge
#

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.

slender iron
#

ok, I can't think about this right now

#

I'm deep in s3 debugging

storm minnow
onyx hinge
#

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.

idle owl
#

Ok. Moving on, I don't want to be blocked on this. Thank you for the discussion.

manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...

devout jolt
tulip sleet
#

not an issue on non-USB boards like ESP32

devout jolt
#

right, sorry

tulip sleet
#

np ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
blissful pollen
#

@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?

onyx hinge
blissful pollen
#
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

onyx hinge
#

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.

blissful pollen
#

Works for me!

manic glacierBOT
#

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...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
blissful pollen
#

@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

lone axle
blissful pollen
manic glacierBOT
manic glacierBOT
#

@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...

onyx hinge
#

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.

slender iron
#

my pico w on 8.0.0-beta.4-49-g5ff457776-dirty seems ok

#

I can update it now

onyx hinge
#

8.0.0-beta.4-51-g286efc18fc-dirty

slender iron
#

still prompt for me on 8.0.0-beta.4-59-g2f5ec1cab

onyx hinge
#

OK, good! it must just be something on my end.

manic glacierBOT
#

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.

#

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_...
slender iron
#

@eager vortex are you around?

manic glacierBOT
#

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 ...
manic glacierBOT
#

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...

#

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:

firmware.uf2.zip

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...
#

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...
#

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.getenv via this file, /settings.toml is 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...
jaunty juniper
#

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,
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

slender iron
#

@tulip sleet want the debugging story?

tulip sleet
#

sure ๐Ÿ™‚

blissful pollen
#

@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

lone axle
manic glacierBOT
inner orbit
#

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?

jaunty juniper
#

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

inner orbit
#

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

jaunty juniper
#

yeah they are git submodules, they all come from their own repositories

inner orbit
#

Okay, I saw that info on the Learn page for frozen modules. I will add it via GIT then.

jaunty juniper
#

but what to you want to do exactly ? adafruit_pixelbuf is builtin

inner orbit
#

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.

manic glacierBOT
#

@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?

inner orbit
#

I already dropped a bunch of other built-in modules (USB_MIDI, etc.) to make space.

jaunty juniper
inner orbit
#

Nope!

jaunty juniper
#

if it fits, I think it should be fine

inner orbit
#

I will try it now ๐Ÿ™‚

jaunty juniper
#

if not, I don't think the python version will fit either

inner orbit
#

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!

tulip sleet
inner orbit
#

So it is not a compiled .py file then, as such.

#

Maybe I said that wrong, but I dig it.

tulip sleet
# inner orbit 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.

inner orbit
#

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.

manic glacierBOT
#

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...

wraith crow
#

@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.

atomic summit
# wraith crow <@195765176035835904> The TinyPico D4 build of CP seems to have some memory over...

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.

manic glacierBOT
#

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...

jaunty juniper
#

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 ?

manic glacierBOT
manic glacierBOT
#

...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)
#...

manic glacierBOT
#

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...
manic glacierBOT
#

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.

tulip sleet
tulip sleet
slender iron
#

I think we want one creator id for circuitpython contributors

slender iron
#

and then say the cp repo is the source for creation id numbers