#circuitpython-dev

1 messages · Page 40 of 1

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0-rc.1 on 2023-06-27; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi
wifi.radio.hostname = 'some-long-value'
print(wifi.radio.hostname) # some-long-value
wifi.radio.hostname = 'a-value'
print(wifi.radio.hostname) # a-valueng-value

Behavior

The value of wifi.radio.hostname is not replaced by the new value, but replaced.

Description

No response

Additional information

_No resp...

willow totem
#

I'd like to propose a docs change, or a functionality change. The docs currently say supervisor.reload performs the equivalent of ctrl+d. It's right above supervisor.set_next_code_file which is what I wanted. I read that and then ran something to set code2.py next. Then I typed supervisor.reload in the repl and nothing happened. Can we add to the supervisor.reload section (or maybe as a last point to set_next_code_file) that supervisor.reload doesnt work from the repl and you have to use ctrl+d.
Instead of the docs change can I suggest supervisor.reload could be made to work from the REPL too. It was explained to me there are possibly good exception catching reasons that are useful to the REPL that maybe prevent it working, so path of least resistence is probably a docs warning that could prevent other tired/confused users from losing time over it.

tulip sleet
manic glacierBOT
#

I wanted to reload into code2.py. I used the built in serial monitor in vscode which has a ctrl-c button (it has a dropdown to switch to ctrl+d/z/etc), I used it to escape my code.py file and then imported supervisor.
I setup with supervisor.set_next_code_file('code2.py', reload_on_success=False, reload_on_error= False, sticky_on_success= True, sticky_on_error= True, sticky_on_reload= True)
then used supervisor.reload()
nothing happened. I expected it to soft-reboot. I daren't use microc...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi
import mdns
import socketpool
from adafruit_httpserver import Server

