#circuitpython-dev

1 messages Β· Page 70 of 1

manic glacierBOT
onyx hinge
#

Howdy <@&356864093652516868> ! In about 50 minutes it'll be my pleasure to welcome you to our weekly meeting. please add your notes to the document: https://docs.google.com/document/d/1C4XIYb0tcKxlzNpwMI5pGf2OmRlzvSLOz7nbUt_Jo3s/edit?usp=sharing

manic glacierBOT
#

I was thinking that I could add a little "slip" into the UART write so that when it got backed up, it dropped output. I think that might be a better result than turning off the rx interrupts and dropping input data. I'll see if I can work up the idea in a PR so you can see what I'm thinking. If you don't like that option, marking this as a limitation of boards that don't support UART flow control might be the only option :grin:

onyx hinge
#

@lone axle do you anticipate being able to read the library section of the meeting today?

lone axle
manic glacierBOT
manic glacierBOT
onyx hinge
#

in "raw repl" on a Adafruit CircuitPython 9.1.0-beta.3-48-g396aaef964-dirty on 2024-06-28; Adafruit Feather ESP32 V2 with ESP32 I can consistently paste a 103 line 7994-byte string via tio 2.6. In "paste mode", even a 100ms "line delay" (-O100) is not enough. A 1ms "char delay" (-o1) is enough.

#

this is just using a terminal keystroke to paste

wraith crow
#

The "raw repl" mode doesn't echo characters as you're typing/pasting does it? The echo is what has been causing the problem I think

manic glacierBOT
turbid radish
#

☺️

lone axle
turbid radish
onyx hinge
#

justmobilize's:

ignore = ["PLR2004", "UP030"]```
my project (leapseconddata):

select = ["E", "F", "D", "I", "N", "UP", "YTT", "BLE", "B", "FBT", "A", "COM", "C4", "DTZ", "FA", "ISC", "ICN", "PIE", "PYI", "Q", "RET", "SIM", "TID", "TCH", "ARG", "PTH", "C", "R", "W", "FLY", "RUF", "PL"]
ignore = ["D203", "D213", "D400", "D415", "ISC001"]```

spare jacinth
#

i havent used it, but i know the ruff TOMLs support some sort of composition

#

at the very least i saw you can override "default" library-level settings in some subfolder

#

could perhaps leave the pyproject's as is, and add an extra toml with the enable/disable rules

onyx hinge
#

also it's possible to put the settings in their own file, ruff.toml

spare jacinth
#
$ ruff linter
   F Pyflakes
 E/W pycodestyle
 C90 mccabe
   I isort
   N pep8-naming
   D pydocstyle
  UP pyupgrade
 YTT flake8-2020
 ANN flake8-annotations
ASYNC flake8-async
   S flake8-bandit
 BLE flake8-blind-except
 FBT flake8-boolean-trap
   B flake8-bugbear
   A flake8-builtins
 COM flake8-commas
 CPY flake8-copyright
  C4 flake8-comprehensions
 DTZ flake8-datetimez
 T10 flake8-debugger
  DJ flake8-django
  EM flake8-errmsg
 EXE flake8-executable
  FA flake8-future-annotations
 ISC flake8-implicit-str-concat
 ICN flake8-import-conventions
 LOG flake8-logging
   G flake8-logging-format
 INP flake8-no-pep420
 PIE flake8-pie
 T20 flake8-print
 PYI flake8-pyi
  PT flake8-pytest-style
   Q flake8-quotes
 RSE flake8-raise
 RET flake8-return
 SLF flake8-self
SLOT flake8-slots
 SIM flake8-simplify
 TID flake8-tidy-imports
 TCH flake8-type-checking
 INT flake8-gettext
 ARG flake8-unused-arguments
 PTH flake8-use-pathlib
  TD flake8-todos
 FIX flake8-fixme
 ERA eradicate
  PD pandas-vet
 PGH pygrep-hooks
  PL Pylint
 TRY tryceratops
 FLY flynt
 NPY NumPy-specific rules
 AIR Airflow
PERF Perflint
FURB refurb
 RUF Ruff-specific rules
slender iron
wraith crow
#

Thanks for hosting Jeff 😁

candid sun
#

thanks Jeff!

lone axle
#

Thanks for hosting Jeff. Have a great week everyone!

random junco
#

thanks Jeff!

manic glacierBOT
#

In cases like code.circuitpython.org where you have control of the serial transmitter, you can insure the speed is controlled and gain some transmission confidence by confirming that each character transmitted echos back what you sent, before transmitting the next character. In that mode however, you completely negate any speed advantage from the internal uart/Circuitpython buffers.

The Raw Mode is probably a more speed efficient approach, although it adds the slight annoyance of sometime...

onyx hinge
#

so we could just chuck that in ruff.toml I guess

#

# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in select subdirectories.
[lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]```you can also apply different settings by path so we can invoke ruff once, not twice (right now we lint examples differently)
manic glacierBOT
#

that's right, I haven't seen anything like that on debian 12

On Mon, Jul 15, 2024 at 8:54β€―AM Dan Halbert @.***>
wrote:

@asmagill https://github.com/asmagill Could you post the string of
consecutive relevant log entries from dmesg or /var/log/syslog (latter
might have more or less info) when plugging in the board when it works and
when it does not work, so we can compare the two sets of entries?

Do you see this problem even if code.py is not present or very simp...

lone axle
#

A handful of the ruff rules that were output by pylint-to-ruff tool end up outputing these warnings when ruff is run:

warning: Selection `PLC2801` has no effect because preview is not enabled.
warning: Selection `PLE0643` has no effect because preview is not enabled.
warning: Selection `PLE0704` has no effect because preview is not enabled.
warning: Selection `PLE1141` has no effect because preview is not enabled.
warning: Selection `PLR0202` has no effect because preview is not enabled.
warning: Selection `PLR0203` has no effect because preview is not enabled.
...

There are about 20 of them. Would we want to run with "preview" enabled in order to use these? Or if not should we remove them from the config file for now if they will have no effect?

onyx hinge
#

ugh my audio was clippy during the recording. oh well.

lone axle
#

unrelated to ruff, but it looks like perhaps we're going to face this on lots of libraries (I saw it on a different one earlier today):
Error during sphinx build

/home/runner/work/Adafruit_CircuitPython_BME680/Adafruit_CircuitPython_BME680/adafruit_bme680.py:docstring of adafruit_bme680.Adafruit_BME680_I2C:19:'any' reference target not found: board.I2C

The cause as far as I can tell is useage of tick marks surrounding "board.I2C" in a docstring. By changing them to double tick marks it makes it so that the sphinx build can complete successfully.

onyx hinge
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1cvCxFaJT5hIQ4UmzZm6f_betgOKNhtXJrsA4GYdVeQ4/edit?usp=sharing

onyx hinge
lone axle
#

strange, I'll try to look into that.

onyx hinge
#

OK, I can reproduce it locally, doing a bisect

#
commit 798e38e4470cbbc9316f40a9b161a37d9c8c52d4
Author: foamyguy <foamyguy@gmail.com>
Date:   Sun Jun 23 11:14:35 2024 -0500

    enforce min py3.9 for setboard. create init.py in board-stubs

 Makefile                                             | 1 +
 tools/board_stubs/circuitpython_setboard/__init__.py | 4 ++++
 2 files changed, 5 insertions(+)

I suspect the empty board/__init__.py created by touch is being used in lieu of the stuff in shared-bindings

manic glacierBOT
onyx hinge
#

@lone axle thanks for bringing the problem up, I think I may have a solution ^

#

I don't think we have to cut an urgent release to fix this, because the intersphinx is just using the "latest" version, I think

manic glacierBOT
onyx hinge
#

it's nice to be helpful when the rest of my day has consisted of little progress on my own tasks πŸ™‚ happy I could help

kind river
slender iron
kind river
#

That's the plan. UDP is generally preferred for openthread applications and should be easier to implement

kind river
#

Where should I inlude the openthread shared-bindings files?

slender iron
#

what should the module be called?

kind river
#

I'm just calling it openthread

#

It might make sense to have a generic thread module with an openthread implementation but I haven't seen a thread MCU that doesn't support openthread

slender iron
#

openthread is good. thread will conflict with the threading execution model

kind river
#

especially before matter was a thing

kind river
#

should it live in shared bindings or shared modules? it could run on any port with a UART and an external radio but will have port specific init for ones with an internal radio

slender iron
#

the python to c layer is always in shared-bindings

#

the external uart impl could go in shared-module

manic glacierBOT
#

I'm not at home at moment, so it'll be a day or so to gather the logs requested.

As to to boot.py/code.py, mostly I've tested without these files (or the defaults as created after storage.erase_filesystem() -- no boot.py and a simple print statement in code.py).

I did have a thought... the system I do most of my work on has externally powered usb hubs, one to a USB3 port, the other to a USB2 port and these are what I plug devices into 90+% of the time... when I gather the reques...

manic glacierBOT
willow totem
spare jacinth
#

check out latest changes to the code

#

probably introduced something that is not supported on CP8

#

you can install the mpycross locally and test too

willow totem
#

I don't believe it's at the mpy-cross bit, it's only failing there due to failing the bundle script I think, or whatevers in the /tmp/randomName with the syntax error

spare jacinth
#

RuntimeError: ('mpy-cross failed on', '/home/runner/work/Adafruit_CircuitPython_AdafruitIO/Adafruit_CircuitPython_AdafruitIO/adafruit_io/adafruit_io.py')

#

and if you look slightly on top: Checking S3 for https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/linux-amd64/mpy-cross-linux-amd64-8.2.0.static

willow totem
#

my mistake, it's also like 655 of my file not the tmp file

#

doesn't like this syntax self._post(path, {**metadata, "feeds": feeds_and_data})

spare jacinth
#

move the "feeds" before unpacking the dict, might just work

#

otherwise. runnin mpy locally will help identify/fix issues

#

(did for me, at least)

willow totem
#

nah tbf it likes the other order fine

onyx hinge
#
Traceback (most recent call last):
  File "<stdin>", line 1
SyntaxError: invalid syntax
```this is not accepted by circuitpython, though it's valid in python 3.11.
#

(and possibly earlier, 3.11 is the version I have handy)

#
{'feeds': 'whatever'}
```this syntax should work
willow totem
#

is the former invalid too if it has a leading normal keyvalue pair, in circuitpython?

spare jacinth
#

you could also some_dict | {"feeds": "value"} (at least on CPython)

onyx hinge
#

** unpacking within {} dict literals is not supported. I don't think it matters if there's a key-value pair before or after it.

onyx hinge
#

yes vertical bar syntax seems to work in circuitpython ```>>> {'a': 1} | {'b': 2}
{'a': 1, 'b': 2}

willow totem
#

thanks folks, appreciate the schooling

onyx hinge
#

there's no way to know all these things in advance, but it's good to be aware there are Python language constructs not supported in CircuitPython, and then check by running on a device if it's convenient

spare jacinth
#

FYI, if im not mistaken, | (aka dict.__or__) is just an alias for dict.copy + dict.update

#

as in... could have used those manually if __or__ didnt work

willow totem
#

I assume the dict constructor version is doing similar under the hood. Mainly I didn't like the idea of an unnecessary for loop to update all the present keys. Mental note always try on device even if a PITA

spare jacinth
#

if you dont have to leave metadata untouched, could .update on it

#

and use it later

spare jacinth
willow totem
#

I dump an array of dicts into one new field, but yeah similar. I like the metadata.update rather than a copy+update, a good suggestion

spare jacinth
#

beware you can't replace your code with metadata.update

#

it returns None, not the changed dict

#

because it edits inplace

#

thus my "only if you can afford to edit metadata" before

willow totem
#
metadata.update({"feeds": feeds_and_data})
self._post(path, metadata)
spare jacinth
#

metadata.update(feeds=feeds_and_data) might work too

#

but yeah

manic glacierBOT
spare jacinth
onyx hinge
#

@spare jacinth Out of all those things, @contextmanager is the one I miss sometimes.

onyx hinge
#
D (31470) lwip: pbuf_alloced_custom(length=150)
D (31475) lwip: pbuf_free(0x3fff3834)
D (31479) lwip: pbuf_free: deallocating 0x3fff3834
D (31484) lwip: dhcp6_information_request: INFOREQUESTING -> -4
D (31490) lwip: DHCPv6 state: 1 -> 2 (dhcp6_information_request)
D (31496) lwip: dhcp6_information_request(): set request timeout 2000 msecs
    LWIP_DEBUGF(DHCP6_DEBUG | LWIP_DBG_TRACE, ("dhcp6_information_request: making request\n"));