# set SSID and pwd in settings.toml

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, debug=True)
try:
    mdns_server = mdns.Server(wifi.radio)
    mdns_server.hostname = wifi.radio.hostname
    mdns_server.advertise_service(service_type="_http...
lone sandalBOT
manic glacierBOT
#
import wifi
import mdns

try:
    mdns_server = mdns.Server(wifi.radio)
    mdns_server.hostname = wifi.radio.hostname
    mdns_server.advertise_service(service_type="_http", protocol="_tcp", port=80)
except RuntimeError as e:
    print("MDNS setting failed:", str(e))

Works if web workflow is not enabled in settings.toml, but not if web workflow is enabled.

mDNS only allows one service_type and protocol per port, and web workflow automatically sets up an HTTP (TCP)...

lone sandalBOT
manic glacierBOT
#

I have started working on a canio implementation for the Teensy Micromod (mimxrt10xx port).
I am not a circuitpython nor a CAN bus expert but I hope I can make a working version and pass on enhancing and supporting/testing more mimxrt10xx boards (other than Micromod) to others.

I am making this git issue to track/publicize my work (according to this forum reply: https://forums.adafruit.com/viewtopic.php?p=978568#p978568)

If there is any CAN bus expert who could do code review or make s...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
thorny jay
#

I just received the Python on Hardware mailing: "Python on Microcontrollers Newsletter: CircuitPython 8.2.0 Stable Released" but that is like one day too early. Is there something special, or it is the 8.2.0 special edition?

random junco
thorny jay
#

I was ready to announce you all and Anne about my new project: https://github.com/dglaude/Mouse_Jiggler_Trinket_M0/tree/main
Given the plan for this evening (I am in Europe), I don't even have time to finish or fill the meeting notes.
But if anybody want to have a sneak preview or has comment on the code, I can improve that for next newsletter and do my usual Mastodon / Twitter post about it.

GitHub

Ultimate mouse jiggler that you enable or disable from your computer keyboard - GitHub - dglaude/Mouse_Jiggler_Trinket_M0: Ultimate mouse jiggler that you enable or disable from your computer keyboard

#

It is the ultimate M0 based mouse jiggler.

random junco
lone axle
#

<@&356864093652516868> We look forward to hearing from everyone during the weekly meeting after the week off last week. The meeting will be held here on discord in the CircuitPython voice channel at the usual time of 2pm Eastern / 11am Pacific which is just over 1 hour from now. You can fill in any notes you have to the shared document: https://docs.google.com/document/d/1ajdwXoubhG86rUVabqTcEzHvOKfUgK9TgPdDxqBDlSc/edit?usp=sharing. See you there.

onyx hinge
#

@candid sun btw there is a way to do "more natural" (and more efficient) asyncio on keypad events but it needs a weird block of code.. https://github.com/adafruit/circuitpython/pull/6712

The weird block of code has never been put in a library/module/package or anything

If you are interested in this and want to learn more feel free to ask, but you don't necessarily need to do it that way.

GitHub

This allows a small wrapper class to be written
class AsyncEventQueue:
def init(self, events):
self._events = events

async def __await__(self):
    yield asyncio.core._io_q...
candid sun
#

cool, thanks @onyx hinge !

onyx hinge
#

is there still time for a mic check? I'm on a different computer.

idle owl
#

@onyx hinge I think you had an echo, and you're a bit loud.

onyx hinge
#

I tried turning on echo cancellation, hopefully it's still good

idle owl
#

Not a preview for this week's newsletter and the next two issues! (They will go out at 11am on Monday.)

onyx hinge
idle owl
#

Hooray! 😊 🎉

slender iron
#

gotta start somewhere

lone axle
#

I started a basic input text for displayio at one point. But realized how complicated cursors really are once I got into it. Mine ended up very wonky.

onyx hinge
ember iris
#

I have two SCD41's, and one SCD40

onyx hinge
#

thanks all!

gilded cradle
#

Thanks

idle owl
#

Thanks, everyone!

ember iris
#

Thanks all! Have a good week!

slender iron
#

I wonder if new boards are enough of a reason to do 9.0 off main

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 Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/10AzCwaac8jCgfUiFIPchwTghFqHptCV99iMCsZfxAwo/edit?usp=sharing

slender iron
#

are we ready for an 8.2.x milestone? seems like a couple of these new issue could go there

onyx hinge
#

@slender iron seems fine by me!

tulip sleet
#

I'll make one

slender iron
#

thanks!

mental nexus
slender iron
#

@mental nexus how did you handle switching between running code and editing it?

onyx hinge
#

ooh pye doesn't look too shabby

#

@mental nexus how'd your cursor work? A non-flashing block cursor would be fine as a starting point for me.

#

I guess that project's not displayio based is it

manic glacierBOT
#

I think you need to list the flash chip of all revisions here, separated by commas:

EXTERNAL_FLASH_DEVICES = "ZD25WQ16B, W25Q64JVxQ"

Otherwise, I think that running this on an older revision board with the ZD... chip would fail.

Typical example from an adafruit board:

ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"

The syntax seems to be written "A","B" in some places and "A, B" in others. I'd u...

onyx hinge
#
…/capablerobot_usbhub/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JVxQ"
…/stm32f411ce_blackpill_with_flash/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = GD25Q16C,W25Q64FV,W25Q32JVxQ,W25Q64JVxQ
```It's probably not HURTING anything that we use all these syntaxes, assuming they work ...
slender iron
#

¯_(ツ)_/¯

#

@onyx hinge any thoughts on how to handle a usb_host.Port living longer than a VM?

#

with displays we require you to release them

#

I wonder if we should just automatically release at next use

#

or something like that

onyx hinge
#

can they just be created each time the VM starts?

slender iron
#

they could but it throws an in-use error now

mental nexus
onyx hinge
#

I have had some Ideas about replacing supervisor allocations with objects that can live through VM resets, and maybe can re-locate/compcat when the VM is reset, but it is in the "this is an idea" stage rather than something that's implemented.

slender iron
#

the other idea I had was to force it into boot.py

onyx hinge
#

and then of course there are the way that board.SPI / board.I2C work, would that model fit at all?

slender iron
#

if the board has usb host natively, it can do it in board_init()

onyx hinge
#

since I've concentrated on the host keyboard stuff I haven't actually used usb_host.Port

mental nexus
slender iron
#

@onyx hinge you could have a cursor tilegrid that you blink on top of the regular terminal

mental nexus
#

Yep looks like I just have a white rectangle behind a black character.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi

for network in wifi.radio.start_scanning_networks():
    str(network.ssid, "utf-8"), network.rssi, network.channel))
wifi.radio.stop_scanning_networks()

Behavior

Does not detect an iPhone personal hotspot - set with "Maximize Compatibility"

Is this a function of the WiFi chip or the hardware or an Apple issue. Needless t...

manic glacierBOT
#

I was also getting issues when using ESPNow to communicate between a ESP32-S2 and a S3. In all this, I found that the initialization need to be a bit different between them.

For ESP32-S2, the initialization need to be this (see that I am communicating with 2 different ESP32 boards, one with ESP32-S3 and other with ESP32-S2):

# MAC Address value needed for the wireless communication
my_mac_address = [0x68, 0xb6, 0xb3, 0x01, 0xf7, 0xf3]
mac_address_power_switch_board = [0x68, 0...
onyx hinge
#

@slender iron a different, wired keyboard was still working (accepting keystrokes) after running overnight.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I will review this, but I have a hw question: why use parallel shift registers instead of chaining them as a single long shift register? Is it to reduce latency?

No in this case there are 4 independent and optionally connected button controllers. Each button controller has 32 switches (4x HC165 chained) and has a free independent physical location. All max 4 controllers are individually connected to the same control board with a 2meter wire (with 5 strands). So save 3x latch+clock pins o...

manic glacierBOT
manic glacierBOT
manic glacierBOT
supple gale
# manic glacier

That makes sense. ‘’’ Note
Personal Hotspot uses a 5 GHz connection by default. On iPhone 12 or later, you can turn on Maximize Compatibility for Personal Hotspot to use a 2.4 GHz connection. Turning on Maximize Compatibility might reduce internet performance and Wi-Fi security for devices connected to the hotspot. For more information, refer to If Personal Hotspot is not working on your iPhone or iPad (Wi-Fi + Cellular).

onyx hinge
#

do you have a philosophy about whether supporting e.g. USB MIDI would be done using pure Python code, or if it'd have C code in the core?

onyx hinge
#

@slender iron I tried to use my USB MIDI device from CP but didn't have success.

Here's the code I can run on my host computer: py import array from usb.core import find, USBTimeoutError dev = find(idVendor=0x1c75) b = array.array('B', [0] * 8) while True: try: r = dev.read(0x81, b, 10000) print(r, b) except USBTimeoutError: print(end="...") (I have to run it as root and also "unbind" the kernel driver in the linux way: root@bert:/sys/bus/usb/drivers/snd-usb-audio# echo 1-1:1.2 > unbind)

On CP with rp2040 usb host feather, it just hangs at the dev.read call.

On Linux it prints something whenever I press a key on the MIDI keyboard, turn a knob, etc.

slender iron
manic glacierBOT
#
[adafruit/circuitpython] New branch created: qtpy_esp32s3_4mbflash2mbpsram
slender iron
#

@onyx hinge what device is it exactly?

onyx hinge
#

@slender iron it's an Arturia minilab 3 midi keyboard, it was recommended by todbot and jp for synth stuff

slender iron
#

👍 I have some midi keyboard too I think

onyx hinge
#

I'm about to head out to help a friend, so itmya be the afternoon before I'm back

#

and when I come back I want to test the rp2040 metro prototype, probably won't get back to USB immediately

slender iron
#

I just got back from the daycare run so I'm just getting going

onyx hinge
#

we can talk more later, whether today or later in the week!

manic glacierBOT
slender iron
#

any objection to me merging in the current usb host code?

#

(jeff approved it)

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
warm stump
#

The USB-C port on my Macropad just fell off…it had a little bit of a rough time in the theatre.
All is good though, as I repaired it as soon as I got home with some lollipop sticks.

#

It needed a quick reminder of all the sketches that were on it but it’s running again
meanwhile in the theatre…a splash screen?

slender iron
#

@onyx hinge my midi keyboard works mostly

#

(if it times out then it gets wedged)

onyx hinge
#

@slender iron using code similar to what I pasted?

slender iron
#

yup. it is an arturia keystep

#

(I removed the time out)

#

lemme see how many changes I have on my branch

onyx hinge
#

On branch usb_host_keyboard
Your branch is ahead of 'jepler/imx_usb_host' by 1 commit.
(use "git push" to publish your local commits)

#

I have a commit that fixes the trailing '\0' in the device strings, that's all. I made sure submodules were up to date.

#

I was entering the code in the REPL since it tended to freeze the device and be difficult to recover from

slender iron
onyx hinge
#

I also don't know the correct way to find the endpoint number..

slender iron
#

it involves fetching the descriptors and parsing them

#

it should be the same as it is in linux

onyx hinge
#

yeah, lsusb -vv is how I found the endpoint number in linux. but what I meant was, I don't know your plan for how CP code would discover that information..

#

anyway I'll try that code tomorrow in code.py and see if it makes a difference. otherwise, 🤷 , I can just move on to trying something else I guess

slender iron
#

or you hard code it

tulip sleet
#

@onyx hinge do you remember if we adopted some qstr changes from MicroPython early? I am seeing some things in the 1.19.1 merge that seem to be already merged, but the three-way merge is also showing "old" code that is not in the current adafruit/circuitpython. I looked in our PR's but could not find anything. There is a lot of restructuring of qstrs and their generation in this merge (separating out the hashes and length, for instance).

#

the last stuff is not our code. It's some other stuff that seems to be already incorporated

#

maybe this is just some peculiarity of three-way merge going back in time because there's a merge conflict

onyx hinge
#

@tulip sleet no that doesn't ring a bell right now

tulip sleet
#

thanks anyway

proven garnet
#

Looking at patching up the Learn Guide repo for a few things, among them the releases. I happened to notice that releases aren't being created for it, and it lines up with with the permissions update you did @tulip sleet for preventing non-PR pushes. Can we make adafruit-adabot have Maintain status for that repo? That should fix it I think.

manic glacierBOT
tulip sleet
proven garnet
manic glacierBOT
manic glacierBOT
#

I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?

I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just seem to be renamings.

If anyone feels like doing a bisect, that would be great. Maybe start with 8.0.0-alpha.1 and see if that fails, and then bisect main vs that. But it requires an experienced builder. An alt...

manic glacierBOT
#

Thanks for the support
I’ll check all the versions (alpha and beta)
And find which version it fails
I’ll let you know
-parsa

On Jul 12, 2023, at 4:49 PM, Dan Halbert @.***> wrote:

I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?

I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just se...

manic glacierBOT
#

Hello again,
The problem occurs on 8.0.0-beta2

It woks fine on 8.0.0-beta1 and previous versions
Thanks
-parsa

On Jul 12, 2023, at 4:49 PM, Dan Halbert @.***> wrote:

I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?

I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just seem to be renam...

manic glacierBOT
candid sun
# onyx hinge <@347203168121126912> btw there is a way to do "more natural" (and more efficien...

hihi @onyx hinge looking into this and hitting a wall with keypad and seesaw. it doesn't seem like there's a way to pass seesaw pins like GPIO pins to keypad? there is a seesaw keypad class (https://docs.circuitpython.org/projects/seesaw/en/latest/api.html#adafruit_seesaw.keypad.Keypad) but i think it has to be part of the device firmware, which the quad rotary encoder doesn't have or at least i wasn't able to get it working

onyx hinge
#

@candid sun the idea was that the interrupt pins, which would be a Pin object from the board module, are what you'd be giving to the Keypad constructor .. maybe I don't know how the interrupt works, though. If it's not working, maybe better to move on than try to make it fit my half-baked ideas.

#

not the "press in to click" functionality

#

I don't have any of those boards so I can't do any testing/playing of my own

candid sun
#

oh i see, i'll try the interrupts. thanks!

onyx hinge
#

don't spend too much time on doing it "my way", if you see other ways of getting to your goals

candid sun
#

right now i kind of feel like my brain is getting turned inside out trying to understand asyncio so i might also need a lunch break haha

onyx hinge
#

that state does wear off .. eventually. and I still never reach for asyncio "by default", so in that sense I've never gotten super comfortable with it.

manic glacierBOT
tulip sleet
manic glacierBOT
#

Anyway in that video you casually mentioned eventually being able to connect a USB device to an ESP32-S3 Feather and use it with an iPad over Bluetooth. I am looking into possibly doing that for my ZSA Moonlander, any ideas on how one would accomplish this feat using circuitPython?

We don't have a device that does usb host and ble unfortunately. So, you'd need to come up with a two device solution for now. (Maybe hid reports over UART would be enough.)

manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron @onyx hinge I am almost finished with the initial v1.19.1 file merging. I haven't even attempted a compile yet. This has been frustrating because some merges, especially in py/, especially the three-way merges, show many changes whose origin is obscure:

  1. who deleted these lines? git blame is very bad at helping you find this out.
  2. was this change something we did, diverging from the original, or does it just reflect some change we haven't picked up yet?
  3. "SPDX" changes that cause a merge conflict but are otherwise not useful. MPy has never warmed to the idea of SPDX (I looked at some closed PR's), and I'm not sure we should bother doing this in files we shared with them. It's not completely done anyway, so automated checking is not possible. I may change these back to minimize the churn in future merges.
  4. We really need to PR back simple changes that MPy would probably be fine with, such as spelling errors, and things like inline -> ``MP_INLINE`.
  5. because of 1 and 2 especially above, I am considering that we might label our changes with at least // CIRCUITPY (possibly bracketed with // CIRCUITPY end or similar and making some further comments as necessary. This makes it clear where the origin of the change came from. I am constantly guessing, relying on imperfect memory, or plowing through github blame to figure these out, and I have to keep repeating that. I think this is really only mostly necessary for core stuff in py/ where we have diverged and may never converge again. It's a waste to time to keep rediscovering who made a change.
  6. I think I will do another difftool merge between the current merge and pristine main tip to handle 3 and 5 before attempting to compile.
onyx hinge
#

sounds like it's been a real slog. I especially agree with trying to upstream more stuff.

slender iron
#

we could upstream stuff until we can submodule mp for the vm

onyx hinge
slender iron
#

any more than doing three merges?

tulip sleet
#

i don't know if we will ever get to the submoduling possibility. there are some changes we've made they won't want back. I think since the last merge we have made more significant py/ changes than usual

#

The current divergences that I'm not sure about are the space squeezing you did, Jeff, in the type tables, traceback improvements, some different handling of properties, long-lived, some generator changes that may be partly related to async differences, and maybe a few other things. I still have to revisit objgenerator.c because it is so different. That is the last file that is not really merged.

#

also not relying on extmod/ at all would be great: there was a lot of churn in os and sys this merge. Of course that means we also can't "just merge" the imrpvoements from upstream

#

also there were a number of specious merges, where some random file that vaguely resembled our file was merged, despite not even being in the same directory. This may hav been due to a file move that git somehow was aware of, but not all seem like that. I don't remember specious merges like these from previous merges

onyx hinge
#

long-lived allocators & the stricter generator/async distinction are two core differences I don't think we'd ever sell them

onyx hinge
tulip sleet
#

hunh! I had not heard of this.

#

meld is my friend 🙂

#

but still hard to track things. I have clicked on arrows a few thousand times, but nothing like this

onyx hinge
#

this doesn't replace the "mergetool", it just a way of scripting the finding of "smallest possible conflicts" by going along the changes on either side of the merge

#

there are apparently ~600 merge commits on the micropython side since our last merge and ~1000 merge commits on our side, and it wants to try every pair and have you resolve each conflict that arises. It appears not to scale well.

tulip sleet
#

got it, just not sure whether this would help. I'm confused about whether it shows intermediate merges or not

onyx hinge
#

it does but almost each micropython change has some conflict, of a "we deleted, they changed" type.

tulip sleet
#

what I would really like is to be able to click on a conflict and get directly to the commits that caused the conflict

onyx hinge
#
CONFLICT (modify/delete): ports/rp2/machine_i2c.c deleted in HEAD and modified in 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5.  Version 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5 of ports/rp2/machine_i2c.c left in tree.
Automatic merge failed; fix conflicts and then commit the result.

Original first commit:
commit 01cabb0324186808c14ec1b02fb8a3be28837160
Merge: ddfcfca65d da4b38e756
Author: Jeff Epler <jepler@gmail.com>
Date:   Tue Feb 15 12:36:26 2022 -0600

    Merge tag 'v1.18'
[long log deleted]
Original second commit:
commit 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5
Author: Damien George <damien@micropython.org>
Date:   Thu Jan 20 16:43:55 2022 +1100

    rp2/machine_i2c: Provide more specific error codes from I2C transfer.

for instance it'll stop like this, after trying ~1000 individual merges .. After accepting the deletion with git mergetool, it starts again with the next commit from micropython, which will also have a conflict 😕

#

it's a cute idea but I don't think it works out with CP's git history

#

mmmmaybe if it was modified to run scott's conflict-fixing script and only treat the merge as failed if there's still a conflict

tulip sleet
#

I don't think that more automation is going to help me. It is mostly more information I need. Then I need to study the breaking changes and figure out how to incorporate them into code we have already changed.

onyx hinge
#

in principle this tool tells you what you want: this conflict is caused by THIS commit on their side and THIS commit on our side... but the reality is different

tulip sleet
#

yes, I would live a GUI difftool that does that.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
rancid pilot
#

Quick question: is there a way to expand the "default" ringbuffer? It can be found at "/py/ringbuf.h". It stores type uint8_t.

#

So far I made my own but it might not be needed?

#

Is it okay to add a second ringbuffer impl?

spare jacinth
# rancid pilot

That is not storing a u8, but a pointer to u8, namely an array with many u8's allocated. Based on the other fields being u32's, its likely to have a big size (or at least being able to have it)

What's exactly your intention/change with the custom implementation?

rancid pilot
#

I would like to store canio_message_obj_t.

#

CAN.c creates an rx fifo via the FlexCan SDK. It automatically uses message buffers and can id filters and gives me back a FlexCan frame in a callback (interrupt) where I convert the frames into canio_message and place them in a ringbuffer. Then the Listener.c in common_hal_canio_listener_receive would just grab the next element from this ringbuffer.

#

The problem I would like to solve is that the SDK expects to process the frame/message in the callback, but canio interface uses polling to consume the messages with the Listener method(s).

manic glacierBOT
rancid pilot
#

ahh, never mind, I can see how others are using it

manic glacierBOT
#

so the NeoPixel MPY should be included in the firmware.

This not in general a policy for boards. For Adafruit boards, we add frozen libraries for boards when we are worried about RAM space, which is not a worry on the RP2040. The disadvantage of freezing is that it uses up firmware space, and the library is frozen at a particular version. The user can override a frozen library by putting a version in /, instead of /lib, because sys.path by default is ['', '/', '.frozen', '/lib']....

manic glacierBOT
#

https://forums.adafruit.com/viewtopic.php?t=202975

User tried to use os.getenv() on a Trinket M0. Fetching from settings.toml is turned off on SAMD21 boards for space reasons. However:

  • This is not documented anywhere. Fix that.
  • Suggest we raise NotImplementedError for os.getenv() when CIRCUITPY_OS_GETENV = 0 instead of just returning None. os.getenv() is useless when CIRCUITPY_OS_GETENV = 0, and raising an error would make that more obvious.
manic glacierBOT
spice gate
#

hello, I'm having a hard time making CircuitPython run on a custom board based on the nRF52840 (MicroPython works without problems though, so it's not something hardware-related). CircuitPython boots but never gets to the USB CDC serial console. I've tried both with internal and external flash storage, with or without HF/LF crystals. It seems to hang the moment it gets to setting up the filesystem. Any ideas on what to try next ?

#

(this is 8.2.0, up-to-date build system on OSX based on ARM GCC toolchain , Adafruit Bootloader running the show and working just fine )

manic glacierBOT
midnight ember
#

Based on the adafruit_st7789 circuit python driver. It does not exist in the adafruit 8x or community bundle.

#

Currently named adafruit_st7796, should i name it something else to submit to the community bundle?

#

or submit to the circuit python library as adafruit_st7796?

#

It's my first display driver so unsure how to proceed. It's not an adafruit display it's something I got from aliexpress.

#

So maybe circuitpython_st7796 instead and submit to community bundle?

idle owl
midnight ember
#

Use that format structure?

#

Do I need to install cookie cutter? This is becoming more complex than I thought.

idle owl
midnight ember
#

I just copy/pasted from the GC9A01 example. It's not from cookie cutter but looks relatively enough the same.

idle owl
#

@onyx hinge Do you have a moment for a question?

onyx hinge
#

sure

idle owl
#

I realise it is obvious, but it's breaking things so I'm confused.

onyx hinge
#

probably intended to convert from seconds to milliseconds

idle owl
#

Ohhhh.

onyx hinge
#

but of course ping can return None ... in which case that's not so great

idle owl
#

Right.

#

It's fine, it prints "none" I think

#

IS ping seriously returning seconds by default?

#

I thought it was ms?

#

is what printed this last run.

#

I can add code to make it say it failed.

#

Not certain how complicated I want to get here.

midnight ember
#

If I don't use cookie cutter will circup still work with it? I don't use it just thinking about others.

#

I'll try to sit down and do a real cookie cutter version of it someday. The way it's formatted right now doesn't play nice with windows Git desktop application. Git says it's can't find my repo, I think might have something to do with the copy/pasted .git ignores.

#

Is there a learn guide on how to submit a new library to the community bundle?

idle owl
rough folio
#

@plucky tulip
Figured I should put thoughts on https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/pull/63 here and not in the help channel

Feels like this should definitely be two PRs, or a stacked PR though. Websockets are a pretty distinct functionality

But just addressing the routes aspect-
The key thing missing here is a way to get state in the route. For example-

main.py

import routes

something = Something()
server = Server()

server.route(...)
def handle(...)
   something.do_thing()

server.add_routes([routes.otherroute])

routes.py

def other_route(request):
   <no way to access `something` or other objects not in scope>

otherroute=Route(..., other_route)

#

I also don't see that there's a clean way to define routes here either
like the ideal setup would be a route decorator that I can use in other modules

#

so the above example would be

@route(...)
def other_route(request):
slender iron
#

FYI jimmo said on the MP discord they hope to release 1.21 in the next week

rough folio
#

the key thing is when calling the route it passes the server object not just the request

#

which allows me an injectable state

#

to refrain from a breaking change the state could be added to the request object or passed as a kwarg

#

also added some syntaxy sugary decos like @get("/path")

#

also instead of putting closes everywhere I bet you could change poll's context manager close so it figures out if it's doing a websocket and shouldn't close

manic glacierBOT
still zephyr
midnight ember
#

Yeah just read that part. A lot more involved to contribute to the community bundle than I realized. Everything has to be done with CLI git really. Can't use desktop git for something like this.

#

Contributing adafruit_requests examples is a cakewalk compared to contributing a new library.

#

It's more like creating a custom build of circuit python, which I've done once. There's a lot of moving parts and hoops to jump through.

still zephyr
#

yes is a little different, but cookiecutter helps with all the behind the scenes, and if you follow the learn guide it will be ok. if you need help let me know :).

midnight ember
#

thank you, i don't have time to do this today. will likely give it a shot tomorrow because i do want to contribute my first real display driver.

still zephyr
#

If you dont want to use cookiecutter coy the .github/workfloes directory

#

Yeah ill be around 🙂 ping me when needed or DM if you want

slender iron
#

Gnu unifont emoji. Larger font 8x16 instead of 6x12

onyx hinge
#

emoji is kinda neat. are you hatching a plan to fix the horizontal space between the letters?

solar whale
#

I've run into a funky issue with the RP2040 RFM9x board and I'm wondering where to open an issue (with CP or the RFM9x library) I am experiencing USB disconnects when transmitting (especially at high power). On my MAC, the MAC will often freeze until I disconnect the board from USB, then it recovers. On a Raspberry Pi, l Ijust see brief disconnects on the USB (via tio)... Has anyone else seen anything like this? Any suggestion as to where to open an issue?

solar whale
#

This may well be a power supply issue... much more testing to do. I have never seen i with other RFM boards though. When I have a clean example, I'll post it in #help-with-radio -- already started a discussion there.

slender iron
#

we'll use more flash space in small builds to store the taller font

#

(and wider)

#

also brainstorming colors

#

less seriously

#

the monochrome terminal could be more endearing

onyx hinge
#

right now my big wants are:

  • I don't think it's possible to print a character in the lower right of the screen and not scroll
  • block cursor
  • reverse video would be nice, and provides a way to do block cursor
    Full 16bg + 16fg colors is way after that, but those three items would really enhance the usability of the screen-based editor
#

struggles to get discord to render a list of points

slender iron
#

what do you mean by reverse video?

idle owl
#

Am I seeing correctly that the settings.toml provided by CircuitPython on a fresh install is completely empty?

#

For some reason I thought it had starter boilerplate.

#

@slender iron Is that expected, or is there something odd about the install I did a minute ago?

slender iron
#

I think it is empty normally

idle owl
#

Ok excellent. This works out well for me. 😄

#

Thanks!

slender iron
#

turns out I broke safe mode entry on rp2040 with my picodvi work

idle owl
#

OMG.

slender iron
#

(via reset pin)

idle owl
#

I have been fighting with that for so long..........

#

I thought it was me. Dan kept telling me it was possible, but I couldn't get it to work lately.....

#

I have been flash_nuking all of my RP2040s as I keep messing up the disabling of CIRCUITPY.

slender iron
#

sorry!

idle owl
#

Nah, no worries, I'm simply hugely relieved over here to know it wasn't a me-problem. 😄

slender iron
#

feels an 8.2.1 coming on

pallid creek
manic glacierBOT
#

The picodvi PR #7880 switched the saved word to the watchdog register since it reworked the RAM layout. This works for reset_into_safe_mode because the watchdog scratch registers are preserved by soft resets. They aren't preserved for pressing the reset button. So it broken manual safe mode. Switch back to using RAM to store the saved word but use the pico-sdks "uninitialized" designation instead of a fixed location.

Also fixes USB host feather status neopixel by setting the power pin.

plucky tulip
# rough folio <@699200371909853216> Figured I should put thoughts on https://github.com/adafr...

I see what you mean, but in my opinion accessing variables that are not in scope is not really a good design practice, it would be better to have a server initialized in separate file, then importing it in code.py and routes.py. This way we can keep everything separated, while also giving access to the server for routes that are in other files, which is pretty much exactly the behaviour of decorator that you can use in other modules.

When it comes to passing server object and not only request, I am not sure whether I understand correctly, but you can access it now by using request.server. https://docs.circuitpython.org/projects/httpserver/en/latest/api.html#adafruit_httpserver.request.Request.server

rough folio
#

Didn't know that request.server existed whoops
That said I have no idea what you're saying in the first paragraph

plucky tulip
#

@rough folio Something like that, probably with more finesse, but it is just a proof of concept.

server.py
from adafruit_httpserver import Server

# connecting to wifi etc...

server = Server()

routes.py

from server import server

something = Something()

@server.route(...)
def handler(...):
...

code.py

from server import server
import routes

server.serve_forever()

#

EDIT1: wow, Discords support markdown headers, didn't know about that

onyx hinge
#

@slender iron I mean that colors 0/1 would be swapped. It's a common way that cursors were implemented on old platforms, by setting an otherwise unused bit in the display RAM. Sometimes it was the high bit of the character (ASCII was assumed in those days) or a separate attribute bit.

#

and yeah you'd trigger it by sending a VT escape sequence

#

the 2nd row of text here has some "reverse video"

slender iron
#

tile grid can't do that unfortunately

#

probably simpler to have terminal manage a cursor tilegrid and move it around

onyx hinge
#

yeah that's another approach that would require less change in the core.

slender iron
#

otherwise you'd need pallete per tile indirect I think

onyx hinge
#

Or a pallette offset

rough folio
# plucky tulip <@129855424198475776> Something like that, probably with more finesse, but it is...

I'd call this pretty odd honestly
like, every lightweight api framework out there I know of (flask (through blueprints), litestar, starlette, fastapi) doesn't do this but instead opts for the "define route object, import, add to server object" method. I've got no idea how this would play with lazy importing either- and it would preclude or make fairly difficult defining the same route for multiple server objects but IDK how realistic that need is. Oh, and adding routes dynamically would be a fair bit trickier too come to think.

Though my initial example missed a detail of adding something to server which I now realize would be injected in the request so you could do request.server.something in the route handler which I think is what you were talking about with variables-out-of-scope

For a direct example with the hack I did (pardon the lazy form parser...)

@post('/pid-update')
def pid_update(request:Request, server:Server):
    req = request.body.decode()
    match = re.match('Kp=(\d+)&Ki=(\d+)&Kd=(\d+)', req)
    if not match:
        raise Exception(f'failure to match, {req}')
    pid = server.state.trickler.pid
    pid.Kp = int(match.group(1))
    pid.Ki = int(match.group(2))
    pid.Kd = int(match.group(3))

    print(f'updated pids to {pid.Kp=} {pid.Ki=} {pid.Kd=}')

    return Response(request, '', content_type='text/html')```

and then I can just import `pid_update` and add it as a route whereever to whatever server I like

in this case `state` is a fairly thin class that I enclose the global state and various sensors in for access throughout the project. 

plus this implementation is really straightforward because all you do is move the route decorator from the server and add a route-registration method - `post` is just a thin wrapper around the original deco that has the method pre-set for handiness
plucky tulip
#

@rough folio Nevertheless, you would have to use the state in routes and hope it will be populated somewhere else, in other module, there is also a problem with typing such class.

#

I never encountered something like adding state to server, seems to me like low cohesion of Server in this case, but I have the most experience with Django and some with Flask, don't know how Fastapi handles that.

crimson ferry
#

Would it be expected that espidf.MemoryError: survives a reload?

rough folio
#

it's not too hard to type- you can just do

if typing.TYPE_CHECKING:
  class Request(Request):
     state:State
plucky tulip
#

Example from Flask docs, similar to my approach:

rough folio
#
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound

simple_page = Blueprint('simple_page', __name__,
                        template_folder='templates')

@simple_page.route('/', defaults={'page': 'index'})
@simple_page.route('/<page>')
def show(page):
    try:
        return render_template('pages/%s.html' % page)
    except TemplateNotFound:
        abort(404)```