…   err = udp_sendto_if(dhcp6_pcb, p_out, &dhcp6_All_DHCP6_Relay_Agents_and_Servers, DHCP6_SERVER_PORT, netif);
    pbuf_free(p_out);
    LWIP_DEBUGF(DHCP6_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp6_information_request: INFOREQUESTING -> %d\n", (int)err));
```It appears `udp_sendto_if` fails with `ERR_RTE = -4,` but of course there is not yet any ipv6 route when you're doing dhcp6!
slender iron
#

weird!

onyx hinge
#
('FE80::7EDF:A1FF:FE00:518C', 'FD5F:3F5C:FE50:0:7EDF:A1FF:FE00:518C', (nil), (nil), (nil))
```oh hey we're getting somewhere
slender iron
#

πŸŽ‰

manic glacierBOT
#

Ok, yeah, some preliminary tests suggest that the hub is in fact the issue... I remove that and the write-protects almost entirely go away.

While that makes it a much less critical issue, it still leaves open the question of what changed the sensitivity between 8.x and 9.x and is it something that can be addressed or just needs to be documented and worked around?

...before I post logs, should I open this as a new issue?

onyx hinge
#

I can now attempt to connect to a v6 service, but the destination address is incorrect in the transimtted packet.```>>> s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)

s.connect(("fd5f:3f5c:fe50:0:6d9:f5ff:fe1f:ce10", 22))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 119] EINPROGRESS


```D (276442) lwip: IPv6 header:
D (276444) lwip: +-------------------------------+
D (276449) lwip: |  6 |    0  |            0     | (ver, class, flow)
D (276456) lwip: +-------------------------------+
D (276461) lwip: |        24     |    6  |   64  | (plen, nexth, hopl)
D (276468) lwip: +-------------------------------+
D (276473) lwip: |  fd5f |  3f5c |  fe50 |     0 | (src)
D (276478) lwip: |  7edf |  a1ff |  fe00 |  518c |
D (276483) lwip: +-------------------------------+
D (276488) lwip: |  3001 |   600 |   5da |   880 | (dest)
D (276494) lwip: |    26 |  fe3f |  7085 |   23f |
D (276499) lwip: +-------------------------------+
manic glacierBOT
#

...before I post logs, should I open this as a new issue

It's fine to open a new issue, and then close this as being superceded. That way the new thread will be more on point.

If you have a different hub, you might try that so see if it's that particular hub. I had a cheap USB-C to USB-A hub that disconnected frequently, causing all kinds of problems. Also maybe try the "bad" hub on some non-RPi computer.

onyx hinge
#
*** len[0]=28
*** len=28 family=10 port=5632
>>> s.recv_into(buf)
40
>>> bytes(buf)
b'SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u3\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
```OK I actually connected over v6 πŸŽ‰ really this time
#

but DNS messes up once I connect to v6... ```>>> wifi.radio.ipv4_dns
10.0.2.76

wifi.radio.ipv6_addresses
wifi.radio.start_dhcp()
wifi.radio.ipv4_dns
253.95.63.92

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt-patch-1
onyx hinge
#
>>> s.connect(("fd5f:3f5c:fe50::1", 80))
>>> s.send("GET / HTTP/1.0\r\n\r\n")
18
>>> b = bytearray(100)
>>> s.recv_into(b)
100
>>> b
bytearray(b'HTTP/1.0 200 OK\r\nConnection: close\r\nETag: "31e-346-65e90ba6"\r\nLast-Modified: Thu, 07 Mar 2024 00:34:')
>>> s.close()
```you can manually make a request on it, but I think ipv6-address URLS like `http://[fd5f:3f5c:fe50::1]/` are probably not understood by adafruit_requests yet, and it needs to know whether to select `AF_INET` or `AF_INET6`.
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0 on 2024-07-10; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
import time

ble = BLERadio()
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)

while True:
    ble.start_advertising(advertisement)
    whil...
onyx hinge
#

@slender iron ipv6 udp socket works, except the host name is not returned for recvfrom_into. raw ntp test: ```>>> ntp_addr = ("fd5f:3f5c:fe50::20e", 123)

PACKET_SIZE = 48

buf = bytearray(PACKET_SIZE)
with socket.socket(socket.AF_INET6, socket.SOCK_DGRAM) as s:
... s.settimeout(1)
... buf[0] = 0b0010_0011
... s.sendto(buf, ntp_addr)
... print(s.recvfrom_into(buf))
... print(buf)
...
48
(48, ('0.0.0.0', 123))
bytearray(b'$\x01\x03\xeb\x00\x00\x00\x00\x00\x00\x00GGPS\x00\xeaA0h\x07s;\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xeaA0n\xeb4\x82-\xeaA0n\xebAU\xb1')

slender iron
#

@onyx hinge nice! I think I will need the sender address too

#

I need to get back to sending packets today. TLV encoding tests are all green atm.

onyx hinge
#

very cool

manic glacierBOT
#

Fixes #9429

I took this further than I was planning, but these changes do resolve the UART issues when pasting large files into the REPL paste (CTRL-E) mode on ESP32 boards that don't have uart flow control capability.

The first commit simply drops any echo characters when the ESP-IDF indicates the transmit buffer is not available (full?) and does allow the successful paste of large files, howe...

manic glacierBOT
#

As I mentioned in #9433, this paste mode feature is not even available in CPython, and I don't think we necessarily have to accommodate boards like this with poor or no flow control. I think the easiest solution for an end user is to rate-limit the paste externally, for example, by using the inter-character or inter-line delays available in tio. If you use paste mode a lot, you can set up your terminal program to include enough delay.

from tio man page:

      -o, --output-delay <ms...
#

Thanks for thinking about this. I would say:

  • common_hal_busio_uart_write() is used for busio.UART() in general, so adding specialized features like the negative length hack for this very specific case is not the place to do this. Instead, I would create a specialized path for the console UART when it has no flow control available. It is just an accidental convenience that we have been using common_hal_busio_uart_write() for console writes. It would be better to create a specialized...
kind river
#

I'm getting a "CIRCUITPY_OPENTHREAD" is not defined error. Where should that be defined?

#

I added CIRCUITPY_OPENTHREAD = 1 to the Espressif port config which seems to be where the others are defined

spare jacinth
#

makefile != c compiler

#

so you are likely lacking something similar to: ```mk
C_FLAGS += -DCIRCUITPY_OPENTHREAD=$(CIRCUITPY_OPENTHREAD)

#

should be easy to find an equivalent configuration and write that correctly, rather than my assumption/guess

kind river
#

possibly, the only define I can find for wifi is in the port config

manic glacierBOT
spare jacinth
#

not sure what you mean by that

kind river
spare jacinth
#

but sounds like you were just missing the "glue" from makefile to C (or incorrectly assuming they were implicitly/inherently glued by default - they are not)

kind river
#

I'm trying to figure out where it is

spare jacinth
#

search for $(some_other_config)

kind river
#

found it

spare jacinth
#

-DVALUE=ERROR being passed to the compiler is equivalent to having #define VALUE ERROR on each and every compilation unit

ornate breach
#

What’s the likelihood that getting an IMX RT1176 to work would be fairly straightforward going off of the current NXP RT implementation for circuitpython?

tulip sleet
#

making the second core available in some way is more work

manic glacierBOT
kind river
#

I'm thinking of having an openthread.PendingDataset singleton that wraps a dataset and has an openthread.PendingDataset.SetSctive() function that sets the wrapped dataset as active

#

I could allow creation of multiple dataset instances but that seem overly complex

ornate breach
#

Or do you have a list of things that need to be resolved to make it reliable?

shadow vigil
#

dumb question about class inheritance in CircuitPython -- i've got a 3-deep inheritance that the super-classes own attributes, i get an "AttributeError: 'super' object has no attribute -- is this kind of an expected thing due to the limited memory constraints?

#