from flask import Flask
from yourapplication.simple_page import simple_page

app = Flask(name)
app.register_blueprint(simple_page)```

plucky tulip
rough folio
#

as it so happens I did lol

#

the way I structure this is basically like

class State:
  def __init__(self, sensor:Sensor):
    self.sensor=sensor
 .....

etc

#

makes a handy global state that I can fiddle with in a repl etc

plucky tulip
#

This is a problem with Django setting for example, where you use a child but it is not statically defined, so it works, but is not looking good

rough folio
#

I also tend to have a "default init" staticmethod that returns the class with the sensors initialized for use in a repl when debugging stuff

#

and then some .update() method which calls .update() on the state's children for some sort of async programming

#

but that's just how I style these

plucky tulip
#

I would have to take a look at these Blueprints, although I believe the approach with importing server into multiple files where it is needed is more Python like, not lib specific

rough folio
#

I can even point at non-web libs that use this pattern lol

#

like discord.py for example off the top with it's cogs

#

flask's default method assumes an amount of ownership over everything that the module is a webserver first and other stuff second imo

plucky tulip
#

Would you be open to discuss it later this week? Right now (~1AM where I am) I think I am unable to fully understand the point you are making.

rough folio
#

haha, fair enough

empty stirrup
#

In case someone sees something I messed up: from a fresh install of CP (commit-id: 8de9d5a52) I run make -C mpy-cross, then make fetch-all-submodules then cd ports/unix; make axtls then make micropython This results in a compile error:

In file included from ../../extmod/ulab/code/numpy/vector.c:15:0:
../../extmod/ulab/code/numpy/vector.c: In function ‘ulab_sinc1’:
../../extmod/ulab/code/numpy/vector.c:580:20: error: conversion to ‘float’ from ‘mp_float_t {aka double}’ may alter its value [-Werror=float-conversion]
     if (fpclassify(x) == FP_ZERO) {
                    ^
../../extmod/ulab/code/numpy/vector.c:580:20: error: conversion to ‘float’ from ‘mp_float_t {aka double}’ may alter its value [-Werror=float-conversion]
     if (fpclassify(x) == FP_ZERO) {
                    ^
cc1: all warnings being treated as errors
../../py/mkrules.mk:62: recipe for target 'build-standard/extmod/ulab/code/numpy/vector.o' failed

It seems that mp_float_t is typedef'ed to double and for whatever reason fpclassify wants floats

manic glacierBOT
digital shoreBOT
#
adafruit
Owner

.adafruit#0

Category Channels

8

Text Channels

63

Voice Channels

7

Members

37539

Roles

38

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico with rp2040

Code/REPL

>>> 
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== b_label = "Bat V"
=== b_value = "4.86"
=== t_label = "T/AHT °C"
=== t_value = "23.6"
=== "{label:4.4}".format(label=b_label,value=b_value)
=== "{label:4.4}".format(label=t_label,value=t_value) 
'Bat V   :4.86'
'T/AHT °:23.6'
>>>

Behavior

n.a.

Description

The format-specif...

#

CircuitPython version

Adafruit CircuitPython 8.2.0-19-g8de9d5a52 on 2023-07-13; Raspberry Pi Pico W with rp2040

Code/REPL

import os
#import ipaddress
import wifi
import socketpool
import ssl
#import adafruit_requests
import time
import board
import digitalio
import adafruit_minimqtt.adafruit_minimqtt as MQTT
import microcontroller


WIFI_SSID = "mySSID"
WIFI_PW = "myPW"


MQTT_SUB_TOPIC = "mySubTopic"
MQTT_PUB_TOPIC = "myPubTopic"
HA_MQTT...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; DFRobot Beetle ESP32-C3 with ESP32-C3FN4

Code/REPL

>>> from collections import OrderedDict
>>> d = OrderedDict.fromkeys('abcdefg')
>>> ''.join(d)
'agcbdef'
>>> type(d)

>>>

Behavior

  • The returned type should be - instead of
  • The object should return sorted keys ('abcdefg'), instead it is in unsorted dict order ('agcbdef')

Description

No response

Ad...

manic glacierBOT
#

The current rp2 micropython gives me

=== b_label = "Bat V"
=== b_value = "4.86"
=== t_label = "T/AHT °C"
=== t_value = "23.6"
=== "{label:<8.8}:{value:>4.4}".format(label=b_label,value=b_value)
=== "{label:<8.8}:{value:>4.4}".format(label=t_label,value=t_value)
=== 
'Bat V   :4.86'
'T/AHT \xb0:23.6'
>>> 

b0 is the extended ascii value of °, so it seems this bug is also present in micropython.

manic glacierBOT
#

It has been stale for over 2y. Is there any news on this?

Just to confirm, is all that people want is a CircuitPython Library that does DMX control? Nothing more that this?

if i think about it for a moment -
i can imagine three simple scenarios:

  1. DMX receiving - so the CP device can act as device in an event/stage enviroment
  2. DMX sending - simple just some channels in a buffer that get send manually or automatically every x ms
  3. DMX sending - API compatible to use it w...
solar whale
#

FYI -- I'm not sure whose attention to bring this to, but I think there is a real issue with interference between the radio and the USB ports on the RP2040 RFM9x board -- see this thread #1129476234678632540 message It has been bugging me for quite awhile but I finally got around to doing some more testing and I think it is real. Comments/suggestions welcome. I have not tried it under Arduino yet to see if it occurs there -- Adding that to my "todo" list.

crimson ferry
solar whale
#

oooh! -- good point

#

I does appear to also be an issue under Arduino so not a CP issue.

manic glacierBOT
slender iron
#

@solar whale I think we saw something similar on one of the other rp2040 boards

solar whale
slender iron
#

did you file an issue?

#

I can point limor to it

solar whale
slender iron
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This does not appear to be a CP issue, but an issue with the HW. It was suggested that an issue be opened to discuss it.

Setting the transmit power to 23 on the feather RP2040 RFM9x board causes issues with USB connections. On my M1 Mac, it causes a disconnect of the CIRCUITPY drive and the board resets. In some cases, it will cause the MAC to "freeze" until the USB port is disconnected.

If I use a Rasberry Pi 400, the USB connection (monitored via tio) often disconnects with eac...

lime trellis
#

Has anyone mentioned (or built themselves) a profiler for circuitpython like FunctionTrace?
https://functiontrace.com/

I could see target micropython/circuitpython audiences benefitting greatly from something like this

graceful rain
#

Hi all, I'm trying to rebuild CP after pulling latest changes (it's been about 2 months), and trying to make fetch-all-submodules but hitting this error. I'm on main. Any suggestions?

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Entering 'ports/mimxrt10xx/sdk'
fatal: couldn't find remote ref refs/heads/master
fatal: run_command returned non-zero status for ports/mimxrt10xx/sdk
.
ERROR: fetch-submodules.sh FAILED
vague thicket
#

Hi, is there way how can I clear displayio group/buffer? Is this (#circuitpython-dev message) only way ho to do it? I work with epaper display so I do not want to write something to the display, refresh it to clear it and then refresh it with new data. Thanks

empty stirrup
#

@graceful rain Iirc there was some move to move from master to main so this error fatal: couldn't find remote ref refs/heads/master seems a bit suspect. Might it be simplest to just start over from scratch?

manic glacierBOT
manic glacierBOT
#

Is it possible that the actual transmission events are too short for the instrument to detect? If the sampling time is significantly longer than the current spike during transmission, it might register as a small average increase in current, while what is actually happening is a large but extremely short increase that gets averaged across a single longer sample. I'm not familiar with the PPK2, but maybe you need an oscilloscope to accurately view the current change (probably via voltage dro...

lone axle
# vague thicket Hi, is there way how can I clear displayio group/buffer? Is this (https://discor...

How do you mean clear the group / buffer?

If you intend to show noting on the display for some period of time (even a small peirod between changing from other things) then you would need to explicitly show "nothing" from the code (an empty group or None should work I think).

But you could also change from whatever is currently showing directly to the thing you want to show next without explicitly "blanking out" the screen inbetween.

Can you describe the type of behavior that you're hoping to achieve a bit more?

manic glacierBOT
manic glacierBOT
#

The PPK2 is sampling at 100,000 samples/sec so I think it resolves the transmission spike - here is a screenshot
<img width="1025" alt="Screenshot 2023-07-16 at 10 17 49 AM" src="https://github.com/adafruit/circuitpython/assets/15856834/dc7b98e3-1f55-449d-88a4-3bf43c1c787a">

I also tried looking at it with a scope and did not see any voltage drop.

I agree that it sure sounds like a power issue, but so far, I can't come up with any evidence.

sterile tundra
manic glacierBOT
#

Another observation... On the Pi400, I have been using a power USB Hub on the USB2 port. If It connect the RP2040 RFM9x directly to one of the USB3 ports, I do not see any disconnects and it is working fine at tx_power=23
I aslo swapped the hub to the USB3 ports and directly connects to the USB2 port and I and now seeing the disconnects with each transmission ....
and If I connect the RP2040 to the USB hub when it is on the USB3 port, I do not see the disconnects....
so at least on the PI ...

craggy plume
#

I am working with Adafruit CircuitPython 8.2.0 on 2023-07-05; Waveshare RP2040-Zero with rp2040.

#

circuitpython 8.2.0 supports alarm.sleep_memory. Documents state the data type of sleep_memory must be byte, which makes sense. But the type returned is int. >>> import alarm

dir(alarm)
['class', 'name', 'SleepMemory', 'exit_and_deep_sleep_until_alarms', 'light_sleep_until_alarms', 'pin', 'sleep_memory', 'time', 'touch', 'wake_alarm']

type(alarm.sleep_memory[0])
<class 'int'>

#

Which is it?

empty stirrup
#

(I don't have a suitable uc to test) what does type(alarm.sleep_memory) return?

manic glacierBOT
#

aargh .. this is extremely frustrating... back on the Pi400, I started seeing disconnects again but after swapping cables and ports, it does appear the such things do matter...
I have it working stably with a direct connection to a USB3 port on the Pi400.

I'm not sure what to think about this now but it still appears that there is something odd with the RFM9x RP2040 board and USB (when using tx_power=23)

Sorry for the confusion...

empty stirrup
jaunty juniper
#

the bytes and bytearray types are arrays of bytes, they contain ints (limited to 0-255)

#

(and are represented as ASCII strings in the REPL, which does confuse people too sometimes)

craggy plume
#

OK. So it is not necessary to convert ints to bytes when assigning to alarm.sleep_memory? i.e. alarm.sleep_memory = 25 should work and only take up a single byte.

empty stirrup
#

yes - looking at the code, that should be fine

empty stirrup
tulip sleet
tulip sleet
tulip sleet
empty stirrup
tulip sleet
manic glacierBOT
tulip sleet
#

@jaunty juniper @drifting hearth @midnight ember I recorded the somewhat unhelpful Too many display busses discussed a few days ago in #help-with-circuitpython as an issue. ⬆️

midnight ember
#

Thank you. Also is it just me... when clicking on the help with alias channel comment links sometimes they take you to a place that's no where close to the actual comment it's referencing?

#

for example that link shows me this

#

which has no mention of display busses

#

but i know the conversation you're talking about and the opened issue 8178 is appreciated.

jaunty juniper
#

yeah it helps sometimes to go back and click the link again, I assume because the convo is already loaded then

tulip sleet
manic glacierBOT
#

I am new at CircuitPython and may be misunderstanding some things.

I am trying to use CP's SPI functions on a Raspberry Pi Pico to access a SPI device (AT93C46D) with a transfer size of 16 bits. When I use the configure method, it reports that only 8 or 9 bits are allowed. I believe this is happening because of the line referenced below.
https://github.com/adafruit/circuitpython/blob/4b4fb47088dca33e85a5eaeb14096aa16692340f/shared-bindings/busio/SPI.c#L202

The datasheet for the RP2...

vague thicket
# lone axle How do you mean clear the group / buffer? If you intend to show noting on the ...

I´m trying to recreate Google calendar PyPortal project but with epaper display and it works this way now:

At start it will connect to Wifi, get user conde for device and show it on the display. Then when I approve/connect device, it will get items from the calendar and displays it on the screen, but now, it does not clear the screen, but just add calendar items "on top" of the previous information. I know that I´m appending calendar data to the buffer with information for device setup and I would like to clear the buffer/group before I would write calendar data to the screen.

I hope that makes sense and in few words, I want display 2 pages with one display group.

lone axle
# vague thicket I´m trying to recreate Google calendar PyPortal project but with epaper display ...

There is a PageLayout helper class that can help with that use case. https://docs.circuitpython.org/projects/displayio-layout/en/latest/api.html#adafruit_displayio_layout.layouts.page_layout.PageLayout There is a basic example of it's usage here: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/blob/main/examples/displayio_layout_page_layout_simpletest.py and a more advanced one within the same directory in that repo.

If you can share the code you're using I could look at it later on and see if I can recomend changes that don't involve using the library, but it kind of depends on what you have so far. Generally, it sounds like you're adding a new group to the visible group without removing the pre-existing one. You could use pop() or remove() functions on Group to get rid of the previous group (or keep it in a variable, but not on the display). You could instead use the hidden property of your Groups to make one visible and the other one hidden. Or you could keep entirely seperate groups and change between them by calling show() or setting the root_group to each different one when needed.

sterile tundra
# tulip sleet This decision was made by the MicroPython folks: not sure why, maybe because usi...

I'd like code to be closer to cpython compatible, to make my life porting things easier, and other peoples. Would it be better to add this desired functionality to circuitpython, or would it only be accepted via upstream micropython? Maybe I should at least pose the question on the micropython github issues, but I have the feeling (no idea) that micropython is less concerned with being cpython compatbile than circuitpython is, that may well be a mistaken impression gleaned from thin air...
I'm not really concerned with adding the functionality as it was only two lines to change to port a driver, but when things work unchanged like magic it's sooo good.

vague thicket
# lone axle There is a PageLayout helper class that can help with that use case. https://doc...

Thanks for your help. You can look at my code (which is not working currently as I have issue with datetime and strftime) here (https://www.dropbox.com/s/92v09j2y54fsqo5/google_calendar.py?dl=0). I will look for sure at PageLayout as I think it will help me organize different items (calendar, weather) on one page. I did not know about pop()/remove() functions but I think they are what I was looking for.

manic glacierBOT
spice gate
#

question: when using external SPI flash with SPI_FLASH_FILESYSTEM = 1 and EXTERNAL_FLASH_DEVICES suitably defined, is there a general assumption that that SPI interface is exclusively used for the filesystem? What's the best practice in CircuitPython when you have a single SPI bus connected to the flash chip and to all other SPI devices on the board ?

tulip sleet
tulip sleet
spice gate
tulip sleet
#

what kind of battery? a 3.7V lipo?

spice gate
#

yes

tulip sleet
#

hmm, our code is assuming 3.3V. (so that should match your use case) ... I seem to remember that there are several ways of wiring up power for the nRF52840, and the use cases are not completely obvious. You might compare your schematic with ours.

#

VDD and VDDH, etc.

spice gate
#

yeah my setup is pretty complicated in that respect due to USB, LiPo, solar panel charger ... I'll look into it. Thanks a lot Danh for your time and feedback.

manic glacierBOT
#

Yeah, 100k samples per second should get the transmission, especially given the length of the spike.

I wonder if it's something with the board's power rails. If the rails have too much resistance, that could limit the current draw, and if that limit is lower than the chip needs at the higher power output, that could cause issues. But then, if that's the case, it should have issues regardless of the power supply... Well, I wonder, what voltages do the different power supplies provide? ...

manic glacierBOT
#

I have verified that if I go in to esp-idf/components/driver/include/driver/rmt.h and do the following:

  •        .carrier_level = RMT_CARRIER_LEVEL_HIGH, \
    
  •        .idle_level = RMT_IDLE_LEVEL_LOW,        \
    
  •        .carrier_level = RMT_CARRIER_LEVEL_LOW,  \
    
  •        .idle_level = RMT_IDLE_LEVEL_HIGH,       \
    

the infrared LED transmitter looks to be behaving properly, visually (through an IR sensitive camera on my phone) however the code that works to control my TV thr...

manic glacierBOT
#

Good suggestions. I'll see if I can monitor the voltage to the RF module.
I interestingly, I noted that there is a difference in the schematics between the RP2040 RFM and the M0 RFM boards in that the there is a 10microfarad capacitor between 3.3v and GND on the RF module for the M0 board, but it is not shown on the RP2040 board schematic. However, looking at the board and the board layout diagram, it looks like the capacitor is actually in place on both. It appears to just have been omitted...

slender iron
manic glacierBOT
manic glacierBOT
random junco
proven garnet
#

Heads up that Node12 is gone for good on GitHub Actions runners starting August 14th! I think we're all set at this point across CircuitPython and Arduino but heads up in general (and your own projects!)

royal rover
#

don't forget timestamps

lone axle
slender iron
#

thanks for doing stats @onyx hinge

#

ari fell asleep on me 🙂

onyx hinge
#

that is the shortest list of library activity I remember seeing! I wonder if it's correct.

onyx hinge
idle owl
onyx hinge
midnight ember
#

Nice to see foamyguy back online

onyx hinge
#

specifically struct "?" format character

manic glacierBOT
#

Different chip families have different SPI frame size capabilities. Eight bits is always availble. RP2040 is unusual in allowing 4-16 bits. Other chips are just 8 bits (e.g., nRF), 8 or 9 bits (MicroChip SAMD), 8 or 16 bits (STM), etc.

If we were writing a library for the AT93C46D or helping someone, we would recommend using an 8-bit frame size, so that the library would usable without changes and without conditional code inside it, across all chips that implement SPI.

So yes, we could ...

onyx hinge
#

newsletter editors are basically Audrey saying "Feed me, Seymour"

mental nexus
#

Online hug for all the efforts on USB host and a CircuitPython editor.

slender iron
#

👍

midnight ember
#

Hope Ari gets well soon.

#

Links to examples of the fonts?

#

a font with more language support sounds good

onyx hinge
silver tapir
#

Those fonts sound interesting, I'll have to test them later with the bribri/cabécar update I have.

onyx hinge
#

@mental nexus nice to see you drop by!

mental nexus
slender iron
midnight ember
#

Cozette doesn't look too different from terminalio so wouldn't be a drastic change, plus the extra language support, looks good to me.

onyx hinge
#

The Bribri are an Indigenous people in eastern Costa Rica and northern Panama. Today, most Bribri people speak the Bribri language or Spanish.
There are varying estimates from government officials of the group's population. Estimates of the total Bribri population range as high as 35,000 people, although official estimates assert there are about...

The Cabécar are an indigenous group of the remote Talamanca region of eastern Costa Rica. They speak Cabécar, a language belonging to the Chibchan language family of the Isthmo-Colombian Area of lower Central America and northwestern Colombia. According to census data from the National Institute of Statistics and Census of Costa Rica (Instituto ...

slender iron
#

cozette doesn't really do more languages but it does do emoji

idle owl
#

I have to run.

midnight ember
#

Unifont looks more industrial, my preference is cozette with all things being equal?

#

if a language isn't supported by terminalio by default i could see how that could be a big problem for certain language

onyx hinge
#

blue on other blue 🙂

#

[the font on those keycaps, yeow]

midnight ember
#

i would actually like to see a 5x5 supported by default too

#

smaller text is better for smaller displays and matrix panels.

silver tapir
#

Thanks for hosting Paul. Nice meeting.

lone axle
#

Thanks for hosting Paul! Have a great week everyone 🎉

midnight ember
#

Thank you for hosting @random junco Great job!

slender iron
#

our current font, terminus is 6x12

onyx hinge
#

http://wenq.org/wqy2/index.cgi?BitmapSong_en

The Wen Quan Yi bitmap font includes complete CJK Unified Ideograph (U4E00 - U9FA5) glyphs at four different sizes (9pt-12X12 pixel, 10pt-13X13 pixel, 11pt-15X15 pixel, 12pt-16x16 pixel) and two weights (medium and bold). Use of this bitmap font for on-screen display of Chinese (traditional and simplified) in web pages and elsewhere eliminates the annoying "blurring" problems caused by the high stroke density of many Chinese characters and insufficient "hinting" of anti-aliased Chinese fonts. This font also provides bitmap glyphs for Japanese Hiragana (U3040 - U309F), Katakana (U30A0 - U30FF) and for Korean Hangul (UAC00 - UD7A3).

midnight ember
#

yup and with smaller font you can fit more lines on any display. you can fit one more horizontal line on a matrix panel using a 5x5 font.

#

you'll be squinting on a tiny SSD1306 with a 5x5 but on a matrix panel it's still quite large.

random junco
#

@lone axle any chance you made a backup recording? I only have my sound, not the speakers.

#

I even thought I tested it before the meeting. 😦

lone axle
random junco
#

Thank goodness, I've got an early hug report. Thanks so much

lone axle
random junco
random junco
#

thanks dan!

random junco
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1Zx4UF48QN6YoRq-qVAJgdsfr-5KW401aJPTYwjxMQns/edit?usp=sharing

spare jacinth
#

hey, i have a couple of aliexpress boards:

  1. https://es.aliexpress.com/item/1005005592730189.html
  2. https://es.aliexpress.com/item/1005003796653297.html black 16MB one with RGB
  3. https://es.aliexpress.com/item/1005004539320086.html "classic" model (not received yet)
    ...which i would like to "port". I dont mind having to fiddle looking for datasheets and whatnot, but i thought it would be somewhat easy to add them to the supported boards list, so less-experienced users could just download a fine-tuned firmware (and can find it with an image of the product instead of matching with similar stuff)

my assumption is that creating a "board" would be pretty much assigning the several aliases for pins, flash size, and perhaps some other config and that i dont need to be affiliated with the companies in any way, but can do it in a community-project way. i reckon that they would probably need unique vid/pid pairs, how to go about that?

confused about the 1st product, as the chip on it is a "regular" one, while all ESP32-S3 images on the download section are enclosed in a metal box, does that mean it is very different? 🤔
second one seems like it could be a clone of https://circuitpython.org/board/weact_studio_pico_16mb/, if it really is, is there some sort of aliasing method or would it require duplicating code?

slender iron
tulip sleet
# spare jacinth hey, i have a couple of aliexpress boards: 1) <https://es.aliexpress.com/item/10...

There are hundreds of these ESP32-clone-ish boards on aliexpress. The manufacturer provides little to no support, and they come and go. A number have been "cost reduced" to the point that their functionality suffers. If you can find an existing build that works, I'd recommend just using that. If there is no generic build that works, then creating a generic build that would work for a certain class of board (combo of chip, flash chip, PSRAM) I think would be best.

spare jacinth
#

ugh, that's definitely a stopper indeed, wouldnt be nice setting up building a board to then get some of its components changed without any warning, guess i will not make the ports then
but will hopefully be able to find a working build, so far i think it came with nothing flashed on it, unsure what/how to flash it - probably tinyuf2 shall be the 1st thing to throw at it

tulip sleet
#

For instance, there are Espressif-built dev boards for all the different modules, and we have builds for many of them. They break out all the pins, and are pretty generic.

spare jacinth
#

i almost forgot... thx both! 😄

crimson ferry
#

UnexpectedMaker S3 boards are N16R8, not sure if the flash and PSRAM types would match though

spare jacinth
#

i dont even know what that means rigth now, lol.... S3 are a "series" and thats one of the actual devices?

crimson ferry
#

like board (1) above ...16MB flash, 8MB PSRAM

tulip sleet
#

for the RP2040 boards, the Pi Pico build would probably be just fine, it loks like the pinout is the same

spare jacinth
tulip sleet
#

ESP boards are a Cartesian product of a bunch of choices.

#

ESP32, ESP32-S2, ESP32-S3, ESP32-C3 are all different chips. only S2 and S3 have full native USB support

#

ESP32 has no USB support; ESP32-C3 has only USB serial on chip

#

-S2 and -S3 are a lot easier to deal with for CPy purposes

spare jacinth
#

cool, that make things slightly more clear

spare jacinth
spare jacinth
crimson ferry
#

@spare jacinth what tools produced those screenshots? You should be able to just drag the UF2, and it shouldn't need to match

#

but yeah, no surprise if the flash and / or PSRAM don't match

spare jacinth
#

bootloader seems to be working tho, i can see the external drive after double-pressing boot button, with what im guessing are the 3 expected files on it

crimson ferry
#

but likely no bootloader on those boards, esptool can write the .bin file directly

#

ah, ok, there is a bootloader

spare jacinth
#

the web installer did flash some tinyuf2 which is apparently working fine, yeah

#

it probably used esptool under the hood im assuming

crimson ferry
#

not sure, never used that one (don't have Chrome)

spare jacinth
#

(shall move this convo elsewhere?)

tulip sleet
#

maybe start a thread

spare jacinth
#

ESP32-S3 setup issues

devout jolt
# manic glacier

oh hai @onyx hinge, I just heard you mention this in the meeting notes. I will definitely like to help test sdioio support on RP2040!

onyx hinge
#

@devout jolt keep an eye open for the pull request, hopefully this week

orchid basinBOT
manic glacierBOT
#

Another observation which you might want to document ...

I have web workflow enabled and I run this:

import wifi
import mdns

mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = wifi.radio.hostname # 'logger'
mdns_server.instance_name = "My service"

I then run the Discovery app on Mac OS to browse the bonjour advertisements. There is no indication that my Pi provides a _http service - the following is displayed though:

...
_circuitpython._tcp.
> My S...
onyx hinge
#

@devout jolt It's not ready to PR yet (because capacity is not detected & write is un-tested, mainly), but it can read a FAT filesystem on the adafruit metro rp2040 prototype board I'm using for testing. in theory can work with other setups. main requirement is that DAT0..3 are sequential in GPIO numbering https://github.com/adafruit/circuitpython/compare/main...jepler:circuitpython:rp2-sdioio?expand=1

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - Comparing adafruit:main...jepler:rp2-sdioio · adafruit/circuitpython

manic glacierBOT
tulip sleet
#

@onyx hinge could I talk to you on audio or video sometime today about some strategies about doing this merge? I don't want to give up, but I'm trying to figure out how to review all the changes more precisely and with less chance for error. I've done some studying of "review every change" kind of stuff in stackoverflow, and none seem quite right. I can explain more orally.

onyx hinge
#

@tulip sleet sure. After 1:30 CT / 2:30 ET would be better for me.

tulip sleet
#

sure, thanks, I'll ping you then, and do something else for the nonce.

abstract oak
#

I know there's no actual Doxygen or anything, but are doc-comments on CircuitPython internal C functions accepted?

slender iron
abstract oak
#

Doxygen-style comments for annotating parameters, mostly

#

there are a few cases of that already in the source tree, but very few

slender iron
#

ya, that's fine

#

(what are you working on?)

abstract oak
manic glacierBOT
#

This allows you to initialize usb_host.Port once successfully and then returns the same object as long as you pass the same arguments in. It does allow you to fix incorrect pins but not switching from one valid set to another. (It needs a reset for that.)

This also moves hcd cache operations to RAM so that they don't access the cache when doing maintenance.

manic glacierBOT
#

How important is it to have a different key count per shift register? Is this needed for a real in-the-wild design, or is it more a hypothetical?

Another alternative would be to have a single argument giving the maximum count of keys. "shift register 0" would be 0..(n-1), "shift register 1" would be n..(2*n-1) and so on. Unused positions would need to be hard-wired to the non-pressed state (not an undefined state or the pressed state), and some key numbers would be unused if the real num...

onyx hinge
#

@tulip sleet I'm back home and getting settled in, can video in ~10 minutes from now or maybe a bit earlier

tulip sleet
#

sure - finishing up a conversation

#

@onyx hinge Kattni needs me to review something quick, I'll get back to you, if that's ok

onyx hinge
#

that's fine

tulip sleet
#

@onyx hinge ok, done with that for now. (I was doing a sample review for a library so Kattni could screenshot it to update a git guide.)

onyx hinge
#

@tulip sleet OK, I hopped into video in amelia

tulip sleet
manic glacierBOT
#

The current use case i have is ragged, but I could live in my case with a single key_count and ignore unused keys (which would i my case be signalled as pressed and end up in the event queue). I believe the key_count() function is also used to allocate the currently_pressed / previously_pressed stuff for the toplevel keypad code, so a tuple might not work.

devout jolt
onyx hinge
#

I didn't check but I think it's a good assumption that the Pico DV Demo Base is wired for this code to work.

manic glacierBOT
#

Adds two board config defines, which can be added in a board's mpconfigboard.h: BOARD_XOSC_FREQ_HZ, and BOARD_XOSC_IS_CRYSTAL, which are passed to clock_init(). External clock sources are currently only implemented for SAM_D5X_E5X series chips, so defining BOARD_XOSC_FREQ_HZ for a SAMD21 board will emit an error.

Depends on adafruit/samd-peripherals#45 — see that PR for more details on the implementation.

This is for #6161, but doesn't completely close that issue as this only im...

manic glacierBOT
#

For the esp-idf RMT, I tried a bunch of combinations via Arduino. (I had a voltage divider on the output to see if it went high-impedence for any of them, but it didn't.)

idle_output_en - "Enable the RMT output if idle" - I still have no idea what false is doing. Assume it's true for the rest.

idle_level - "Set the signal level on the RMT output if idle" - as with CircuitPython's PulseIn, the output level when we aren't sending any pulses.

carrier_en - "Enable the RMT car...

spare jacinth
tulip sleet
#

@onyx hinge thanks for the talk yesterday; I'm going to use difftool between our tip of main and the merged fileson some of the changed files to re-vet some changes, but probably not starting over. But I found some useful git log flags and args, e.g. git log --oneline --name-status v1.18..v1.19.1 lists all commits between the tags, and also changed files. Damien is very systematic about his commit messages, and that's very helpful.

#

@onyx hinge @slender iron my recollection (and what ag seems to tell me) is that these kinds of lines in the board-specific sdkconfig only act as arguments to some Makefile flashing targets. But am I wrong and they influence the build?

CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
onyx hinge
#
ports/espressif/Makefile:       FLASH_SDKCONFIG = esp-idf-config/sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE)-no-ota-no-uf2.defaults```
flash size is used to select the sdkconfig file
tulip sleet
#

i meant esptool args... ah, you're right, it selects the sdkconfig

trim elm
#

@lone axle hey so I'm up to 5750 on the OSHWA stuff

#

I heard you were starting at higher numbers and working back

idle owl
rancid pilot
#

I think i am done with the canio support for the port mimxrt10xx. I would like to make a build to test and verify. However I get the following error messages. What step am I missing?

lone axle
rancid pilot
#

i think i am doing that already

tulip sleet
lone axle
#

okay, someone else may have better ideas for you. I don't recall needing to do anything specific, but I've mostly copy/pasted the boilerplate, possibly I've been doing a step that I overlooked.

rancid pilot
#

ohh did a manual clean, it seems to be working now

#

worked, thanks

onyx hinge
#

@devout jolt I updated my branch for sdio .. reading is pretty solid, writing is causing a lot of hangs & FAT corruption 😞 and I failed at figuring out how to get the "CSD" which is where the card capacity info is stored.

spare jacinth
#

not sure if this is the place for this kind of reports, but:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported types for __mul__: 'NoneType', 'int'
```not always tho, but the `* 1000` could be moved to the `if ping is not None` block below i guess
midnight ember
#

@onyx hinge i used SD_Card_Size = os.statvfs(virtual_root) to pulll the card capacity

#

Your issue is likely much lower level than I can dive but you've been of tremendous help so if there's even a sliver of way I can help you back I'm taking it. 😉

onyx hinge
#

that method should work whether or not there's a proper FAT filesystem on the SD card

#

but yes, mounting and reading the device's FAT filesystem works OK even if the "capacity" number is returned as 0

midnight ember
#

it was worth a shot. wish you the best of luck!

crimson ferry
jaunty juniper
#

you are correct that the internet test should * 1000 in the if

#

(the github link is at the bottom od the code block on inserts like that)

spare jacinth
#

PR on the way 😉
update: there it is

manic glacierBOT
spice gate
#

Hello. When porting CircuitPython to a new board, is it OK to share the same SPI lines / interface between external SPI flash and other peripherals?

slender iron
#

this is why busio.SPI has try_lock

#

@tulip sleet @onyx hinge what do you think about me switching the heap allocation size for imx to 32 from 16. that way buffers will align with the cache lines

#

(I'm seeing tinyusb invalidate memory at a +16 offset and destroying the obj struct before it.)

#

it'll make allocating stuff on the heap tighter

#

(but maybe not by much)

tulip sleet
#

everything is 32 right now? Does MicroPython ever use 16 for any boards?

slender iron
#

it raises the minimum allocation size

#

we do 16 by default

tulip sleet
#

oh sorry, I misread

slender iron
#

but will also reduce the bookkeeping overhead

tulip sleet
#

the 1011 is pretty tight, maybe try synthio examples with 32 and see if we run into trouble

#

trying to think of what the main use cases for i.MX are

slender iron
#

I can make it conditional on usb host

tulip sleet
#

MIDI will want USB host so you can plug in a controller

slender iron
#

though I wonder if it causes issues with device too

spice gate
# slender iron Yes, but if you can make it not shared then that'd be better

one issue I see (v8.2.0) when running with the CIRCUITPYTHON drive backed by the SPI flash chip, is that when I invoke the busio.SPI() constructor I get an error stating that the SPI signals (SCK, others) are already in use. If I use board.SPI(), I get the same error. Is there something I'm missing ? Thanks in advance.

onyx hinge
#

@spice gate @slender iron I don't know that we have any boards that operate that way now. And I'm not sure it'll operate well, even once you get past that error.

A write to CIRCUITPY from the host computer via USB can happen at any time. If the SPI bus is locked by some Python code, I don't think we have an effective way to defer the write from USB until it's unlocked; the only possibility I see is to fail it when the bus's try_lock fails.

Anyway, when creating the SPI bus for the CIRCUITPY storage I think you'd need to arrange for common_hal_board_get_spi(0) to return supervisor_flash_spi_bus or a way for the routines in supervisor/spi_flash_api.h to use the SPI bus common_hal_board_get_spi(0) instead.

spice gate
# onyx hinge <@721997443188654080> <@252717193496756235> I don't know that we have any boards...

thanks @onyx hinge , this is insightful. Do I understand it correctly, that all of the currently supported boards use different SPI interfaces for the external SPI flash filesystem (when present) and for all the other SPI peripherals? Since this is a board for which I have all the peripherals (serial flash included) connected to the same SPI lines and MCU interface, what's the best approach for porting CircuitPython? Shall I simply fall back to the internal flash, and use the SPI bus for non-storage peripherals only?

onyx hinge
#

fwiw it'd probably be a neat addition if similar to "sdcardio" it was possible to mount an external flash chip.

spice gate
lone sandalBOT
manic glacierBOT
timid bolt
#

It seems that USB host on RP2 uses PIO. However the RP2 datasheet says it has a USB host controller on chip. Is that true so far? If so why the choice not to use the on-chip controller?

slender iron
timid bolt
#

Tinyusb has these examples of dual host/device mode. I haven't looked into it, but does that help you?

slender iron
#

it's what we're doing with cp already

timid bolt
#

Dual mode requires separate physical ports?, Or dual mode is already available on the native port?

slender iron
#

ya, I think dual is two ports at the same time

#

higher end imx has two peripherals

timid bolt
slender iron
#

yes, at the same time

#

so you can edit your code that is doing usb host

slender iron
manic glacierBOT
#

For reference, here's the documentation of the corresponding upstream micropython feature (mpy / native modules).

... what platforms a native file support.
Also include this info in the file itself and error if the suffix or internal metadata don't match.

@tannewt how do you intend "platform" in this case? Upstream .mpy encodes the ARCH which is of course the minimum prerequisite for executing machine code. I'm not su...

#
  • Unify "No foo pin" errors to simplify translation maintenance and improve consistency. Also one other "busy" -> "in use" change.
  • Allocate 32 byte chunks on imx. This aligns to the cache lines and will save headaches when doing cache invalidations on the data.
  • Move three find_qstr wrappers into tcm because find_qstr is already there and they should be small. (Otherwise code in tcm may to have to jump out to flash and back for a small wrapper.)
#

True, choosing something other than .mpy also makes sense since the dynamic linking table will be different so there will not be cross-compatibility. From the upstream docs linked above:

Linker limitation: the native module is not linked against the symbol table of the full MicroPython firmware. Rather, it is linked against an explicit table of exported symbols found in mp_fun_table (in py/nativeglue.h), that is fixed at firmware build time. It is thus not possible to simply call some...

timid bolt
#

Has anyone tried to use a Tinyusb audio device? For me, Windows at least doesn't accept the device.

timid bolt
#

Because I notice there isn't usb audio device support in CircuitPython and I'm wondering is there's maybe an issue with Tinyusb.

timid bolt
slender iron
#

not really. It'd be cool to have audio in and out to cp though

timid bolt
#

Agreed. Does Tinyusb have a Discord?

slender iron
#

thach is most active on github I think

manic glacierBOT
devout jolt
#

Has anyone seen the error when trying to build for ESP32 (S3 in this case) of

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: xtensa-esp32s3-elf-gcc
CMake Error at esp-idf/tools/cmake/project.cmake:296 (__project):
  The CMAKE_C_COMPILER:
    xtensa-esp32s3-elf-gcc
  is not a full path and was not found in the PATH.

The process I used to build was, from a fresh checkout and after installing all prerequisites:

cd circuitpython/ports/espressif
make fetch-port-submodules
make BOARD=adafruit_qtpy_esp32s3_nopsram
#

ahh nevermind. the new make fetch-port-submodules does not invoke the esp-idf/install.sh.

jaunty juniper
#

yeah that was always done by hand

devout jolt
#

yep yep, haven't built for esp32 in a while

manic glacierBOT
manic glacierBOT
plucky tulip
# rough folio haha, fair enough

Took me a bit longer, but I checked out the Blueprints and I managed to create a very similar behavior with minimal amount of added code. I already pushed these changes to the PR (https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/pull/63). I does not work exactly like Flask, I skipped the intermediate Blueprint object, mainly in order to save memory and to keep the codebase smaller, but you can import a Route the same way as you would import a Flask's Blueprint from external file, and register it to the Server.

rough folio
#

Yeah I think the flask blueprint is a bit of a curious design lel

I'll take a looksy in a bit

plucky tulip
rough folio
#

Probs

#

I hope not anyway

rough folio
#

yeah this is pretty much all you need I think- more or less the same api I used
lg2m

It is a shorthand for manually creating a ``Route`` object, that can be used only one time
    per function.```