(i don't like posting bugs/issues for things that are "yeah, we don't do that" type items)

onyx hinge
#

@shadow vigil there are some limitations of super() compared to standard python. the one I remember is super() & properties do not work as standard python. and lots of built in classes do not properly support subclassing. e.g., this from micropython docs. we inherit most of the language differences/limitations from micropython, as we don't do a whole lot of work on the core language implementation. https://docs.micropython.org/en/latest/genrst/core_language.html#calling-super-getter-property-in-subclass-will-return-a-property-object-not-the-value

shadow vigil
#

apparently time for plan b -- once i figure out what plan b is πŸ˜€

sleek relic
#

and .set_prop_name(value)

sleek relic
#

For closer to the functionality in the referenced page try this (raw example, not tested in any way):

class A:
  def __init__():
    self._p = None
  def _set_p(self, value):
    self._p = value
  def _get_p(self):
    return self._p
class AA(A):
  @property
  def p(self):
    return self._get_p()

The non-property methods should still inherit, so that structure should work. No super reference needed unless functionality needs to be overridden.

manic glacierBOT
#

CircuitPython version

adafruit-circuitpython-adafruit_kb2040-en_US-8.2.10.uf2
adafruit-circuitpython-adafruit_kb2040-en_US-9.1.0.uf2

libs:
adafruit-circuitpython-bundle-8.x-mpy-20240716/
adafruit-circuitpython-bundle-9.x-mpy-20240709/

Code/REPL

import board
import usb_hid
import neopixel

import supervisor
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS

US_SAMPLE_TIME = 500
kbd = Keyboa...
shadow vigil
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0 on 2024-07-10; Adafruit Feather ESP32S3 No PSRAM with ESP32S3

Code/REPL

import time
import adafruit_ble
from adafruit_ble.advertising.standard import SolicitServicesAdvertisement
from adafruit_ble_apple_media import AppleMediaService

# PyLint can't find BLERadio for some reason so special case it here.
radio = adafruit_ble.BLERadio()  # pylint: disable=no-member
a = SolicitServicesAdvertisement()
a...
manic glacierBOT
#

To compare two ticks_ms values, you should not use <. Instead, when working with ticks values, use ticks_less, ticks_diff and ticks_add. An implementation suitable to cut&paste is show in the documentation, or you can use the adafruit_ticks library.

The starting point of ticks_ms was chosen so that it would "wrap around" soon after boot, so that users would encounter the problem promptly instead of several days after power-on.

There is more information in the documentation...

slender iron
ornate breach
#

Okay, it’ll be a bit. I actually have to design the hardware first lol.. rt1176 feather 😬

slender iron
#

I started a 1060 feather. that's what I'd work on

lilac scaffold
#

hello! Looking for help: I have a custom PCB with the STM32H743 on it. Having a hard time getting it to boot into CircuitPy drive.
I can pull BOOT0 High and get it into USB/ DFU but touching the NRST pin to GND does not bring up the drive. I'm on Mac.

#

Default BOOT0 is low.

ornate breach
#

Is the H743 supported by circuitpython?

#

Wow look at that, it is. Neat!

slender iron
lilac scaffold
#

I've read that there might be an issue with the bootloader (I got mine from Nucleo) - so I uploaded v7.0. The latest version is 9.0

slender iron
#

which bootloader?

lilac scaffold
slender iron
#

ah, that isn't a bootloader. that is the circuitpython binary

#

yes STMLink will work as a debugger

lilac scaffold
#

oh! Am I uploading the wrong thing to the board? I'm trying to see a CircuitPy drive

slender iron
#

nope, that seems like the right thing

#

it just isn't a bootloader (a bootloader is separate software that facilitates loading other software)

#

tinyuf2 is an example of a bootloader

#

I think your best bet would be to build circuitpython yourself and then use a debugger

lilac scaffold
#

so basically build it on mac, upload using STLink, then debug w STLink?

slender iron
#

yup. once you build it, then you can add blinks into the early code to see if it gets that far

#

you'll also have debug symbols

#

this channel is the best place to get help πŸ™‚

lilac scaffold
#

I came immediately to the right place then. Yay!

onyx hinge
#
>>> import wifi
>>> wifi.radio.ping("1.1.1.1")
0.021
>>> wifi.radio.start_dhcp()
>>> wifi.radio.addresses
('FE80::7EDF:A1FF:FE00:518C', 'FD5F:3F5C:FE50:0:7EDF:A1FF:FE00:518C', '10.0.3.96')
>>> wifi.radio.dns
'FD5F:3F5C:FE50::1'
>>> wifi.radio.ping(_)
0.014
#

@slender iron recvfrom & accept, which return different data when v6 packets are in use, kinda break the C API... cpython 3.11: ```>>> s.recvfrom(len(packet))
(b'$\x01\x03\xeb\x00\x00\x00\x00\x00\x00\x00DGPS\x00\xeaB\x8c\xf0\x07y\x93\x15\x00\x00\x00\x00\x00\x00\x00\x00\xeaB\x8c\xf3\xc7"\xf7l\xeaB\x8c\xf3\xc7-\x86\xae', ('fd5f:3f5c:fe50:0:3ca7:8912:9d4:8360', 123, 0, 0))

#

vs a 2-tuple. ```>>> s.recvfrom(len(packet))
(b'$\x01\x03\xeb\x00\x00\x00\x00\x00\x00\x00DGPS\x00\xeaB\x8d8\x07u\xda\xee\x00\x00\x00\x00\x00\x00\x00\x00\xeaB\x8d;\xe1\xe6\xad]\xeaB\x8d;\xe1\xf5\x1d+', ('10.0.2.74', 123))

#

I can trample all over it, just letting you know.

slender iron
#

np, do what must be done πŸ™‚

manic glacierBOT
#

What works:

  • Getting a v6 address
  • Resolving v6 addresses
  • Connecting to v6 addresses
  • sending to v6 addresses (UDP)
  • Pinging a v6 address

presently you have to start_dhcp to get v6 addresses

Addresses & ping:

>>> import wifi, socketpool
>>> wifi.radio.ping("1.1.1.1")
0.021
>>> wifi.radio.start_dhcp()
>>> wifi.radio.addresses
('FE80::7EDF:A1FF:FE00:518C', 'FD5F:3F5C:FE50:0:7EDF:A1FF:FE00:518C', '10.0.3.96')
>>> wifi.radio.dns
'FD5F:3F5C:FE50::1'
...
shadow vigil
misty garnet
#

the more I've used inheritance, the less I've liked it

shadow vigil
#

it works in languages built for it 😏

sleek relic
shadow vigil
sleek relic
#

Using CPython 3.10.14 and CircuitPython 9.5
Output from your sample code in CPython

Multi-inheritance
static one
middle {'state': 'yah, nope', 'static': 'one'}
upper: {'state': 'yah, nope', 'static': 'one', 'okay': 'cool'}
{'state': 'yah, nope', 'static': 'one', 'okay': 'cool'}

CircuitPython fails with AttributeError.

My Modified code, avoiding use of inherited @property, methods gives the identical result with CPython, and "equivalent" with CircuitPython. Equivalent not identical, because the dictionary elements are being reported in a different order, although the values match. Key reference order is not guaranteed in python for regular dict data type.

Multi-inheritance
static one
middle {'state': 'yah, nope', 'static': 'one'}
upper: {'static': 'one', 'state': 'yah, nope', 'okay': 'cool'}
{'static': 'one', 'state': 'yah, nope', 'okay': 'cool'}
#

My version of the code. The statical properties of MostbasestClass and MiddleThingie are not needed for this sample, but I left them in, in case instances of those classes want to use them.

class MostbasestClass:
    def __init__(self, static_value:str, other_value:str):
        self._static_value = static_value
        self._state_value = other_value

    @property
    def state(self):
        return self._state_value

    @state.setter
    def state(self,value:str):
        self._state_value = value

    def _statical(self)->dict:
        print(f"static {self._static_value}")
        return {
            "state":self._state_value,
            "static":self._static_value
        }

    @property
    def statical(self)->dict:
        return self._statical()

class MiddleThingie(MostbasestClass):
    def __init__(self, static_value:str, other_value:str):
        super().__init__(static_value, other_value)
        self._yadda = "cool"

    def _statical(self)->dict:
        v = super()._statical()
        print(f"middle {v}")
        v["okay"] = self._yadda
        return v

    @property
    def statical(self)->dict:
        return self._statical()

class HereItIs(MiddleThingie,MostbasestClass):
    def __init__(self, static_value:str, other_value:str):
        super().__init__(static_value, other_value)

    @property
    def statical(self)->dict:
        v = self._statical()

        print(f"upper: {v}")
        return v

print("Multi-inheritance")
h = HereItIs("one","two")
h.state = "yah, nope"
print(h.statical)
lilac scaffold
#

HI - I'm building circuitpython and getting an error at make -C mpy-cross, have tried many things.

spare jacinth
#

and error being....?

#

it works for me running the exact same command from the circuitpython folder... you might need some dependency (perhaps from make fetch-all, perhaps some python lib or somthing, idk)

manic glacierBOT
#

Right now in rp2040 audio DMA in audiopwmio always proceeds at a rate set by a DMA timer. I've found these to be not precise enough to synchronize with e.g. the ADC pacing timer. It would be helpful to be able to specify a sample rate by reference to another peripheral, i.e. "use whatever sample rate the ADC pacer is set to." One way this could be done is to define some high sample rates as special-purpose codes, e.g. a sample rate of 0xFFFFFF00 would be interpreted as "use the ADC DREQ...

lilac scaffold
#
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
Cannot determine version.

CircuitPython must be built from a git clone with tags.
If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows:

    make fetch-tags
make: *** [build/genhdr/mpversion.h] Error 1```
tulip sleet
lilac scaffold
#

by top level, do you mean above the circuitpython folder that I cloned into?

tulip sleet
#

in the circuitpython folder. Looks like you are there now

lilac scaffold
#

yes I did

tulip sleet
#

just type that htere

#

and you still get the error?

lilac scaffold
#
git fetch --tags --recurse-submodules=no --shallow-since="2023-02-01" https://github.com/adafruit/circuitpython HEAD
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From https://github.com/adafruit/circuitpython
 * branch                  HEAD       -> FETCH_HEAD```
#

yes I still get the error w mpy

tulip sleet
#

how did you do the clone?

lilac scaffold
#

git clone --recurse-submodules https://github.com/adafruit/circuitpython.git

#

I've re-cloned several times and still get the mpy error. I'm on an M2 mac, but that shouldn't matter right?

tulip sleet
#

what version of macOS are you using?

#

what does git --version say?

lilac scaffold
#

I'm on Ventura, git version 2.45.2

tulip sleet
#

that should be ok

#

are you using a case-sensitive filesystem, btw?

#

not sure that's the problem here, but if not, it may be a problem later

lilac scaffold
#

idk ... how can I check that?

#

(I normally just follow cases)

tulip sleet
lilac scaffold
#

no, I went straight to building it!

tulip sleet
#

please do read the guide, there are many prep steps

lilac scaffold
#

thanks very much!

onyx hinge
#

web workflow via ipv6

lilac scaffold
tulip sleet
#

i did a fresh clone to check and the right tags are there: git tag will show them. So the problem is the mpy-cross compile.

tulip sleet
#

as mentioned in the guide:

If you install the brew version of make, it will be known as gmake.

lilac scaffold
#

YES. I forgot to rename it. OK, will try that! thank you thank you!

#

that worked hurrah!

tulip sleet
#

I would say don't rename, just use gmake as the command name. It will propagate down.

#

anyway, you are on track!

lilac scaffold
#

ok! well, I'm stuck again. I'm trying to build for a chip that Adafruit doesn't use. Its the STM32H743, used on Nucleo

#

I see the chip in /boards.

#
make: *** No targets specified and no makefile found.  Stop.```
tulip sleet
#

did you cd ports/stm ?

lilac scaffold
#

yea

tulip sleet
#

you have to pick a diretory name. the .ld file is not a board name

lilac scaffold
#

so I cd ports/stm/boards and tried nucleo_h743zi_2 also

tulip sleet
#

nucleo_h743zi_2 nucleo_h743zi_2 openmv_h7

#

are the choices

lilac scaffold
#
make: *** No targets specified and no makefile found.  Stop.
sophikravitz@MacBook-Pro-7 boards % make BOARD=openmv_h7      
make: *** No targets specified and no makefile found.  Stop.```
tulip sleet
#

do make fetch-port-submodules first, in ports/stm

#

do gmake not make

#

rename it back

lilac scaffold
#

good looking out, appreciate it

tulip sleet
#

move out of the boards directory

lilac scaffold
#

yup

tulip sleet
#

up one, to ports/stm

lilac scaffold
#

I think h7 is building!

#

cool, it says there's a uf2 for h7. I'll try that first

tulip sleet
#

are you doing your own build to adjust the build?

#

there is no UF2 bootloader for these boards

#

you'll have to use the .bin and the ROM bootloader on the board

lilac scaffold
#

I have a custom board and the bin from Nucleo isn't showing me CircuitPy drive.
I'm able to connect using STLink and also via USB but the board just wont boot into CircuitPy

tulip sleet
lilac scaffold
#

I tried 7.0.0 earlier from this link, I think the latest is 9.0.0

#

Maybe its my hardware then

#

Altho, everything else seems to be ok

tulip sleet
#

do you have a nucleo also to test with?

lilac scaffold
#

no, but I'll get one. I have an open MV here, but it uses the F version of the H chip

slender iron
#

you can add DEBUG=1 to do a debug build with symbols too

austere acorn
lilac scaffold
slender iron
#

yup

austere acorn
#

i wanted to buy that one too, cos i suspect the builds don't work for the h7

lilac scaffold
#

just dropped the 5.1 version from Nucleo and it's not working

#

so maybe there's an issue with the STM32H743 build. Someone on the STM forum thought that there was

#

I have never used Circuit Python 🀷

tulip sleet
#

I think that build was done by a volunteer. We don't sell a board with that chip, so it's not high priority.

austere acorn
#

The stm line of chips definitely needs more love in circuitpython πŸ˜†

lilac scaffold
#

I'm going to try the H7 on the open MV now

#

Do you know if it's ok to download it over USB?

tulip sleet
#

you need to use the dfu loader, I assume.

#

MicroPython has STM32 support, and it was originally for STM chips, so it may have better support. We won't feel bad if you go that direction πŸ™‚

lilac scaffold
#

lol ok.

#

Hey all - really appreciate the help here. I learned something!

austere acorn
kind river
#

9 doesn't work on my Nucleo H743ZI

austere acorn
shadow vigil
kind river
austere acorn
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit Hallowing M4 Express with samd51j19

Code/REPL

# SPDX-FileCopyrightText: 2019 Carter Nelson for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import board
import displayio

display = board.DISPLAY

# Setup the file as the bitmap data source
bitmap = displayio.OnDiskBitmap("/purple.bmp")

# Create a TileGrid to hold the bitmap
tile_grid = displayio.TileGrid(bitmap,...
lilac scaffold
slender iron
lilac scaffold
#

btw the STM32H743 doesn't connect on Micropython either.
Maybe it's my hardware, I forgot a pullup on DP and soldered it on by hand. If hw is the issue, I'm not sure why it connects on dfu tho.

slender iron
#

dfu over usb should indicate usb is ok

#

although maybe that runs as usb full speed (can it do high speed otherwise?)

lilac scaffold
#

I don't know. The only thing I've been able to verify without code is the power and dfu.

slender iron
#

stlink can definitely help

#

because it can tell you where the cpu is

lilac scaffold
#

I have a stlink πŸ™‚ can you point me to docu on this?

slender iron
#

and gives you another way to load code besides dfu

lilac scaffold
#

yes, but only code in C/C++ right?

slender iron
#

ya, some native code

#

it should help you get circuitpython going though

#

I've not used stlink myself

lilac scaffold
#

cool, I'll give it a shot.
Still, if micropython isn't working either...

slender iron
#

I'd expect micropython st support to be working

lilac scaffold
#

the issue is the hw- I thought that CP communicates over DP and DM. 😭

onyx hinge
#

@slender iron can you briefly review why IP address objects were useful e.g., with ping? in veesix I did NOT add an IPV6Address object, and I made ping able to take an IPv4/IPv6 string (or actually anything resolvable with getaddrinfo).. I want to make sure this is OK.

plucky tulip
#

Hi, is there maybe someone who owns Adafruit MEMENTO and would be able to help me test some code?
I do not have one myself, and I would like to make sure that the example I want to create for adafruit_httpserver works before creating a PR.

If anyone would be able to help, please DM me. πŸ™‚

manic glacierBOT
#

This PR contains part of the changes necessary to implement the processing of live sampled audio as described in https://github.com/adafruit/circuitpython/issues/2676. Here analogbufio.BufferedIn is modified to add a loop keyword argument to BufferedIn.readinto(). If called without the keyword or with loop=False, behavior is identical to the current readinto(). If called with loop=True, readinto() sets up chained DMA which continuously writes ADC values into the buffer.

Th...

manic glacierBOT
#

Might be related - I’m using Xiao ESP32-C3 and using busio.UART to read modbus data from SDM630 energy meter… after about two days it crashes with hard fault and goes into safe mode. I have the same code (wifi, mqtt, some other logic) except uart running for months on different device without issues. My uart class is very simple - does a write, then waits for 0.1s and does a read. Works for two days, then crashes… happens very consistently.

willow totem
#

What time zone you on?

plucky tulip
#

Over weekend would be great.

willow totem
#

foamyguy / others: Apologies I've probably asked this before, but is there anything I should be aware of when doing release notes or even releases in general for circuitpython libraries? Just going to push out some changes for Adafruit IO circuitpython library. I'd probably just use auto generate notes and then tweak unless told otherwise.

plucky tulip
willow totem
#

To be honest no plans yet, most likely I'll be online around when the deep dive stream happens and Tim's Saturday stream at about 4 I'm often around

plucky tulip
#

Great, I will prepare everything before then. Thanks

tulip sleet
manic glacierBOT
#

I dug out my SD card breakout and did some 4-wire testing and it seems to work fine as well. Not surprisingly the 4-wire connections had the same deinit and ctrl-D resetting issue but the deinit is probably pretty easily solved by lifting the changes that Dan referenced. If I have some time, I'll take a look at the board never-reset logic and see if I can make any headway on the ctrl-D not cleaning up the SDIO pins.

There was one additional issue related to the deinit problem that I notice...

willow totem
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0 on 2024-07-10; Teensy 4.0 with IMXRT1062DVJ6A

Code/REPL

import audiobusio
import audiocore
import board
import array
import time
import math


# Generate one period of sine wave.
length = 8000 // 440
sine_wave = array.array("H", [0] * length)
for i in range(length):
    sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)

sine_wave = audiocore.RawSample(sine_wave, samp...
onyx hinge
#

OK so an IPv6Address object might be useful as a way for the Python program to interact with the byte-wise data in an ipv6 address...

manic glacierBOT
#

D21 is GPIO_AD_B1_11 and is muxed to RX_BCLK. Our current I2SOut assume it connects to TX_BCLK. I'm not sure how to use RX_BCLK when transmitting. GPIO_AD_B1_14 is TX_BCLK and D26 on the teensy4.0.

You can cross reference the pin mux info with the board pin mapping:
https://github.com/adafruit/circuitpython/blob/2f626121867efa429b7484fa3ca5a315021cc506/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c#L219-L265
https://github.com/adafruit/circuitpython/blob/2f626121867efa42...

onyx hinge
#

@slender iron should I have start_dhcp_client_v6 and start_dhcp_client_v4? with the existing start_dhcp_client .. starting both? and both starting by default when bringing up the interface?

slender iron
#

maybe start_dhcp_client with two kwargs that default to true?

onyx hinge
#

OK, sure

#

and same for stop

slender iron
#

sure

onyx hinge
#

thanks!

digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,141

Roles

38

Category Channels

8

Text Channels

64

Voice Channels

7

Threads

18

Boost Count

22 Boosts (Tier 3)

manic glacierBOT
#

Problem found by @Erland in discord, while testing against a commercial device under development.

A simple BLE UART (NUS) service central could not receive notifications from another device.

I was able to reproduce this using an nRF52840 acting as a NUS central and an ESP32-S3 acting as a NUS peripheral. nRF52840 to nRF52840 worked OK.

Test programs:

central

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
f...
#
  • Fixes #9440.

See #9440 for test programs.

Debugged by looking at packet traces with nRF sniffer and printing out SD BLE events. The symptoms were that the connection and discovery seemed fine, but the notification events, BLE_GATTC_EVT_HVX, never arrived at the event handler in Characteristic.c. After a few seconds the connection was broken.

MTU negotiation seemed fine, but someone reported something slightly similar in Nordic DevZone, and the suggested problem was that some n...

manic glacierBOT
kind river
#

I am having issues with ```#

OpenThread

CONFIG_OPENTHREAD_ENABLED=y

end of OpenThread```

not being copied from sdkconfig.defaults to the generated esp-idf config. I"ve tried running make clean and deleting the build directory

kind river
#

make menuconfig has no openthread options despite the openthread component existing in the esp-idf source folder

willow totem
#

Great, I will prepare everything before

onyx hinge
tulip sleet
onyx hinge
#

I guess I don't know. I just recall that some simple operations would work but bigger operations would hang for no clear reason.

#

I don't know which MCU tim was testing with, either

tulip sleet
#

i have other known problems to debug now too πŸ™‚ , so I can look at those

manic glacierBOT
kind river
tulip sleet
kind river
tulip sleet
stuck elbow
stuck elbow
#

fixed

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0 on 2024-07-10; Adafruit PyPortal Titano with samd51j20

Code/REPL

any

Behavior

none

Description

No response

Additional information

Based on someone having an issue in Discord with their PyBadge board, I also tested on my PyGamer, and PyPortal Titano, and they all have the same behaviour.
The screen is completely black as soon as CP 9.1.0 is installed.
There is no visible splash s...

tulip sleet
lone axle
manic glacierBOT
onyx hinge
#

"removed definition of board_display_obj" is a pygamer-specific change after 9.1.0-beta.3

#

but that removal looks so sensible

lone axle
#

I noticed an issue other the weekend for a DisplayIO Driver Library (SSD1322) that wasn't updated for the newer displayio API changes where displayio.Display became busdisplay.BusDisplay

I checked the rest of the bundle and found there are 4 such drivers in need of updates still and a small handful of helper libraries that need docstrings and/or type annotation updated but should function AFAIK.

Looking into that this morning I've found we have 8.x / 9.x compatibility code in a number of the other display driver libraries i.e. https://github.com/adafruit/Adafruit_CircuitPython_SSD1325/blob/main/adafruit_ssd1325.py#L33

Is it okay to go ahead and remove that compatibility fallback and just update to the newer code? If so I can submit PRs today for that change along with the fix for the ones using the old version only.

onyx hinge
#

I think 8.x is still "in the bundle" so probably not yet.

#

@lone axle thanks for the sleuthing about the pyportal/pygamer display problem. do you want to continue by "bisect"ing or is that as far as you go?

lone axle
manic glacierBOT
#

With regard to my issue:
The pico was connected directly to the Dell 490 - I tried both front and rear USB ports.
I have also tried the Pico on a Dell 6400 Inspiron laptop - similar set up to the above Dell 490 (Win 10 Pro 22H2 x64, Raspberry Pi Desktop VM running under VMware 12.5.x Player).
In all cases the Pico mounts (in the Raspberry Pi Debian 11 VM) as ReadOnly.

lone sandalBOT
onyx hinge
#
>>> wifi.radio.ping("ipv6.google.com")
0.048
>>> wifi.radio.addresses
('FE80::7EDF:A1FF:FE00:518C', '2001:470:3996:0:7EDF:A1FF:FE00:518C', '2001:470:7C:285:7EDF:A1FF:FE00:518C', '10.0.3.96')
#

I forget who reminded me of the existence of ipv6 tunnels so that I could test this

#

but hug report to you

manic glacierBOT
slender iron
#

@kind river did you add it to the CP CMakeLists file?

orchid basinBOT
slender iron
manic glacierBOT
onyx hinge
#

huh v6 support might only cost around 32kB, possibly actually feasible to add to pico w if it's that small.

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 9.1.x
tulip sleet
#

**to all folks making PRs: **I just created branch 9.1.x on adafruit/circuitpython. If you are submitting a bugfix PR, do it against 9.1.x. New features can go against main.

tulip sleet
slender iron
#

πŸ‘ thanks!

onyx hinge
#

fan noise seems fine, did hear the sirens though

lone axle
#

Full title: Connecting Old to New with CircuitPython: Retrocomputer input devices on modern PCs

Presented by:
Jeff Epler

The input devices of decades past hold nostalgic value for many folks. But they don't need to merely sit on a shelf as museum objectsβ€”they can be reverse engineered and then adapted to modern computers without modifying the ...

β–Ά Play video
onyx hinge
#

😊

random junco
#

I've been playing around with ViperIDE this weekend, it's pretty neat

manic glacierBOT
#

Just adding this here in case anyone stumbles over this issue like I did:

My SAM E54 Xplained Pro (ordered July 2024, SST26VF064B QSPI flash chip dates to sometime in 2021 so I guess this issue has been around for some time already) has the same issue as @tomiahola described. The issue can be observed for all CircuitPython builds that include the above commit from #8054.
No response from the board, neither CIRCUITPY or USB Drive appears, and no COM port is detected.
Previous builds of C...

lone axle
#

Pypi is optional

#

When you run cookie cutter it will ask you yes or no if you want to deploy to pypi

dense glacier
lone axle
#

Thanks for hosting Scott. Have a great week everyone.

slender iron
#

np!

slender iron
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1B3UNUMkUamVZ9-aSAbCf8csy48K5ER-eUjna9yU6Arc/edit?usp=sharing

manic glacierBOT
#

It does not come back in safe mode. It looks like this:

[15:58:35.446] tio v2.7
[15:58:35.446] Press ctrl-t q to quit
[15:58:35.446] Warning: Could not open tty device (No such file or directory)
[15:58:35.446] Waiting for tty device..
[15:58:43.551] Connected
    [***typed ctrl-C***]
Traceback (most recent call last):
  File "code.py", line 17, in <module>
KeyboardInterrupt: 

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPyth...
slender iron
#

@lone axle I think it is too early to switch to the split displayio layout in libraries. Blinka displayio tries to support it but isn't quite right

#

BusDisplay needs to be updated to import BusDisplay as Display

manic glacierBOT
lone axle
#

Or just leave it as-is for now, but I think if we don't make a change anywhere then those 4 display drivers are un-usable in some contexts, Blinka_DisplayIO I think, but still work in the core perhaps.

A user reporting not being able to use one of those display drivers here https://github.com/adafruit/Adafruit_CircuitPython_SSD1322/issues/21 which is what led me down this path. I'm happy to do whatever remediation is best at this time.

slender iron
#

I think fixing blink_displayio would be my preference. that will make it match CP 9

kind river
slender iron
#

did that fix menuconfig? to fix headers you will need to edit the Makefile where it has -isystem paths

#

(we don't use cmake for the CP side of the build)

#

@onyx hinge do you have avahi working but not .local lookup in your browser?

onyx hinge
#

@slender iron I don't really know what the deal is. Trying to use .local has never worked reliably for me, so I mostly don't even try anymore. /shrug

slender iron
orchid basinBOT
slender iron
onyx hinge
#

looking, thanks

slender iron
#

I'll review your ipv6 changes next

kind river
slender iron
#

what is the full error?

#

(which file is failing to see the header?)

kind river
#

shared-bindings/openthread/PendingDataset.h

manic glacierBOT
#

CircuitPython provides this at exception.print_exception(), with improved compatibility with standard Python.

This is an alternative to #9472, which adds documentation for the non-standard function.

One reason NOT to take this change is that the traceback module is not built on samd21s, leaving non-standard sys.print_exception as the only way to print an exception object (besides raising it)

slender iron
manic glacierBOT
onyx hinge
#

@slender iron maybe you can decide whether to delete or document, I created a PR #9446 to duel with #9427 πŸ˜•

slender iron
#

k, let me finish your review

manic glacierBOT
kind river
#

The actual openthread libs were in openthread/openthread/include. Now I'm getting error: 'mbedtls_ssl_set_hs_ecjpake_password' was not declared in this scope

slender iron
#

that may be behind a setting

lone axle
#

Does anyone know if it's possible or how to specify requirements for a cookiecutter template?

In one of our cookiecutter hooks we use pkg_resources for parsing semantic versions: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/blob/251be2cfd205b427ae7807d08a40695ef3353b04/hooks/pre_gen_project.py#L6-L12 but in python 3.12 this is deprecated or removed and doesn't work (at least in my environment) so the cookiecutter fails after asking all of it's prompts.

I have found that https://pypi.org/project/packaging/ exists and seems to implement the same functionality so in my local branch I've changed the code to use that and it works if I manually pip install packaging but ideally we'd want cookiecutter to install that whenever the user runs cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython I tested it with my own branch and it fails if I don't manually install that package. I tried adding a requirements.txt thinking that might do it, but it doesn't seem to have made a difference.

#

Or as an alternative the code could be simplified to parse "manually" with string split and int() and then compared to the minimum version. As far as I understand it this code looks to just be enforcing a minimum version which does feel like a bit minimal to be requiring an external module for.

kind river
#

yep, menu config option for mbedtls. everything is compiling now

lone axle
#

Honestly I don't think that mechanism for enforcing the minimum version is actually effective. I installed cookiecutter 1.7.3 which is lower than 2.1 and when I try to run it I get a stacktrace explosion about a filename being too long and it never prints the error from our hook.

manic glacierBOT
#

good question. I don't think there's a look-before-you-leap "is there working ipv6" check in CPython.. However, in CPython with no ipv6 global connectivity, a v6 connect() to an internet address will promptly fail:

>>> s.connect(("ipv6.google.com", 80))
OSError: [Errno 101] Network is unreachable

If the OS lacked even support compile-time for V6 sockets at all then the socket module can lack the AF_INET6 definition:

#ifdef AF_INET6
    ADD_INT_MACRO(m, AF_INET6); ...
crimson ferry
#

To start up code.py with IPv4 only, are these the required steps (with PR#9436?```
import wifi

wifi.radio.stop_dhcp_client()
wifi.radio.start_dhcp_client(ipv4=True, ipv6=False)

onyx hinge
#

I have to admit I did not test this. In principle, just the 2nd call is needed, because it stops whichever one(s) are not requested. ```c
void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self, bool ipv4, bool ipv6) {
if (ipv4) {
esp_netif_dhcpc_start(self->netif);
} else {
esp_netif_dhcpc_stop(self->netif);
}
#if LWIP_IPV6_DHCP6
if (ipv6) {
esp_netif_create_ip6_linklocal(self->netif);
dhcp6_enable_stateless(esp_netif_get_netif_impl(self->netif));
} else {
dhcp6_disable(esp_netif_get_netif_impl(self->netif));
}
#endif
}

😭 the increasingly inaccurately named `start_dhcp_client`
crimson ferry
#

do we know if the espressif implementation uses the RFC 4941 β€œprivacy extensions"?

#

if not, I would suggest not starting IPv6 by default

onyx hinge
#

I do not have a strong opinion about what the default should be. Now is the time to influence that choice. I do not see any signs via full text search of rfc 4941 support, though I also don't know in detail what that is (I know it has to do with not linking global IPv6 address to hardware address, but that's just a very general level of knowledge)

crimson ferry
#

I don't have an in-depth understanding of it either, but I am concerned (and suspect some others would be as well) if their microcontrollers are permanently and globally identifiable

onyx hinge
manic glacierBOT
kind river
#

Almost there, getting undefined references to the coex functions

manic glacierBOT
#

The code changes in #9343 were reverted by #9447, because they broke screen backlighting on SAMD51 boards like PyPortal (and maybe other PWM things as well), as reported in #9443.

The intention of #9343 is good, but it needs to be fixed.

Note that #9343 did not affect backlighting on Hallowing M0, so I'm guessing the #9343 changes were OK for SAMD21 but not SAMD51.

@timchinowsky I hope you are able to take a look at this. Thanks.

midnight ember
#

The symbol font Fork Awesome that is used in some Adafruit guides and that I was introduced to via Adafruit devs is unfortunately showing a deprecated notice on their Github. https://github.com/ForkAwesome/Fork-Awesome I'm not sure how that might affect some Adafruit projects or if the project will be deleted someday. Might be worth a dev having a quick look into it to see if there are any implications for adafruit guides. I have been using the font for some of my recent projects and I don't even know what it means. As long as the font file is included in the bundle for any learn guides then it should continue to function normally, my guess is there simply will not be anymore future revisions to fork awesome.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.1.1
orchid basinBOT
manic glacierBOT
manic glacierBOT
tulip sleet
onyx hinge
#

thanks for making that release @tulip sleet -- good to have the display big fixed

tulip sleet
manic glacierBOT
wraith crow
#

Well I didn't expect git to interpret that update as a review dismissal 🀷

tulip sleet
manic glacierBOT
#

Note that https://github.com/adafruit/circuitpython/pull/9343 did not affect backlighting on Hallowing M0, so I'm guessing the https://github.com/adafruit/circuitpython/pull/9343 changes were OK for SAMD21 but not SAMD51.

After further testing, it looks like the backlight breaking change was only the removal of the first while loop ( while (tc->COUNT16.SYNCBUSY.bit.CC1 != 0) {} ), the second loop had no effect on the display.
The first while loop is in a SAMD51 specific section of the...

orchid basinBOT
manic glacierBOT
#

My main need would be the Adafruit web libraries like the adafruit_httpserver
and the USB/web workflows.
Relying on frozen modules in Micropython for run-on-boot capability doesn't even come close to the convenience of the CircuitPython USB worflow imho.

Zephyr OS offers very easy portability and very wide hardware support. Especially Ethernet support (for internal MACs) is one major feature that is missing fr...

orchid basinBOT
#

We go by the manufacturer's name, and Seeed chooses not to include the hyphens. So I don't think we should change these names. There are other boards with similar non-canonical names, such as the "Lolin C3 Mini" or Unexpected Maker "TinyC6". We would not change the name of the "TinyC6 "to the "Tiny ESP32-C6".

So I don't think we should take this PR, sorry.

If you search for "C6", you can find the board. You can also click on "Filters" and choose "esp32c6" as the Processor family.

manic glacierBOT
orchid basinBOT
orchid basinBOT
#

@Carla-Guo Thanks. Are you going to change the product names on your website too? Or is this only for getting the search to work on https://circuitpython.org ? If we had a different search mechanism that matched "ESP32-C3" with "ESP32C3", would you be requesting this change? I am concerned about the inconsistency between the official name and the name we are using here.

I think many people would just search for "C3" or "C6", and then the boards would be easily found.

orchid basinBOT
orchid basinBOT
#
  • Addresses #1438

Some boards uses a hyphenated name for the microcontroller chip or other feature, and some do not. Right now the search will give different results in the two cases. For instance, searching for "ESP32C6" yields different results than "ESP32-C6".

This change makes the match ignore hyphens, producing a more inclusive search.

We used to use a regexp, which would have made for an easy fix, but that was too slow (see #1328), so this is "hand-coded".

Tested locally.
...

orchid basinBOT
onyx hinge
#

@slender iron do you want ipv6 to default on or off? and did you want the "supports_ipvx" constants removed? I'm eager to update that PR so it can be reviewed again.

slender iron
onyx hinge
#

(the circuitpython enabling define says SOCKETPOOL but it affects stuff across wifi & socketpool both)

slender iron
#

ya. I think it'd be better to test in a way that matches CPython

onyx hinge
#

OK

manic glacierBOT
orchid basinBOT
#

This idea came up again to me while doing #1439. The "Processor family" values right now are inconsistent in level of detail: "esp32c6" exists, but not "samd51", only "atmel-samd". Searching for "samd51" does not bring up Metro M4, for instance, only boards with "SAMD51" in their board name.

Hmm, yeah. I think the reason we have the ESP chips more granular is because for chips like ESP32-S2 and ESP32-S3, we have a bootloader available, but for chips like the ESP32-C3, we don't.

manic glacierBOT
manic glacierBOT
#

Sorry, out of town unexpectedly and haven't been able to grab any logs yet or test with other hubs, but to add:

The specific hub I am having issues with is the D-Link DUB-H7 (https://www.amazon.com/D-Link-DUB-H7-7port-Usb-2-0/dp/B00DMLTG3G/). I haven't been able to test with other hubs, but should be able to in about a week when I return home.

Reverting to CircuitPython 8.x and using the hub works as expected (i.e. write-protect off for fresh CP install with default initial filesystem)...

manic glacierBOT
onyx hinge
#

thank you for the merge @slender iron ! I look forward to seeing what you can get done with Matter over the next weeks while I'm away.

tulip sleet
#

@slender iron @onyx hinge shall I make a 9.2.0-beta.0 yet?

slender iron
#

how is the MP merge coming? I'm not sure 9.2 has much for folks to test in it

tulip sleet
#

good point, I should probably wait for that at least. Not even ready to try to compile yet.

#

I want to fix some more bugs too

slender iron
#

I'm not ready to run the matter stuff on CP anyway

manic glacierBOT
kind river
#

the openthread binding is compiling but crashing due to memory access. need to brush up on my C

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1 on 2024-07-22; Adafruit QT Py ESP32-S3 no psram with ESP32S3

Code/REPL

from time import monotonic, sleep
from board import NEOPIXEL, NEOPIXEL_POWER
from neopixel_write import neopixel_write
from digitalio import DigitalInOut, Direction


np = DigitalInOut(NEOPIXEL)
pwr = DigitalInOut(NEOPIXEL_POWER)
np.direction = Direction.OUTPUT
pwr.direction = Direction.OUTPUT
pwr.value = True
epoch = monotoni...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.5 on 2024-05-22

Code/REPL

https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/tree/main/examples/httpserver_start_and_poll.py

Behavior

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Started development server on http://192.168.20.147:5000
192.168.20.108 -- "GET /" 355 -- "200 OK" 82 -- 27ms

Code stopped by auto-reload. Reloading s...

manic glacierBOT
#

... It is invalid to connect the external pull-up resistor, and the manufacturer must add a pull-up resistor inside. ...

Glad it is working! Could you explain what you meant by "invalid" above?

Adding an external pullup resistor to the motherboard does not make the touch screen work, but using a touch screen with an internal pullup resistor added by the supplier does.

empty salmon
#

For updates to an existing board, which branch should we fork from? main ? or 9.1.x ?

slender iron
#

9.1 if you want it released as stable soon

empty salmon
#

Thanks. I will fork branch from the 9.1.x for this minor change.

tulip sleet
slender iron
#

I don't need to review it

manic glacierBOT
analog pivot
#

Not sure if this belongs here, but I'm having trouble being able to copy into and delete files from my CIRCUITPY folder on my Macropad. How do I fix it? I am running MacOS SOnoma 14.5

stuck elbow
manic glacierBOT
#

The problem was originally identified because someone on Discord was trying to run this project Blinka Jump on the PyBadge, and the screen was all black. Same when I tested on the PyGamer board.
But the code is irrelevant, the display goes black on all boards (including the Titano) as soon as the CP version 9.1.0 is installed. There is no splash screen, and it's not showing the serial.

everything is working fine for me on a PyPor...

manic glacierBOT
manic glacierBOT
#

@snkYmkrct see video: https://github.com/user-attachments/assets/75904714-98ef-48c6-a600-75375f696a63

@dhalbert thanks, I'm thinking there's something timing-related going on. In the __init__.py it ramps the PWM up and down, and the behavior of something like that will change a little bit when you change from blocking to non-blocking. But so far it is working just fine for me, at both 50000 Hz and 500 Hz. Using libraries in .mpy format except for adafruit_pyportal which is in `.p...

manic glacierBOT
kind river
#

I can create an instance of { mp_obj_base_t base; otInstance *instance; otOperationalDataset *dataset; } openthread_pending_dataset_obj_t; but when I try to access it, I get Hard fault: memory access or instruction error.

#

(on the C side)

tulip sleet
kind river
tulip sleet
#

you could point me to your repo

tulip sleet
#

got it, so where are you getting the hard fault?

kind river
#

on any access of openthread_pending_dataset_obj

tulip sleet
#

i don't see the declaration in your repo, it is all from 4 days ago

kind river
tulip sleet
#

which branch are you pushing to?

#

ah, you're pushign to main

kind river
#

so I am

tulip sleet
#

anyway, I'm looking at main right now. Assume you will want to reset --hard main after pushign this stuff to the branch

kind river
#

yes

tulip sleet
#

so are you saying that just typing openthread.pending_dataset into the REPL is crashing?

kind river
#

yes

tulip sleet
#

in common_hal_wifi_init(), there is this, for instance:

    common_hal_wifi_radio_obj.base.type = &wifi_radio_type;
#

do you set the type somewhere?

kind river
#

That's probably it

tulip sleet
#

i think the pointer to the obj is fine, but stuff in the object isn't initialized

manic glacierBOT
kind river
manic glacierBOT
#

I'm seeing that inserting a delay before the call to common_hal_busdisplay_busdisplay_set_brightness fixes it. Line is here:

https://github.com/adafruit/circuitpython/blob/bd834182c43e46606124ce63a604afd91b6568cf/shared-module/busdisplay/BusDisplay.c#L121

2 ms doesn't do it, but 3 ms does, which makes sense for the 500 Hz PWM frequency.

The question seems to be, what happens if you try to update the PWM duty cycle faster than the PWM frequency?
To me the most logical thing would...

manic glacierBOT
#

While using a rotary encoder with ESP32-S3, I noticed both the high and low limits were returning the 0 on overflow, which is the default behavior of the ESP32 PCNT when the internal accumulator is disabled.

unit_config.flags.accum_count = true; is set in the code, but watchpoints matching the high and low limits also need to be created for the internal accumulator to work.

This PR should fix that.

manic glacierBOT
#

I have a script to explore working with SSE. It Β«seems toΒ» work. I can connect and disconnect browser sessions. However, if I then just leave it running with no connections, and come back later (maybe an hour), the app is frozen. ctrl+c in the serial window aborts and gives:

192.168.20.105 -- "GET /sse" 360 -- "200 OK" 101 -- 126ms
192.168.20.105 -- "GET /favicon.ico" 390 -- "404 Not Found" 90 -- 18ms
client ('192.168.20.105', 8332) went away: code 32
client ('192.168.20.108', 47...
manic glacierBOT
analog pivot
manic glacierBOT
#

Here are some experiments where code.py sets the duty cycle of 500 Hz PWM to 10%, then right away sets it to 90%. The top (green) signal is programmed to go high when duty is set to 10%, and go low when it's set to 90%. The bottom (yellow) signal is the PWM.

On samd51 running 9.05, both 10% and 90% are always seen, because the code blocks until it is ready to accept another duty cycle value:

![samd51_TCC_905](https://github.com/user-attachments/assets/225e7b86-a1de-4957-866f-42ae23f...

#

The TCC docs say:

As long as the respective Buffer Valid Status flag (PATTBUFV, PERBUFV
or CCBUFVx) are set to '1', the related SYNCBUSY bits are set (SYNCBUSY.PATT, SYNCBUSY.PER or
SYNCBUSY.CCx), a write to the respective PATT/PATTBUF, PER/PERBUF or CCx/CCBUFx registers will
generate a PAC error,

Try to clear the status bit for buffer valid before re-writing it.

manic glacierBOT
manic glacierBOT
lilac scaffold
#

hello! I'm returning to a CP project with a new hw design.
I wanted to verify that I'm going about the design the right way - or what product has the right hw that I can look at a schematic?

#

I'm going to use the STM32F746 which has nothing on it AFAIK

manic glacierBOT
manic glacierBOT
#

The "internal watchdog timer" that was triggered happens because something was taking far too long, blocking other operations (for example, a tight infinite loop). It reflects a bug, not just a timeout that's too short.

If you can reduce your program to the smallest example that still shows the problem, that would be great. We'll have to let it sit for a while to trigger the error, it seems like.

tulip sleet
#

many of the STM builds are rarely used, so there may be undiscovered problems

#

I'm not saying there are, but there might be.

lilac scaffold
#

that's good advice thanks

manic glacierBOT
#

Following up from this: https://github.com/adafruit/Adafruit_CircuitPython_EMC2101/pull/34

I have updated the mailmap file in here too. I split my changes into two commits: One is just my own name correction, the other is my best attempt at cleaning up the output of git shortlog -s -e and git shortlog -s -e -n, without making too many assumptions. That does mean there are duplicates in the shortlog still, because I didn't know which email of multiple valid-looking ones to use.

I did...

manic glacierBOT
#

Another data point... I tried a similar reproducer on an Adafruit Metro ESP32-S3 with an attached Adafruit 2.8" TFT Touch Shield. But, this time I set the display up to echo the serial console. In this case, the TFT console continues working (taking keyboard input from the USB serial connection!), even after the USB serial output to screen -fn /dev/tty.usbmodem... stops working.

CircuitPython version

...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

FWIW, seeing that Mu and screen act the same way across significantly different hardware/OS combinations, my bet is that this has to do with an edge case on the CircuitPython board that is triggered by a USB power saving feature or perhaps by a full TX buffer. I'm assuming that the Macs are entering a standby or suspend mode that slows or stops the CPU. Maybe some combination of TinyUSB, ESP-IDF USB Device Stack, and CircuitPython aren't on the same page about what should happen if the host c...

manic glacierBOT
#

I have run your first test script on an esp32-s3 in a "screen" window on linux with the output paused using ctrl-s for more than 30 minutes...

As long as I don't lock the screen, nothing weird happens for me. But, once the screen has been locked for approximately 100 seconds (sometimes less, sometimes more), something breaks. The screen locking is the trigger.

An important point to note is that I have my systems set so that they can automatically go to sleep when the display is off.
...

manic glacierBOT
#

This may be relevant https://www.kernel.org/doc/html/v4.13/driver-api/usb/persist.html#:~:text=By default%2C Linux behaves according,officially correct” thing to do.

I was actually able to bring a frozen screen back to life using the following script

#!/bin/bash
echo "2-1.1" > /sys/bus/usb/drivers/usb/unbind
echo "2-1.1" > /sys/bus/usb/drivers/usb/bind

I ran dmesg after plugging the controller in to identify the device ID (2-1.1)

You have to jump th...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1 on 2024-07-23; ProS3 with ESP32S3

Code/REPL

import alarm
import board
import time
from microcontroller import watchdog as w
from watchdog import WatchDogMode

# Watchdog and Supervisor
w.timeout = 300
w.mode = WatchDogMode.RESET

print("test")
time.sleep(1)

w.feed()
    
wakeup_period = time.monotonic() + int(30)
time_alarm = alarm.time.TimeAlarm(monotonic_time=wakeup_period)
alarm.exit_an...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

9.1.x, main

Code/REPL

# readthedocs problem

Behavior

https://docs.circuitpython.org/en/latest/shared-bindings/board/index.html is empty, when it should have content

Description

During readthedocs, the empty __init__.py is used for generating the documentation of this module, rather than the __init__.pyi file:

[AutoAPI] Reading files... [ 47%] /home/docs/checkouts/readthedocs.org/user_builds/circuitpython/ch...
#

Closes #9465

Please check the RTD html build when reviewing this bug! Last time we thought we fixed this, I think only local builds were checked (or something? not sure why the previous PR passed muster)

Will want to merge 9.1.x up to main after this. This is required for fixing the builds of various bundle libraries, fixing e.g., the failure seen in https://github.com/adafruit/Adafruit_CircuitPython_EMC2101/pull/34

onyx hinge
#

πŸ’¦ doc building feels like it's been fragile lately

manic glacierBOT
lone axle
onyx hinge
manic glacierBOT
#

Something strange seems to be going on inside of RTD. I'm not really sure how to check what the results of building the real docs inside of RTD are going to be.

I tested this PR with a local build and it does show content on the board page. But I found the same when I tested #9431. I even went back to #9431 again today and did another local build and confirmed I do still see content on the board page with a build from that branch as well.

I didn't know these existed, but I found ju...

slender iron
manic glacierBOT
#

To me it seems that looking at those isn't really showing us how it's going to turn out when it's merged and in the real docs though. The 9431 preview build looks correct: https://circuitpython--9431.org.readthedocs.build/en/9431/shared-bindings/board/index.html, as does the new one for 9466. But for some reason in the "latest" real build it's different than the PR preview ones in that it has the blank board page.

In my mind this does look good to merge.

But I'm not certain whether i...

#

I suspect tud_cdc_connected() is returning false here:

https://github.com/adafruit/circuitpython/blob/bd834182c43e46606124ce63a604afd91b6568cf/supervisor/shared/serial.c#L373-L382

This is based on the sent line state:
https://github.com/hathach/tinyusb/blob/cfbdc44a8d099240ad5ef208bd639487c2f28153/src/class/cdc/cdc_device.c#L127-L130

I don't know why this would only break on an S3. ESP does run tinyusb processing in a different task. Most run it in the CircuitPython background tasks.

manic glacierBOT
#

Includes the following:

  • bd834182c4 Merge pull request #9458 from weblate/weblate-circuitpython-main
  • 8b5869c98e Merge pull request #9452 from weblate/weblate-circuitpython-main
  • bffdf3beea Merge pull request #9436 from jepler/veesix
  • 3865456c5f Merge pull request #9427 from RetiredWizard/sysdoc
  • 2d518a2ade Merge pull request #9449 from adafruit/9.1.x
  • 2cd53b03a7 Merge pull request #8798 from lovrojakic/board-support-for-vidi-x
  • 758c60c625 Merge pull request #9445 from weblate...
#

So far, I don't think we know anything one way or the other about ESP32-S2. The ESP32 boards I have are all S3. If anybody wants to try S2, I'd be curious to hear what happens.

These are some other boards I tried, none of which have the problem (timestamps continue printing after screen is unlocked):

Adafruit CircuitPython 9.0.5 on 2024-05-22; Raspberry Pi Pico with rp2040
Adafruit CircuitPython 9.0.5 on 2024-05-22; Adafruit Trinket M0 with samd21e18
Adafruit CircuitPython 9....
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Modifying this function to always return "false" seems to prevent the issue from occurring.

https://github.com/hathach/tinyusb/blob/ccc7a36043e055ded1f478a979a303e694123187/src/device/usbd.c#L370-L372

I'm guessing that suggests that either the OS isn't marking the device as no longer suspended or the device isn't recovering properly from the suspended state.

Without this function properly operating the ESP32 board continues to output while the computer is suspended, ie there are no ...

manic glacierBOT
#

CircuitPython version

origin/main (pull request)

Code/REPL

GITHUB_EVENT_NAME=pull_request BASE_SHA=901dd228cbdb2069e66fae8c2108d44466ab1e7f HEAD_SHA=d335a10574a1eaf78c94e566399d96150f269636 GITHUB_SHA=7dd3bf81e44bfb73880cc34d418bf7ed09223bad python tools/ci_set_matrix.py

Behavior

Should build many boards, but actually builds none

Description

Encountered while building https://github.com/adafruit/circuitpython/pull/9467

Additional infor...

manic glacierBOT
#

another data point... I was able to prevent the serial glitch on ESP32-S3 with storage.disable_usb_drive(). If I put this in my boot.py, then do a hard reset, the USB serial output does not glitch:

import usb_hid
import storage
usb_hid.disable()
storage.disable_usb_drive()  # CAUTION: THIS WILL HIDE YOUR CIRCUITPY DRIVE!!!

For anybody reading this who isn't already familiar with recovering from a disabled CIRCUITPY drive...

To fix your boot.py so CIRCUITPY co...

grizzled thunder
#

Issue with defining a group of Neopixels

#

pixels = neopixel.NeoPixel(board.NEOPIXEL, n :4) if i post this i get a syntax error

#

on the N: 4

#

The ide tells me it should exist, but it won't work.

crimson ferry
#

@grizzled thunder pixels = neopixel.NeoPixel(board.NEOPIXEL, 4)

stuck elbow
grizzled thunder
#

thanks, i thought i tried that too.

lone sandalBOT
kind river
#

Seems like my crashes are due to an openthread config issue or something because just running otInstanceInitSingle(); triggers a crash.

manic glacierBOT
#

Merging from micropython-v1.22-release branch.

  • added background tasks and interrupt checks to new routines mp_event_wait_ms() and mp_event_wait_indefinite().
  • Note that QDEF is now QDEF0 and QDEF1.
  • pyexec.c is still hard to merge due to atexit conditionals. Maybe there's some way of formatting them so there are fewer changes.
  • raspberrypi/libm_extra.c fixes ROM floats to handle infinities correctly, but I did not pick this up yet.

As of the initial draft PR, a...

manic glacierBOT
#

I did some more testing. I have sample code that reliably triggers a non-responsive httpserver, and most of the time safe mode on restart. My initial pointer to .poll() is back in the mix. I tried a couple of variations. When I use server.server_forever(…), I do not see the failures. Change that to start plus while True and server.poll() triggers the problem. Idle time is also part of the mix. If I do a fresh request every 5 minutes, the error does not trigger … until I leave it idle for abou...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have no idea what has changed under the hood in CP for 9.1, so I'll need to make some enquiries.
I know there's a way in the board configs to tell CP not to touch certain IO, but that should not be needed as it was working correctly before 9.1.

@dhalbert Can you think of anything off the top of your head (apart from possible IDF level changes) that could have changed the behaviour on the IO when going into deep sleep? Maybe some other bug fix that might have caused some knock-on effect?

manic glacierBOT
#

It appears that this is not going to affect the project that it was initially encountered in. The problem was seen when doing development and testing of separate sections. With everything (so far) merged together, there is no 'idle time' that is needed to trigger the failure. The project shows the sensor data both on a local display, and on web pages. It seems that the processing needed for the display portion is enough to prevent the watchdog timeout seen in server.poll(). Even with the web ...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1-5-g901dd228cb-dirty on 2024-07-28; Adafruit ItsyBitsy ESP32 with ESP32

Code/REPL

import mandelbrot

Behavior

>>> import mandelbrot
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incompatible .mpy arch

Description

Building a C-based extension module for circuitpython based on one for micropython, works fine one ARM e.g. itsybitsy M4, grand central M4, Teens...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

As far as I know, every popular Espressif chip has an equivalent, I don't think I've ever seen or used one without it.

Adding it to the existing API seems reasonable, but I'm not sure what it would look like, since there are several similar modes, and the WiFi and CPU have separate sleep settings, and the power consumption is more than full light sleep without automatic wakeups for the WiFi hardware.

manic glacierBOT
#

Here is a bit smaller sketch that can produce the same symptoms. Note that the first cycle had the server stop responding, but on control C abort and control D reload, it restarted successfully. That restart also did not stop responding after a 16 minute idle period, then a 22 minute idle period. It did not respond after a following 27 minute idle period, and the following forced abort and restart showed the watchdog timer expired problem. For most of my previous testing 15 minutes idle time ...

manic glacierBOT
lone axle
#

Should we go ahead and make a release for the cookiecutter repo? We haven't done that in the past, and it's not required for usage during cookiecutter execution. But as changes get made over time it might be easier to keep track of them and be able to refer back to different versions by some easier to use tag number rather than back through commits or PR history.

Also if we do want to make one can anyone think of anything that it might cause issues with? To the best of my knowledge cookiecutter doesn't interact with much if anything in the nightly automated tasks and I can't think of anything else that could be impacted.

tulip sleet
lone axle
#

Any thoughts on what to use for the version number? I know it's arbitrary and doesn't matter much. I'm inclined to think something like 1.1.0 or 2.0.0 to try to indicate that there is some history that comes before the first numbered version.

solar whale
#

FYI -- I used the latest cookiecutter on my RFM repo and the transition to ruff went fairly smoothly. I had to use a few #noqa:s

lone axle
#

Thank you for the feedback.

tulip sleet
solar whale
#

I am getting this failure on github when I update my repo. Does anyone know what I have to fix? ```Checking dist/circuitpython_rfm-1.2.3-py3-none-any.whl: FAILED
ERROR long_description has syntax errors in markup and would not be
rendered on PyPI.
line 51: Error: Unknown directive type "todo".

     .. todo:: Remove the above note if PyPI version is/will be available at
     time of release.                                                       

Checking dist/circuitpython_rfm-1.2.3.tar.gz: FAILED
ERROR long_description has syntax errors in markup and would not be
rendered on PyPI.
line 51: Error: Unknown directive type "todo".

     .. todo:: Remove the above note if PyPI version is/will be available at
     time of release.                                                       

Error: Process completed with exit code 1.```

onyx hinge
#

@solar whale CI is creating files to upload to pypi. during this process, checks are made for errors in the project's "long description", and it fails because the ".. todo::" blocks are not OK in the "long description". You should resolve whatever the todo notes pertain to, and then delete them. The text it's talking about is probably in readme.rst

solar whale
#

OK -- progress, now when I try to generate a release, I get Uploading circuitpython_rfm-0.1.1-py3-none-any.whl 25l 0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/38.6 kB β€’ --:-- β€’ ? 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 kB β€’ 00:00 β€’ 117.3 MB/s 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 kB β€’ 00:00 β€’ 117.3 MB/s 25hWARNING Error during upload. Retry with the --verbose option for more details. ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/ Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. Error: Process completed with exit code 1. Am I lacking some permission or am I doing something wrong?

tulip sleet
solar whale
#

Still mine.

tulip sleet
#

do you want it to be on pypi now? You need to get an accoun on pypi and supply credential info to upload from the CI. If you are willing to wait until it's transferred, it can be uploaded then

solar whale
#

I'm happy to wait. No rush to see it on PyPi from my perspective. I just wanted to get it ready for people to test and review.

#

I may have misunderstood, but in last weeks meeting, I thought you suggested that I should create a release so it can be added to the "community bundle" for review.

tulip sleet
#

that's the lowest overhead path for someone wanting to try it. The CI uses GitHub secrets PYPI_PASSWORD and PYPI_USERNAME to upload to pypi. We have our own secrets for our account, of course. You can add secrets to your repo under settings, or you could make an organzation and add organization secrets. Former is easier for now

solar whale
#

Sorry, I am missing some part of the "big picture" . So are you suggesting I create my own PyPi credentials or transfer the repo to Adafruit?

#

I am more than happy to transfer it.

tulip sleet
solar whale
#

Fine with me, How do we do that?

#

Should I actually have that?

tulip sleet
#

the name would be changed to Adafruit_CircuitPython_RFM. let me see who has to initiate it

solar whale
#

Ah -- OK so should I rerun Cookie Cutter to make it an Adafruit library?

tulip sleet
#

yes, though I'm not sure of the details that will change

#

you would initiate the transfer from "Settings" in the repo. Scroll down to the "Danger Zone" section on that page.

solar whale
#

In the past, I think someone then created a template Adadrutit library and I then pushed to it.

tulip sleet
#

I could do that too, since it's not a lot of stuff to copy over

#

would you prefer that or do you want to keep the commit history of your repo

#

How about I just create an empty repo and you can do a fresh cookie cutter and copy things in?

solar whale
#

That sounds easiest to me - I don't need to preserve the history. If you don't mind creating the template.

#

Hopefully Adafruit will find this worthwhile!

#

There is no rush on any of this.

solar whale
#

Great -- thank you!

manic glacierBOT
#

I had it mostly working at one point in Micropython, but never made a PR because nobody replied to the thread and eventually someone else made one.

But now with the C6 and 802.11ax, there's also target wake time, which I believe they say can last for years on a battery, so the APIs should probably support that.

And it seems there's also the ability to sleep for more than one DTIM interval for a similar effect on older WiFi, but it can break broadcast traffic.

Seems like everyone else...

stark scroll
#

where is neopixel_write defined?

slender iron
#

which port do you want the implementation for?

#

it is in a native C module

manic glacierBOT
stark scroll
#

i don’t really care, i’m trying to port some stuff to Rust and I’m looking to see how to interact with gpio21 on the adafruit feather rp2040 CAN board. The adafruit rp2040 example for rainbow doesn’t work, and i’m pretty sure it’s because the pins are different. So i just want to see the source for how to communicate with the neopixel. Either python or C would be fine. But i pulled the circuit python community bundle and the circuit python bundle and it’s not in there from what i see

stark scroll
#

ugh, it’s not a simple serial connection, thank you for this!

manic glacierBOT
#

Adding some debug info was useful: to persistentcode.h:

#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "="  VALUE(var)

#pragma message(VAR_NAME_VALUE(MPY_FEATURE_ARCH))

Emits at compile time:

In file included from ../../py/builtinimport.c:37:
../../py/persistentcode.h:86:9: note: '#pragma message: MPY_FEATURE_ARCH=(MP_NATIVE_ARCH_ARMV6M)'
   86 | #pragma message(VAR_NAME_VALUE(MPY_FEATURE_ARCH))
      |     ...
slender iron
solar whale
#

@tulip sleet I forked the new Adafruit_CircutPython_RFM library and created a brach to update it. When I try to push the branch, I am getting this... ```(blinka_venv) jerryneedell@gjnpi5nvme:~/projects/combined_rfm/Adafruit_CircuitPython_RFM $ git push origin jerryn_initial_commit
Username for 'https://github.com': jerryneedell
Password for 'https://jerryneedell@github.com':
Enumerating objects: 89, done.
Counting objects: 100% (89/89), done.
Delta compression using up to 4 threads
Compressing objects: 100% (86/86), done.
Writing objects: 100% (87/87), 64.82 KiB | 3.81 MiB/s, done.
Total 87 (delta 45), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (45/45), completed with 1 local object.
To https://github.com/jerryneedell/Adafruit_CircuitPython_RFM.git
! [remote rejected] jerryn_initial_commit -> jerryn_initial_commit (refusing to allow a Personal Access Token to create or update workflow .github/workflows/build.yml without workflow scope)
error: failed to push some refs to 'https://github.com/jerryneedell/Adafruit_CircuitPython_RFM.git'

tulip sleet
lone axle
#

<@&356864093652516868> Sorry for the lack of additional warning today. But the weekly meeting is set to begin here on on discord in just a few moments.

tulip sleet
midnight ember
#

even though i'm here i'm text only

solar whale
slender iron
#

😻

midnight ember
#

🐱

tulip sleet
# solar whale same failure 😦

the error is "refusing to allow a Personal Access Token to create or update workflow .github/workflows/build.yml without workflow scope)". Maybe your personal access token didn't have all the right privs checked when you created it. There is a long list of privileges

solar whale
#

OK -- I'll try to regenerate it and try again

#

First hae to remeber how I created it in the first place πŸ˜‰

random junco
midnight ember
#

I loaded up the Qualia S3 with 9.1.1 last night, works well.

random junco
midnight ember
#

takes go kart to another level. never saw that coming.

#

Will we get a notice of some kind when everything switches from pylint & black to ruff?

lone axle
#

not necessarily. Things are mostly just changing as they get worked on for other reasons.

midnight ember
#

looking forward to the singular RFM library. thank you for all the work on it!

#

All of the matter stuff looks super complicated. Glad we have you working on it. πŸ™‚

slender iron
#

Ya, its been a bunch of new stuff for me.

#

Complicated but I think understandably so

midnight ember
#

Thank you for hosting @lone axle Have a great week everyone!

#

I also dove into some JPG imageload this morning. Was able to cut out about 50 lines of code. It works very well.

#

the difference in using jpegio decoder and imageload is night and day.

manic glacierBOT
lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1vwgVemFzcQIq3IEBjD66LEsObJawdNTniufYQoimPdc/edit?usp=sharing

slender iron
#

@tulip sleet want me to review the mp merge today?

solar whale
#

@tulip sleet -- all set with github personal access token now. Not quite sure what was necessary to add, but it looks like I added enough....

manic glacierBOT
#

I was thinking of that, but I'm not sure how you would get the beacon
interval, I'm not seeing any APIs for that in the ESP-IDF, maybe I haven't
looked hard enough but I suspect it's not even sent by the AP.

You could assume it's 100ms, or measure it? But the value of 1 beacon is
special regardless of the interval because of broadcasting, some users will
likely want to do DTIM1 regardless of time, so we'd want the ability to
explicitly set DTIM1, right?

On Mon, Jul 29, 2024, 12:45β€―...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1 on 2024-07-22; Adafruit Feather ESP32-S3 TFT with ESP32S3

Code/REPL

import os
import ssl
import time
import wifi
import board
import displayio
import terminalio
import socketpool
import adafruit_requests
import adafruit_ntp

displayio.release_displays()
display = board.DISPLAY

# The time of the thing!
EVENT_YEAR = 2024
EVENT_MONTH = 8
EVENT_DAY = 16
EVENT_HOUR = 0
EVENT_MINUTE = 0
# we'...
#

CircuitPython version

CP9.1.1
Boot_out.txt:
Adafruit CircuitPython 9.1.1 on 2024-07-22; Adafruit Feather RP2040 Prop-Maker with rp2040
Board ID:adafruit_feather_rp2040_prop_maker
UID:DF625857C7736034

Code/REPL

any code. the issue is in saving to the micro
# SPDX-FileCopyrightText: 2020 Jerry Needell for Adafruit Industries
# SPDX-License-Identifier: MIT

# Example to send a packet periodically between addressed nodes

import adafruit_ds3231
from ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

How were you running the code? In a code.py started on board reset, or through an IDE like Thonny or the Web workflow editor?

I've seen something similar when the flash file system was created but damaged. The host OS would mount the CIRCUITPY drive and appear to write/update files but nothing was actually written. I think the Host OS would hold a cache so it would appear from the host side that the changes were made but if the micro controller attempted to run or access a file the changes...

manic glacierBOT
#

I think I might have some free time so I was planning to work on this in a bit.

If I understand correctly, the idea for now is:

Have the existing alarm.light_sleep_until_alarms use automatic light sleep, letting the chip handle actually entering sleep and waking as needed so peripherals keep doing their thing, preferring correctness over minimum power consumption.

Add a radio.listen_interval property that enables WiFi power saving, matching the API that the IDF exposes, letting you...

manic glacierBOT
onyx hinge
#

ah vacation, time to work on the "posix" port again. Down to 3 failures + 97 skips, compared to unix coverage port 0 failures + 34 skips. As always, still a ways to go.

solar whale
#

Vacation? Sounds like a "busman's holiday" to me.

manic glacierBOT
manic glacierBOT
#

Right now the only thing that seems to be confusing is this file: https://github.com/adafruit/circuitpython/blob/2f626121867efa429b7484fa3ca5a315021cc506/ports/espressif/common-hal/alarm/__init__.c

It uses port_idle_until_interrupt(), which seems to call xTaskNotifyWait, but I don't see how that enters actual light sleep, unless CONFIG_FREERTOS_USE_TICKLESS_IDLE is set somewhere outside the repo.

Does light sleep until alarms actually sleep? The comment `// We cannot esp_light_sleep_st...

tardy bluff
#

Trying to enable compiled modules on esp32 (ItsyBitsy) and I have it so that this now works, but hit

>>> import mandelbrot
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:396
ho 0 tail 12 room 4
load:0x40078000,len:13916
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3156
entry 0x40080558
Serial console setup

Is there any guidance for how to debug this? Context:

https://github.com/adafruit/circuitpython/issues/9471

Appreciate that this is a low priority for the adafruit team so keen to try and get this working myself

GitHub

CircuitPython version Adafruit CircuitPython 9.1.1-5-g901dd228cb-dirty on 2024-07-28; Adafruit ItsyBitsy ESP32 with ESP32 Code/REPL import mandelbrot Behavior >>> import mandelbrot Traceba...

manic glacierBOT
#

Work in progress at https://github.com/graeme-winter/adafruit-circuitpython (detatched fork) now hitting

>>> import mandelbrot
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 271414342, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:396
ho 0 tail 12 room 4
load:0x40078000,len:13916
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3156
entry...
manic glacierBOT
#

This is not heavily tested, and is posted for review and discussion as part of work on #9463.

It allows you to set the listen interval of the WiFi hardware to reduce power consumption.

When listen interval is 1, WIFI_PS_MIN_MODEM is used, when it is more than 1, WIFI_PS_MAX_MODEM is used.

The listen interval is set in units of whatever the AP's beacon interval is, most likely 100ms.

Without it, and running at 80MHz, power consumption hovers around 110mA with 140mA spikes. When se...

manic glacierBOT
manic glacierBOT
#

Yeah, I'm not sure if it also affects multicast, but broadcast isn't super commonly used so it might be fine.

The advantage of capping at 1 is that it could then be completely safe to use higher values on all boards, and there could just be one parameter for DTIM beacon sleep and target wake time.

But I'm not actually sure higher DTIM values are actually doing anything, ping times and power look the same as when set to 1.

slender iron
#

@tardy bluff Do a debug build and look at the UART output. It should have a backtrace. I bet that reset is due to a call to reset_into_safe_mode()

tardy bluff
slender iron
#

thanks for looking into compiled modules! Others will be excited to have it

manic glacierBOT
#

Right now the only thing that seems to be confusing is this file: https://github.com/adafruit/circuitpython/blob/2f626121867efa429b7484fa3ca5a315021cc506/ports/espressif/common-hal/alarm/__init__.c

It uses port_idle_until_interrupt(), which seems to call xTaskNotifyWait, but I don't see how that enters actual light sleep, unless CONFIG_FREERTOS_USE_TICKLESS_IDLE is set somewhere outside the repo.

Does light sleep until alarms actually sleep? The comment `// We cannot esp_light...

lone axle
#

Does anyone have any recent experience with cookiecutter on windows? I didn't realize there was a different branch of the cookiecutter template and instructions for using ansys-cookiecutter instead of "regular" cookiecutter noted here https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library#running-cookiecutter-windows-3114568.

It looks like this windows branch is out of date though and a user other in #help-with-circuitpython is having some trouble trying to use it on Windows.

I'm wondering if there is some way we could make the process easier on windows or if there is interest in doing so. Could we maybe have some Github repo which uses specialized actions to run cookiecutter and then make the resulting project zip available for download? Kind of like how we have a way to make a custom build of core circuitpython via github actions?

If we could change that process from command line tool requiring a few libraries and other utilities to be installed over to just a "form" page that allows the user to enter their answers into standard inputs on a webpage it could help lower the friction for people wanting to share their libraries.

#

It also turns out that ansys-cookiecutter which the guide recomends doesn't seem to exist any longer. https://pypi.org/search/?q=ansys-cookiecutter returns no results by that example name and pip install ansys-cookiecutter fails with the error No matching distribution found for ansys-cookiecutter

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1 on 2024-07-22; Adafruit-Qualia-S3-RGB666 with ESP32S3

Code/REPL

import time
import board
import displayio
from adafruit_qualia.graphics import Graphics, Displays

graphics = Graphics(Displays.ROUND40, default_bg=None, auto_refresh=False)

bitmap = displayio.OnDiskBitmap("/img.bmp")

# Create a TileGrid to hold the bitmap
tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)

#...
candid sun
manic glacierBOT
#

Thank you all for all the support on this project! You guys really seem to
care about making CircuitPython the best it can be!

I have basic WiFi power saving working in the draft PR, and I'm working on
tickless idle at the moment.

I'm getting down to 20mA while remaining ping-able, and some of that may be
the USB serial chip.

My current approach is:

  • Enable tickless idle only during light sleep until alarms

  • Disable the tick timer during that period

  • Set everything ...

#

Sounds good, I'll make these changes tonight after I figure out this
pre-commit issue... I thought it looked a bit odd, but pre-commit didn't
show any errors, maybe I just need to manually run it once or something.

In further testing I'm not actually quite sure values above 1 are doing
anything, ping times look the same as they do for 1.

The advantage to capping at 1 would be that using a higher value would
always be totally safe, so you could use the same code for WiFi 6, and it
c...

#

I am seeing the same issue with the SQUARE40_480X480 display and qualia board. Also 9.1.1. Have not (re)checked 9.0.5, but do not remember noticing problems when I was using it.
One side of the display twists up, then falls back down. One my display, that is the right side, but I have rotation set to 90, if that makes a difference. Whole display can shift up a couple of pixels too, but that is a lot less often.

manic glacierBOT
orchid basinBOT
onyx hinge
#

@lone axle cookie cutter is now tested during ci that it works (that is, runs to completion) on Windows. The need for a fork is no longer true.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.3 on 2024-04-04; Raspberry Pi Pico with rp2040

Code/REPL

import time
import board
import audiocore
import audiomp3
import audiomixer
import audiobusio
import storage
import sdcardio
import busio



spi = busio.SPI(board.GP10, MOSI = board.GP11, MISO = board.GP12)
cs = board.GP15
sd = sdcardio.SDCard(spi, cs)

# Mount SD card 
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')


audio =  a...
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
#

I created a proof of concept server app that basically converts cookiecutter questions into a web form instead of CLI https://cookiecutter.foamyguy.com/cookie/?template=gh:adafruit/cookiecutter-adafruit-circuitpython. It appears to be working successfully but I haven't done exhaustive testing or validated everything inside of the generated projects. I think something like this might be a little more approachable to some folks than the existing CLI cookiecutter process. Theoretically it could handle other cookiecutter templates by changing the URL param, but I've limited it with an allow list to only work for this one ATM. Because I kept it general enough to work with any cookiecutter the "hints" given in the form page are kind of cryptic since they're just the default values, if you don't understand jinja template and cookiecutter they may not mean anything to you. There could be a form made more specific to circuitpython cookiecutter though with more specific and helpful hints if this is something that we think might be a useful tool.

Moving this into a server has the benefit of taking the burden of getting python and cookiecutter CLI setup out of the end users hands and into a central server that anyone can use from any OS with only a browser and no additional setup. Initially part of my motivation was the differing process on Windows, but I understand now there is no longer a need for that different process, though we do still need to update the learn guide to reflect it.

Currently it's a Django app because that is what I'm most familiar with and could throw together quickly. I do think it might be possible to utilize github actions to move the generator "server" into workflow runners instead of an actual server deployed and accessed via the browser. However witht he github actions method I don't know about the possibility of making simplified all the way down to a form like this. The process might end up still being something like: fork/Clone the "cookiecutter wizard actions repo", edit a JSON config file with the answers to your cookiecutter questions, then commit / push and the actions workflow can grab your config file and run cookiecutter with it then upload the resulting zip into the repo, or maybe elsewhere. "The barrier to entry" is maybe lower than cookiecutter CLI directly, but not by very much I think.

manic glacierBOT
orchid basinBOT
#

Bumps rexml from 3.2.8 to 3.3.3.

Release notes
Sourced from rexml's releases.

REXML 3.3.3 - 2024-08-01
Improvements

Added support for detecting invalid XML that has unsupported
content before root element

GH-184
Patch by NAITOH Jun.

Added support for REXML::Security.entity_expansion_limit= and
REXML::Security.entity_expansion_text_limit= in SAX2 and pull
parsers

GH-187
Patch by NAITOH Jun.

Added more tests for invalid XMLs.

GH-183
Patch by Watson....

shadow vigil
#

hmmm - i'm having that crazy [expletive deleted] pre-commit issue on a CP library: i'm using Ubuntu 24.04, Python 3.12 and I've tried using "fresh" virtualenv and venv without any success (plus the "well did you install pip" stuff) -- any clues or hints?

spare jacinth
#

i can try later on an Ubuntu24 WSL image, for the sake of reproducing it:

  • python -V shows 3.12
  • then, you make a new env with python -m venv some_name
  • then . some_name/bin/activate (or source instead of .)
  • then pip install pre-commit
  • then pre-commit install fails? or is it an error thrown when actually running the checks (when doing git commit)?
shadow vigil
#

yes - AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? which is all over my search but i've not found an actual working solution

spare jacinth
#
  • fresh image, ran apt update && apt upgrade
  • apt install python3 (which in fact is 3.12)
  • then, trying to run python3 -m venv venv fails with a hint message
  • apt install python3.12-venv (as the hint suggested)
  • now we can actually python3 -m venv venv + . venv/bin/activate
  • pip install pre-commit works πŸ€”
shadow vigil
#

python3.12-venv/noble-updates,noble-security,now 3.12.3-1ubuntu0.1 amd64 [installed,automatic]

pre-commit -V pre-commit 3.8.0

spare jacinth
#

so it seems to be installed (pip install pre-commit worked)

#

does it fail when you try to configure it on the repo (pre-commit install)?
when you try and commit and the hook gets to run?

shadow vigil
#

yes, it fails with the above attribute error on run

spare jacinth
#

i asked whether it fails with a command or another, "yes" doesnt answer that 🀣

#

if it fails when running the hooks on your .pre-commit-config.yaml, maybe they are not compatible with 3.12, and is not a pre-commit issue on itself

shadow vigil
#

it's failing on run with the error above -- and it's the Blinka library, so not a new one -- i'm re-trying to do my change on a Raspberry Pi that has 3.11

#

(it's so stupid simple i might just give up and do it on github itself 😏 )

lone axle
manic glacierBOT
lone axle
#

For the workaround, inside of .pre-commit-config.yaml you can change the version on the 2nd of these lines:

  - repo: https://github.com/pycqa/pylint
    rev: v2.17.4

to

rev: v3.0.4
digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,159

Roles

38

Category Channels

8

Text Channels

64

Voice Channels

7

Threads

20

Boost Count

22 Boosts (Tier 3)

spare jacinth
shadow vigil
#

yes, it's the pylint version -- i can do a PR for this one, too πŸ˜†

manic glacierBOT
shadow vigil
manic glacierBOT
vital reef
#

Hey all! I'm working on the ESP32 light sleep project, and kind of hitting a wall here. It just doesn't seem like it's possible in any nice/satisfying way on most boards.

Light sleep is supposed to keep everything running in the background, but there's no way to tell if you're connected to USB if it's through a USB to serial chip.

There's also no way to receive serial data while in sleep mode as far as I can tell. You can wake on serial, but the first character is lost.

I suspect there's plenty of other edge cases like this too. We could do some kind of "Assume connected until X seconds after the last char" but that's not completely reliable.

Is there something I'm not seeing here? It seems like making effective use of sleep just isn't possible without some kind of compromise to the existing APIs, new flags to disable certain features during sleep, or software implementations of stuff on the ULP cores.

stuck elbow
#

I'm trying to implement rgb png images for imageload, and when I try to create a 24-bit displayio.Bitmap, I get ValueError: value_count must be 1-65536 β€” am I supposed to somehow be converting the image data to RGB656 on the fly or something?

#

Also, which colorspace should I use for grayscale images?

stark aurora
#

Is there Nordic NRF Bluetooth support ?

stuck elbow
stark aurora
#

Frequency counter counts frequency 20 or 50 times/sec and PWM peripheral drives LCD lens. Controller communicates 9600 bps with external device to set PWM as function of frequency deviation (diff. to se table ref. frequency).

#

I’m not sure using AI in Forth could solve/learn relationship between frequency difference and required PWM value starting with some initial settings? If this would be possible this could be a next candidate for smallest FPGA ICE40 device of new 130nm CMOS ASIC

stuck elbow
#

it's hard to beat an fpga

stark aurora
#

Size and power is the issue here… With ICE40 relative low power is possible but load config by startup from onboard flash consumes much more energy then in sleep/action modes

stuck elbow
#

circuitpython really isn't designed for low power or efficiency

#

you are probably going to get best results with low-level languages

stark aurora
#

Have done it already with less than 256 lines assembly code

#

Maybe HANA1 cpu [ Christopher Lozinski ]

stuck elbow
#

the only nrf mcu supported at the moment is nrf52840, it's pretty big and beefy

#

that's because circuitpython needs a lot of ram

stark aurora
#

Are there some examples. Sending some parameters for the embedded control loop and receiving embedded measurement data to/from mobile Android/IOS device ?

stuck elbow
#

you probably want to go to #help-with-circuitpython, there might be more people able to help you there, this channel is mostly for development of the circuitpython and its libraries

#

or even better, in #help-with-projects people might be able to suggest other solutions than circuitpython

stark aurora
#

No support yet for nrf5340 dual core ? Would like to use one core for Bluetooth and the other as control loop handling some peripherals. Or nrf52840 but then scheduling is required I believe and don’t know if it is supported yet in circuit Python

stuck elbow
#

no

#

not sure what you exactly mean by scheduling, there is asyncio

stark aurora
#

Running Bluetooth and embedded control loop at β€œthe same time”

manic glacierBOT
#

The traditional layout of pixels in bitmaps of depth less than eight is with the order of values in a byte reversed, but with bytes in the same order as the pixels on the line.

Before now, displayio.Bitmap did reverse the values, but did it on a word (four bytes) basis, not byte, which resulted in groups of four bytes being in the order opposite to the screen order.

This patch fixes this, by making processing of pixels in bitmaps of depth less than 8 bits based on bytes, not words. Sinc...

stuck elbow
manic glacierBOT
midnight ember
manic glacierBOT
manic glacierBOT
#

A board from LILYGO. Got it from the official aliexpress store. Similar to lilygo_twatch_2020_v3.

Note:
For supporting all of the hardware out of the box, a few frozen modules were added that are not by adafruit, or by me.
While I am actively testing them, these modules seem pretty final.
If adding frozen modules of 3rd parties without their knowledge is an issue, I am willing to fork & pledge to maintain them.

Task checklist:

  • [x] Display.
  • [x] Pins.
  • [ ] [USB-PID/VID PR...
manic glacierBOT
onyx hinge
#

Hello! No circuitpthon work to report. Instead, I'm on safari. Group hug!

manic glacierBOT
lone sandalBOT
stuck elbow
#

Hmm, it looks like the "windows" job is failing with the "This environment is externally managed" error. Did Python get updated?

spare jacinth
#

I dont recall seeing that on my Win computer, and i use 3.12, which afaik is the latest stable release

stuck elbow
#

it happens in recent versions of Python when there is a special file in /etc that tells people to install stuff witht he package manager and not pip

spare jacinth
#

Yeah, but you said Windows

#

Or is that "windows" not the OS

stuck elbow
#

the job is called "windows", I don't know what it does

spare jacinth
#

Oh, ok

tulip sleet
stuck elbow
#

files changed: 362 😱

tulip sleet
#

that is less than the usual merge from upstream πŸ™‚

stuck elbow
#

should I include the fix in my patch, or just wait for that patch to be merged?

#

or maybe a separate patch with just the fix?

tulip sleet
stuck elbow
#

ah, ok

tulip sleet
#

i'm not sure if there's a better way to do this, but setting a venv and using it in different build steps does not seem easy to me.

stuck elbow
#

yeah, I remember the pep that introduced that functionality

tulip sleet
#

see the comment there. I researched this a bit and it seemed like the easiest way. Since msys2 does not depend on a "system" python as far as I know, this seems ok (unlike, say, doing that on an ubuntu base system)

stuck elbow
#

it's a virtual machine anyways, so you don't care about mangling system packages

#

I mean, single-purpose virtual machine

tulip sleet
#

the alternative is to set up and use a venv in each instatiation, but I haven't found a simple recipe for that in msys2

#

I didn't find many people with similar problems (yet). But I think I was one of the first to hit this due to Github CI updates in combination with msys2 updates

stuck elbow
#

or use --user?

#

you can also just delete the file from /etc that contains that message