this wording is kind of weird though. First read it implies that the route can only be used once or something- but I'm pretty sure you mean you can only stack the deco once which I'd hope would be kind of implicit 
idk minor nit doesn't really matter 

something that might be worth thinking about is a route.add_route which would add a subroute but that's probably more than needs doing- ie

@as_route(/path)
def func(...)
    ...

@func.as_route('/subpath')
def xyzzy(..)
    ....


xyzzy could be accessed as /path/subpath

I don't _think_ this would be arduous to add?
#

whoops forgot to reply here's a ping @plucky tulip

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This addition is really neat! Both items returned in synth.note_info() are handy. Here's the quick test I used; it maxes out all synthio voices while printing their note_info (and makes a nice distorty wall of sound). https://gist.github.com/todbot/e1e954889e47fafa7ef14429c53e2c2d

Am I correct that:

  • The amplitude value returned is the same as Note.amplitude
  • If it return (None,0.0), synthio is done with that Note object

A few things I noticed:

  • The whole system degrades...
plucky tulip
digital shoreBOT
#
adafruit
Owner

.adafruit#0

Category Channels

8

Text Channels

63

Voice Channels

7

Members

37592

Roles

38

digital shoreBOT
# digital shore
adafruit
Owner

.adafruit#0

Category Channels

8

Text Channels

63

Voice Channels

7

Members

37592

Roles

38

tulip sleet
manic glacierBOT
orchid basinBOT
manic glacierBOT
slender iron
manic glacierBOT
cunning orchid
#

Quick question: I'm awaiting a review with my company's Legal team next week to get the official go-ahead to contribute (mainly a formality as they're pretty open-source friendly). In the meantime, I'm looking for places to start nibbling to get a better feel for the codebase before poking at multicore. Looking at the issues in GitHub, I see tags "help wanted" and "good first issue" am I correct in understanding that you think that these are good starting issues for new to the project contributors?

manic glacierBOT
manic glacierBOT
idle owl
cunning orchid
idle owl
#

Another thing to keep in mind is that you can always tackle larger items in smaller chunks, and submit multiple contributions as you work through it.

#

As long as it doesn't break things, obviously. 😄

cunning orchid
# idle owl I've never heard of Gerrit! GitHub is pretty straightforward, though, so I don't...

I think it was made by Google originally and then released to open-source. It's basically a Git server with a wrapper that pushes the workflow into code reviews (similar to GitHub's PR) and a UI that's clearly built by backend people with little thought for UI/UX flare (like myself) as well as handy integration capabilities for external CI/CD systems.

Nowhere near as visually pleasing as GitHub or GitLab but, seems to be a solid self-hosted option.

idle owl
cunning orchid
orchid basinBOT
manic glacierBOT
#

Depends on https://github.com/adafruit/nvm.toml/pull/15.

I'm still testing, but most things seem to work so far.

One issue is there are some board with inverted green/blue on the status RGB LEDs (see https://support.arduino.cc/hc/en-us/articles/9589073738012-About-Nano-ESP32-boards-with-inverted-green-and-blue-pins). Mine happens to be one of the ones with inverted green and blue pins, but I created this board based on the non-inverted LED.

Question is:should we have a second board ...

manic glacierBOT
#

The current board definition doesn't work for me. The difference I found was in the pin definitions for the UART - the existing board uses:

#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1)

While this variant uses:

// Default bus pins
#define DEFAULT_UART_BUS_RX         (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX         (&pin_GPIO21)

// Serial over UART
#define CIRCUITPY_CONSOLE_UART_RX               DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX               DEFAULT...
small comet
#

Not a big rush to debug this, but just in case someone sees anything immediately obvious: I attempted to build an esp32c3 board from main - with this: make V=2 BOARD=beetle-esp32-c3 PORT=/dev/ttyACM0 flash monitor

The build works well enough and flashes, but it looks like the board goes into a boot loop. The repeating output from the monitor part looks like this:

Waiting for the device to reconnect.
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049a42
SPIWP:0xee
mode:QIO, clock div:1
load:0x3fcd5810,len:0x24
ets_loader.c 78 
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049a42
SPIWP:0xee
mode:QIO, clock div:1
load:0x3fcd5810,len:0x24
ets_loader.c 78 
device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Waiting for the device to reconnect.
ESP-ROM:esp32c3-api1-20210207
slender iron
#

I think there is an issue filed for this

small comet
small comet
#

@onyx hinge (or anyone familiar with asyncio really) is this code https://gist.github.com/jepler/e620cb8396a941866c95501b22b6c0ee supposed to work with 8.2.0 when using the "native" IOQueue with the ioctl protocol? When I run it on my esp32c3 board, only the logic task runs. I'm not able to trigger the pin events. Moreover, in the logic task I added something to print out the map in the global _io_queue instance, and surprisingly it is empty. (Also confirmed separately, if I don't add any "logic" tasks, the asyncio.run() terminates right away.

Gist

GitHub Gist: instantly share code, notes, and snippets.

manic glacierBOT
orchid basinBOT
onyx hinge
#

@small comet I don't have any context in my brain about that, and I'm away from all cp hardware for a few days. it's possible that e.g., something about adafruit_circuitpython_asyncio pull #33 means this code doesn't work now. it would be nice to have working code that makes awaiting key presses "most performant", but that example code may well have bit-rotted because nobody's actually using it.

small comet
manic glacierBOT
#

Hello,

I have tested with stable 8.2 (https://circuitpython.org/board/espressif_saola_1_wroom/) and with adafruit-circuitpython-espressif_saola_1_wroom-en_US-20230721-823e505.bin.

I have esp32-s2-wroom board and while trying to use DAC pins Im not able to. Module board wont show correct pins.

import board
dir(board)
['__class__', '__name__', 'IO0', 'IO1', 'IO10', 'IO11', 'IO12', 'IO13', 'IO14', 'IO15', 'IO16', 'IO17', 'IO18', 'IO19', 'IO2', 'IO20', 'IO21', 'IO26', 'IO3', 'IO...
lone axle
#

Does anyone know if matrix portal S3 is shipping with UF2 bootloader? I don't seem to be able to get the double click reset working. I can hold boot and reset and it does seem to be in a bootloader mode, but no drive appearing, only /dev/ttyACM0

manic glacierBOT
#

Pin names like A0 or A1 are convenience aliases that are usually added when the board silk has those labels. On the ESP chips, there are two banks of ADCs - generally you want to use ADC1_* pins (IO01 - IO10) if also using wifi. There are two DAC pins: IO17 and IO18, but IO18 is used for the NeoPixel.

Thx for the reply. Using IO17 atleast got me forward but other python code problems prevents me from actually confirming that this is working.

#

Yes, use the IOnn pins. Are you using an Espressif dev board or some other board? Post a shopping link to the board you used if it is not the Espressif board so we can see a picture.

Yep IOnn pins most likely works.
https://www.ebay.com/itm/385252950700?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=ntQFEp1PQuy&sssrc=4429486&ssuid=C6bd3pbsS-m&var=653138665549&widget_ver=artemis&media=COPY

This is the board I am using.

#

This looks good to me.

I tested it successfully with this code on a Matrix Portal S3:

import random
import time
import board
import displayio
from adafruit_matrixportal.matrix import Matrix
import bitmaptools

main_group = displayio.Group()

matrix = Matrix()
display = matrix.display

display.show(main_group)

bitmap = displayio.Bitmap(matrix.display.width, matrix.display.height, 257)
print(f"{bitmap.width}, {bitmap.height}")
print(f"bits per value: {bitmap.bits_pe...
manic glacierBOT
opal forge
#

hey folks! trying to get circuitpython 8.2 set up on a new MatrixPortal S3. the board comes with a simple sketch and doesn't seem to include the bootloader. i tried to do a full install using the installer (https://circuitpython.org/board/adafruit_matrixportal_s3/) but it is dying because it can't fetch the tinyuf2 bootloader.

it's trying to load https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/tinyuf2-adafruit_matrixportal_s3-0.13.0.zip - which doesn't exist. the "download bootloader zip" for manually installing points at a different(?) non-existent file: https://github.com/adafruit/tinyuf2/releases/download/0.13.0/tinyuf2-adafruit_matrixportal_s3-0.13.0.zip.

as a member of the adafruit webdev team (👋🏻) i have the ability to peer into the actual bucket where we store these files and found this file instead: https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/tinyuf2-adafruit_matrixportal_s3-0.15.0.zip

not sure how all these versions and builds are managed on circuitpython.org but it seems like this needs an update!

small comet
# slender iron I think there is an issue filed for this

I think I might have an unrelated issue for the board I'm using (beetle-esp32-c3) - I was able to at least get a working system by switching to CIRCUITPY_ESP_FLASH_MODE=dio in boards/beetle-esp32-c3/mpconfigboard.mk. I'll avoid muddying the ongoing debugging on the issue, but fyi'ing here in case anyone runs into something similar.

opal forge
lone axle
#

I'm not entirely certain how the page on circuitpython.org gets built, but it might be worth considering supressing the top right panel with current stable release 8.2.0 for the Matrix Portal S3 since that build doesn't seem to be able to handle the matrix properly. There was a fix in protomatter that came afterwards I think that is necessary to get the display showing accurately.

opal forge
lone axle
#

Nice, glad to hear it 🎉. I'll ask around a bit on Monday and try to see whether it's possible to have the device page link to a newer one, or at least remove the link to 8.2.0 for now.

opal forge
#

another quirk on circuitpython.org: the original is listed as Matrix Portal M4 (two words for "Matrix" and "Portal") and the new one is listed as MatrixPortal S3 (one word). the search feature on the downloads page turns up both if you search matrixportal but only turns up the old M4 board if you search matrix portal.

lone axle
#

😄 I noticed that as well. I think there may be a keywords list or something similar and I'm guessing the original contains the opposite "spelling" so it gets found with both. The newer one must not have the keywords loaded up yet.

#

if you have a moment, opening an issue on circuitpython-org repo would be good to get someone to take a look and try to make them work the same.

opal forge
lone axle
#

Thank you!

manic glacierBOT
manic glacierBOT
#

@UnexpectedMaker No problem. Let's try to start this over with just https://github.com/adafruit/circuitpython/pull/8174/commits/9642e387839c7fad564edc9909f22e8fcf2bec2e. The original commit can stand on its own, you don't need to rebase or merge.

I mostly avoid rebasing myself, because it's too easy to break things unless I am quite careful/

Getting back to the original point, do you agree with my idea to name them STEMMA_I2C2 and I2C2`? If so, I think I can force-push the original c...

#

Or, try this yourself: git checkout 9642e38; git push -f.

That will get this PR back into shape, so you or I can then make the rename. After the PR is merged, you can delete the fork and re-fork.

In general, we very much advise making a branch for any PR. This PR is on main. You want your main to be the same as upstream. As a rule, don't make commits to main yourself: always use a branch. Then your main will track upstream.

manic glacierBOT
#

I tried that - It did get me back to the state I was in before I tried to add this new change, but as soon as I tried to rebase again so I could make the change and commit/push, I ended up in the same bad state again.

So instead, I just changed the file and committed it here in the web view, and once it's been merged, I'll stomp and start the fork again, and try to remember to work in branches!

Sorry for all of this trouble!

tulip sleet
manic glacierBOT
inner orbit
#

Does someone have a link to the CP6 source?

spare jacinth
#

6.x.y should be easy to find too

carmine girder
#

I got a Galactic Unicorn and would like to use it with CircuitPython. I'm mostly interested in using the RGBMatrix library, of course. While looking at the schematics in https://cdn.shopify.com/s/files/1/0174/1800/files/galactic_unicorn_schematic.pdf?v=1667910096 I am getting a little lost already, tho. Would you know what ports I should be providing to something like:

matrix = rgbmatrix.RGBMatrix(
    width=32, bit_depth=4,
    rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
    addr_pins=[board.A5, board.A4, board.A3],
    clock_pin=board.D13, latch_pin=board.D0, output_enable_pin=board.D1)

?

tulip sleet
tulip sleet
#

btw, #help-with-circuitpython is probably better for this, and we ask that don't ping folks unless you are already in a convo with them

midnight ember
manic glacierBOT
#

Hi,

I have the same issue.

CircuitPython 8.2.0 , adafruit_wiznet5k 3.0.0 ,

cs = digitalio.DigitalInOut(board.D10)
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
eth = WIZNET5K(spi_bus, cs)
socket.set_interface(eth)
socket.setdefaulttimeout(0.0) ------>>>>>> timeout
server = Server(socket, "/test")
while True:
try:
server.poll()
expect...........

server.poll() never returns even if i have defined a timeout for the socket.
I am using chrome...

manic glacierBOT
candid sun
#

<@&356864093652516868> We'll have our weekly meeting in about 90 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1Zx4UF48QN6YoRq-qVAJgdsfr-5KW401aJPTYwjxMQns/edit -- I look forward to everyone's updates!

tulip sleet
#

@slender iron I think I will cancel some of the simplest backport merge jobs so we don't have to wait 30 hours for them to finish.

#

next time I will merge more of the cherry-picks into a single PR

slender iron
#

fine with me

onyx hinge
#

Missing the meeting today. Group hug plus one for danh for all the back port fixes

manic glacierBOT
manic glacierBOT
#

This thing is that at max power the module is AUDIBLE when transmitting data. Mind you, I have excellent hearing, but still it should not be audible.
I presume the instantaneous current is much much higher than 150mAh. My usb doctor did not measure the spiking at all, reading 0.2A total board use regardless of if it was TX'ing or not.
Oh and I should also note, the usb disconnections only occured on the pico + module when I spammed packets, not when sending one or two.

brazen hatch
#

I am pretty sure the solution to this is just a module revision that has a capacitor on 3v3 and a board revision that has a better regulator.

#

As a note, with the module, regardless of if it was powered with 5V or 3V the issue occured.

lone axle
turbid radish
#

We will likely keep it out on Mondays

midnight ember
#

Welcome back Anne ❤️

turbid radish
#

Thanks!

#

I missed y'all

midnight ember
#

Thanks to everyone who worked on the newsletter over the past weeks, they did a great job.

manic glacierBOT
idle owl
#

You're welcome!

#

It's live as far as I know!

midnight ember
#

Woot! Can't wait to read the guide. Thank you for the backporting devs too.

#

Sounds like a fun time, nice one Deshipu.

idle owl
#

@stuck elbow For your In the Weeds topic, are you referring to the core, the libraries, or both?

idle owl
#

Got it, thanks.

midnight ember
#

You can get your own health data out of a fitbit api, you can't do that with an apple watch. So this is a semi-open source way to work with your own personal watch health data.

ember iris
#

with the amount github changed the authentication process, that guide update must have taken ages! But goodness it'll be a huge help to have it working with the access token setup

idle owl
#

The 100+ screenshots that went into the entire update on the other hand......

midnight ember
#

Nice job on all the projects including the arc weld and grind. 🧑‍🏭

ember iris
#

oh wow yeah that would take ages to process and organize

brazen hatch
#

The access tokens are such a pain to get right on linux.
I just have them in my dotfiles and copy the .gitconfig and .gitcredentials.

#

Making the files on your own is easier than doing it with commands.

idle owl
#

You're not the first person to say/do that.

brazen hatch
#

Yea I also have my own gitea instance, so it would be double the pain to do manually.

idle owl
#

Oof yeah.

tulip sleet
midnight ember
#

I'll actually agree. As a beginner the type annotations were labeled as a good first issue but I really struggled with it during hacktoberfest. You must have previous python experience to really tackle those.

#

yeah the ones I tried doing had like 50 types annotations to do per file

#

because the ones with only a few were taken out on like day 1

lone axle
#

There are still a few that have a limited number of types required. But it would definitely be good to remove 'good first issue' tag from any that are the more gnarly ones.

#

There are also a few that have PRs with requested changes but have been dormant for a while since the review, those would be good candidates to remove the label from as well in most cases.

midnight ember
#

It wasn't an NRF52840 🤦‍♂️ It was a SAMD51 Metro M4 with airlift.

turbid radish
#

Thanks all

gilded cradle
#

Thanks everyone

lone axle
#

Thanks for hosting Liz, Have a great week everyone!

midnight ember
#

Thank you Liz, great job.

ember iris
#

Thanks all, hope everyone has a great week!

candid sun
#

thanks folks!

candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1RMdYD7ABzChlYjE7HK4RsJOmBiQUU2Vo0iU61Q5Lus0/edit

spare jacinth
#

i just found a little bug, perhaps already reported, trying to combine 2 f-strings raises a SyntaxError: py print( f"Hello" f"World" ) funny enough, all other combinations (f + no-f, no-f + no-f and no-f + f) work

slender iron
#

f-strings are a bit of a hack because they get transformed to a string format call

#

could be related to that

idle owl
tulip sleet
idle owl
#

Ah right, that was it.

#

Thanks Dan!

tulip sleet
manic glacierBOT
#

Ok, I've added a board with the inverted status led. I kept having it crash whenever I was trying to access the TX/RX pins. Upon investigation, I realized that these are actually the RXD and TXD pins for the debug interface, so set them as such.

I'm not 100% sure that I set up to use the external flash correctly either. It matches other boards in the parameters used and the external flash file is looking for the parameters I used, but I'm not getting the full 16MB of space. It may just a ...

#

The Note.amplitude another value that is multiplied together with the envelope's current value to give an overall note loudness, so the two values are different. (A Note's panning is yet another factor into the overall note loudness)

Each note_state call does a linear search through the (typically) 12 note slots. If a note is found in an early slot it takes a bit less time, while if it's a note that is not playing or was never playing it takes the greatest amount of time.

Bulk print...

tulip sleet
#

@onyx hinge I don't know how "back" you are. Do you have a comment about https://github.com/adafruit/circuitpython/pull/8189 ? We could put it in 8.2.1 if you think it's fine for all Espressif. Or do you think it needs testing on other ones? Can wait until tomw if you'd rather not think about it now.

onyx hinge
#

@tulip sleet if it's tested it's probably reasonably safe.

#

we got back from our weekend road trip an hour or two ago. earlier I was doing a few things from my phone when it wasn't my turn to drive.

manic glacierBOT