#circuitpython-dev

1 messages Β· Page 7 of 1

gilded cradle
idle owl
#

Oooh!

gilded cradle
#

Title was "Adafruit ESP32 Feather V2"

idle owl
#

Or did we miss it

#

Ohhhh

#

You have to type it exactly.

#

I did esp32 v2

gilded cradle
#

It was there already

#

I searched esp32 feather

idle owl
#

OK, thanks!

gilded cradle
#

Yeah, maybe if we change title to Adafruit Feather ESP32 V2

idle owl
#

Well it should match the product page

#

I think

tulip sleet
#

that would be better certainly

gilded cradle
#

I think it does

idle owl
#

Hmm. ESP32 v2 is likely to be a more common search

gilded cradle
#

right

#

That's why I thought switching around Feather and ESP32 or V2 and Feather would work better.

idle owl
#

Agreed

gilded cradle
#

Would you prefer Adafruit Feather ESP32 V2 or Adafruit ESP32 V2 Feather?

idle owl
#

First one

gilded cradle
#

Ok

onyx hinge
#

<@&356864093652516868> The discord meeting is coming up in about 15 minutes! Please take the time to add your notes to the document https://docs.google.com/document/d/1TLaYXH680L-YaV9_WvGFxDAMRFgZM3VqlhbdDO0KVa8/edit?usp=sharing and we'll talk to you in the voice channel if you're able to attend live

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.3\.3
digital ibex
#

Sounds great!

onyx hinge
#

@tulip sleet I hope you will do core today, I don't have the context in my brain

tulip sleet
#

sure

onyx hinge
#

ty

turbid radish
#

Thanks Tim!

manic glacierBOT
onyx hinge
#

we should file an adabot bug asking to look into why we can get negative issues not assigned a milestone

#

wooowwwww

tulip sleet
#

I tried to assign all the issues to a milestone last night, but maybe I have to do it by Saturday night?

proven garnet
onyx hinge
turbid radish
#

Congratulations Paul!

random junco
#

thanks. πŸ™‚

thorny jay
#

I love everything @digital ibex present in Show and Tell... just saying!

digital ibex
thorny jay
#

Did I mention I have a new Smart Watch. πŸ™‚

#

Notice how Pico is the most downloaded firmware on circuitpython.org I wonder what are the number.

onyx hinge
orchid basinBOT
onyx hinge
#

13640, but I'm not sure over what period of time

tulip sleet
#

The numbers come from a query on the download data. I change the query periodically as the version numbers advance. The current download numbers are for 7.2.x, 7.3.x, and 8.0.0-something

onyx hinge
#

vs 3614 for circuitplayground express (#2)

thorny jay
#

No pressure for Picow... πŸ™‚

tulip sleet
#

so it's not downloads for all time (the logs that are queried are not permanent either -- I think they last only for 90 days)

digital ibex
#

πŸ™€

mental nexus
#

Proof of concept demo for the bowling ball detector/training aid using an ultrasonic sensor, with position indicator.

onyx hinge
#

@mental nexus do you compensate for an assumed radius of ball, or how do you find the centerline of the ball?

royal rover
#

@mental nexus I think I found a used tablet of the kind you used in the Hacktablet. I was wondering if you could use it create a hacktablet with it.

mental nexus
mental nexus
idle owl
#

@onyx hinge Thanks you beat me to it.

#

It's not! Anyone can join!

#

@lone axle Your audio cut out.

onyx hinge
#

belated hug report to tekktrik who is running office hours, not foamyguy

thorny jay
#

Lost sound?

turbid radish
#

Yes, I no longer hearthings

idle owl
#

Yes.

random junco
#

Yes

candid sun
#

yes

gilded cradle
#

I can hear dan

turbid radish
#

Yes, I hear Dan

thorny jay
#

And I don't even have a mic to talk the display thing. πŸ™‚

idle owl
#

@lone axle Is the recording still working? I can wrap up the meeting if it would help.

lone axle
#

Sorry about that discord RTC disconnected for a moment. I am back in, and believe I made it back quick enough to catch this discussion in the recording.

thorny jay
#

HUB75 could be a "Feature" but we want to reduce the number of Feature.

idle owl
#

I hear Tim

thorny jay
#

So if board.DISPLAY is in the firmware?

idle owl
#

"LED display"?

thorny jay
#

Understood. I will try to make something.

gilded cradle
#

Thanks

mental nexus
#

Thanks all!πŸ‘‹

onyx hinge
#

πŸ‘‹

digital ibex
#

πŸ‘‹

gilded cradle
#

Thanks

ember iris
#

Thanks all!

onyx hinge
#

@gilded cradle if you know the wording you want for the new feature maybe you should write it on that issue as well so there's no confusion

gilded cradle
#

Sounds good @onyx hinge.

idle owl
#

Aw, Limor beat me to the ESP32 V2 string update PR.

#

Thanks for submitting that Melissa!

orchid basinBOT
idle owl
#

Is it valid to say "ESP32 CircuitPython installation is completed over serial."?

orchid basinBOT
orchid basinBOT
gilded cradle
idle owl
#

It seems like regardless of which way you do it, it involves serial ports.

#

So I feel like it's valid?

gilded cradle
#

Is it through the REPL?

tulip sleet
gilded cradle
#

Ah, ok

tulip sleet
#

are you talking about the firmware or something else?

idle owl
gilded cradle
#

I think she was talking about firmware. I'm not sure what I was talking about

orchid basinBOT
idle owl
#

I need to make it distinct from the UF2 concept.

tulip sleet
#

yeah, so that's correct. one could conceivably upload the firmware to a serial-only board using a USB-serial adapter, but that's a real edge case, and we aren't supporting such boards yet

idle owl
#

Ok. So use your wording?

#

Or future proof it with my wording?

tulip sleet
#

over serial vs the mass storage (USB drive) interface. ... I think it's a little more precise

idle owl
#

Ok. I was trying not to compare them because I feel both will become commonplace on their own.

tulip sleet
#

it's not completed over serial (like a UART port)

orchid basinBOT
idle owl
#

Ah ok

#

Got it.

tulip sleet
#

I mean it might be for a few non-USB-at-all boards

#

I'd cross that bridge when we come to it

idle owl
#

Fair enough. Will do.

tulip sleet
#

because the novice user doesn't really know that "serial" subsumes "USB" here

idle owl
#

Ok

#

So I'll use your wording above

orchid basinBOT
idle owl
#

How many alarm.sleep_memory[x] slots are there? Or is the subscripting not indicating a limited number of them.

onyx hinge
#

check if is there a len(alarm.sleep_memory)?

onyx hinge
#

I think it may be different per device or kind of device

idle owl
#

on ESP32 V2 Feather.

#

Ah. Noted.

lone axle
#

Here is the notes document for next Tuesday's CircuitPython Weekly meeting. It is at 11am Pacific / 2pm Eastern here on Discord on Tuesday 9/6/2022. 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/1PUjxzPDp0X9ACzeeiRug8NznRZA8ku0l5pPHi69UP7U/edit?usp=sharing

stuck elbow
#

@idle owl @gilded cradle do you think it would make sense to have a "handheld" or "gaming" filter on the downloads page, for the devices that have a display and d-pad buttons?

hidden rain
#

Having to re-build my build env. I have a fresh Ubuntu 22.04 and ready to get the ARM Cortex-M toolchain (every thing is on my vbox). Do i get the arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz .. ? or something else?

idle owl
#

I can't use + in a variable name in CircuitPython, right?

stuck elbow
idle owl
#

Thanks. I thought as much.

stuck elbow
#

well, anything that is a unicode letter, so probably there is some Japanese character that looks like +...

idle owl
#

Hah! It's not that important. I used PLUS as part of the variable name.

stuck elbow
#

smart

tulip sleet
idle owl
#

To be clear, if I do if not foo: followed by else:, the code in the else will execute when foo is valid?

manic glacierBOT
hidden rain
stuck elbow
#

it will execute whenever the if doesn't

idle owl
#

Ok, got it. Thank you. And I can do if, else, if something else in that order, yes?

#

else doesn't always need to come last in the loop....?

stuck elbow
#

wait, else on a loop means something else

idle owl
#

Hmph.

#

Ok

#

Turns out this may all be a moot point here in a minute, depending on the results of a question about Adafruit IO in progress.

stuck elbow
#
for i in range(10):
  if i == x:
    break
else:
  print('x is not within 0-9')
#

example of a loop with else

idle owl
#

Ah ok

#

Turns out Adafruit IO basic supports what I'm doing in this code anyway, so I don't need these if/else anymore.

stuck elbow
#

you can also have an else on a try-except, it will execute only when there was no exception

idle owl
#

Right

#

Ok

hidden rain
tulip sleet
#

we didn't' advance to 11 because it wasn't consistently producing smaller executables

#

and there were some other minor issues

hidden rain
#

Gotcha...writing it all down...

tulip sleet
#

the command history should be a good log too

hidden rain
#

BTW, I'm ok with the name change and all. I'll address that when the env is back to 'normal'

orchid basinBOT
tulip sleet
manic glacierBOT
#

I am still digging through the codebase, but I did figure out how to change the brightness. If I turn auto_refresh off, set the brightness, and then manually refresh in my While loop, it works as expected. Otherwise, brightness just automatically goes back to 1.0 no matter what I set it to. So your issue is somewhere in your auto refresh code. Hope this helps!

...
board.DISPLAY.auto_refresh = False
board.DISPLAY.brightness = 1.0
board.DISPLAY.show(layout)
dimTime = time.monotoni...
hidden rain
#

This is where things went bad last time: pip3 install --upgrade -r requirements-dev.txt
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements-dev.txt'

#

on Ubuntu 22.04

#

Fresh install of everything

stuck elbow
#

the file is right there

#

are you running that command from the root of the repository?

hidden rain
#

No. Perhaps thats the issue. THouhgt this was an add-on to python only.

#

ok..now I feel real dumb

#

So its installing the reqiuirements INTO the repo..., right?

stuck elbow
#

no

#

but it's getting a list of what to install from the repo

#

it's installing everything in your home in the .local directory

#

so it will only be installed for that user

hidden rain
#

which is not in my pPATH, so I need to add it..

stuck elbow
#

I think it's in pythonpath by default

#

so imports should work

#

you might want to add ~/.local/bin to PATH to run any installed commands

hidden rain
#

Thanks.. doing that..hopefully will have a clean env this time

manic glacierBOT
#

Just confirmed that the brightness parameter value doesn't change or alter the display brightness in the REPL:

Press any key to enter the REPL. Use CTRL-D to reload.
]0;🐍REPL | 8.0.0-beta.0\
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit PyPortal Titano with samd51j20
>>> import board
>>> board.DISPLAY.brightness = 0.5
>>> board.DISPLAY.brightness
1.0
>>> ```
manic glacierBOT
vale spire
#

just saw the tweet about the pico w's port expander (that also happens to do wifi&bt) πŸ™‚

do you already have support in CircuitPython for transparently handling port expanders in digitalio etc?

#

(we had to kind of hack it in a bit to that ports' implementation of machine.Pin but hopefully this is something we can support more generally in the future)

manic glacierBOT
crimson ferry
#

Any ideas why a non-web-workflow mdns CircuitPython device will (almost?) always answer to circuitpython.local first, before any web-workflow devices?

#

(it's most likely more network hops to the non-web-workflow device)

crimson ferry
#

hmm.. seems to be caching at possibly various levels, esp32-s* seems to need a reset (not reload) to clear the dns cache

crimson ferry
#

ah, just a little patience... esp mdns ttl seems to be about 2 minutes (though port number seems to get ignored)

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.1 on 2022-06-22; Adafruit ItsyBitsy nRF52840 Express with nRF52840
Board ID:itsybitsy_nrf52840_express

Code/REPL

################## main.py ######################
import asyncio
import time
import module1
import config
import async_task

DistRange = [config.DISTANCE['KEIKOKU'], config.DISTANCE['KIKEN']]
checkResult = True
try:
    checkResult = module1.check_config(DistRange)
except:
    checkRes...
jaunty juniper
tulip sleet
#

I didn't read my email all the way through before opening the PR!

tulip sleet
#

@jaunty juniper I did the identical thing for the backport to 7.3.x. If it looks OK to you, please review.

#

#6845

#

otherwise another 7.3.x release will re-introduce the board, I think

stuck elbow
#

sorry for taking so long to notice

tulip sleet
#

it was pretty obscure. Did you end up making a pewpew 10.3?

stuck elbow
#

yes, but they all use the same firmware

#

just the physical size of the led matrix is different

tulip sleet
#

that's what I thought. We could still make an alias if you want (for a different picture, that would be the only reason). Is it this?

#

This board was designed to be an affordable device for teaching gamedevelopment. An eight by eight display, with four shades of pixels, togetherwith an equivalent of a Trinket M0 on board let you create and play simplegames such as Snake, Tetris or Frogger. A number of example games, togetherwith...

#

or the picture could be updated to show all the models, if you care

#

I like the latter idea, actually (multiple boards in one pic)

stuck elbow
#

I made so many versions of the pewpew devices, it doesn't make sense to list them, the pewpew10 is being sold, so that one makes sense

tulip sleet
#

@jaunty juniper thanks

stuck elbow
#

by the way, I discovered a concerning pattern in the progression of my game consoles

#

if that keeps up, in a few years I will be making game luggables

tulip sleet
stuck elbow
#

yup

orchid basinBOT
manic glacierBOT
#
  • Rename "title bar" to "status bar" everywhere, for consistency.
  • Add many #if CIRCUITPY_STATUS_BAR guards to allow turning feature off completely. Tested by compiling with CIRCUITPY_STATUS_BAR = 0 on several ports.
  • Add supervisor.StatusBar and supervisor.status_bar, its sole instance.
  • Add supervisor.status_bar.console and supervisor.status_bar.display, which are bools enabling/disabling status bar. They can be set in boot.py or later. When changed, the status bar is up...
tame creek
tulip sleet
tame creek
tulip sleet
#

i believe the issue was in third-party code

proven garnet
#

@thorny jay I transferred your issue to adafruit_ble and I can get a PR to fix tonight.

#

Good catch!

digital ibex
#

Has there been any work on a CircuitPython emulator? I'm thinking of making one for the purpose of porting code to new platforms/education.

#

I've got some ideas for it, and I don't think it would be too tough to have it usable for somewhat simple projects

proven garnet
#

It has come up briefly as a potential solution to determining MPY size, which @lone axle is working on.

#

Not the emulator, just the problem.

manic glacierBOT
#

100% for this, at least at boot. Flashing some random stuff before the actual content doesn't help anyone debug and makes projects, like the ones outlined above, look crappy. (And we want to use CircuitPython for products! We all understand the open source license provides no warranty... doesn't mean we don't add features when it helps the community.)

If nothing else, adding info in the docs and/or the Learn section of the Adafruit site on how to do this in boot.py would be super helpf...

digital ibex
#

Oh, I get it

#

nvm

jaunty juniper
#

there's the wokwi rp2040 emulator that can run CP

lone axle
#

oh

jaunty juniper
#

yup there you go

digital ibex
#

Ah, I think I saw that in my research but didn't quite understand what it was for. Thanks

proven garnet
#

The micropython team also has one for their website too that run on Unicorn

#

Thanks autocorrect

digital ibex
#

I might write a desktop/web app that is fully open source and uses the Wokwi rp2040js emulator, just to have something to code πŸ˜†

idle owl
#

@tulip sleet Testing PR now.

#

Actually remembered where the Artifacts are kept on the first try, instead of searching all over and ultimately asking.

tulip sleet
#

I think many of the builds are busted

idle owl
#

The one I needed is not.

#

So, I forgot to load the libraries needed for my code before running the code, and now Thonny is broken, and I hadn't created the .env file yet. @tulip sleet Is there a way to create and edit the .env file from the serial REPL? Or do I need to erase and reload CircuitPython and do it all in the proper order this time?

#

My terminal locked up initially too, but I reset the board, and now it at least gets me to the REPL again using terminal.

#

Reloading CP is fine.

#

Figured I'd ask though.

idle owl
#

Oh naturally. Sorry, I could have done that first. Thank you.

tulip sleet
#

np, I have recommended that twice already today

idle owl
#

Web workflow still not connecting. Sigh.

#

I'm not going to troubleshoot this right now. Reload time.

#

I guess at least we know Thonny, errors and the status bar are still a problem. πŸ™„

proven garnet
#

Actually related to web workflow, @idle owl , do you want me to generate that patch script to change the README files to use .venv for virtual environment and add .venv to .gitignore soon?

tulip sleet
#

.venv or .env?

idle owl
#

Not sure that we updated .gitignore though.

idle owl
proven garnet
#

Oh it looks like some do have it, I can verify the change I guess

#

I can submit an adabot patch for the gitignore then

#

Also just PR'd cookiecutter since it was a two second update

idle owl
#

@tulip sleet I've started getting this in Thonny when I try to enter the REPL after adding a boot.py with the supervisor.status_bar code. ```PROBLEM IN THONNY'S BACK-END: Exception while handling 'execute_source' (thonny.plugins.micropython.mp_back.ProtocolError: Could not get raw-paste confirmation).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your CircuitPython device and try again.

Process ended with exit code 1.```

#

No error in my code yet.

#

Also when I set it back to True to see if it would show up again, it showed up in the code.py output, but not on the shell tab bar.

tulip sleet
idle owl
tulip sleet
idle owl
#

Only the console line.

#

But yes.

#

Exactly what I did.

tulip sleet
#

try the display line too, but it should not make a difference. If it does I have a bug

idle owl
#

Ok, checking.

#

Same error. Here's a more detailed explanation. Normally, when the code is done running, Thonny automatically enters the REPL so you can edit and save files onto the board. With this boot.py file in place, the code finishes running, and the shell sits there. I am able to try to enter it by pressing "enter", however, it returns the error I pasted above instead of entering the REPL.

tulip sleet
#

but it was OK with the previous build CIRCUITPY_STATUS_BAR = 0 ?

idle owl
#

Yep.

#

Apparently.

#

I've never seen this specific error before now.

tulip sleet
#

the status bar gets sent really early. I may not catch it in time. hmm. hmm.

#

I did not test it with Thonny. The way the status bar works internally is quite tricky

#

I spent a lot longer on it than I thought I would

idle owl
#

Thing is, if I enable the status bar again, it shows up in the serial output. It didn't add it to the shell bar, but it at least shows it somewhere. The status bar info does not show up in the serial output if it is disabled in boot.py.

tulip sleet
#

i just tested it in tio and it turned on and off as I expected

idle owl
#

That's why I'm here πŸ˜„

#

I'll add the important bits of this discussion to the PR so it's there.

tulip sleet
#

there is a way to turn on logging in Thonny which will help me. I have to reconstruct how I did it before

#

ok :/

idle owl
#

Um, the error suggests it....

#

the log thing.

#

Does not explain where to find that file though.

#

Probably inside the app.pkg

#

on Mac

tulip sleet
#

oh, yeah, there is a setting in the preferences to turn that log on. there is a .thonny directory where you started running it, I think

#

something like that

idle owl
#

ahh ok

manic glacierBOT
#

Tested with Thonny and the Feather ESP32 V2.

When code stops running in Thonny, it automatically enters the REPL so you can edit/save files to the board. Once the boot.py file is in place (whether enabling or disabling the status_bar), the next time I run code (in this case the base "Hello world!" code.py file), Thonny does not enter the REPL. Instead, the shell shows Code done running. and sits there. When I press enter on the keyboard to attempt to enter the REPL, it throws the follo...

idle owl
#

@tulip sleet ^^ Hope that helps. I repro'd everything again to get some code snippets to include.

tulip sleet
#

thanks very much

idle owl
#

Oh rad, ok. Thanks.

tulip sleet
# idle owl Oh rad, ok. Thanks.

on linux, the config file is in ~/.config/Thonny, but if you are running in a venv, it will be inside the venv somewhere, it appears

idle owl
#

Maybe it hasn't been generated yet even though it errored.

#

Wait, I bet I have to restart.

tulip sleet
#

This will open the folder, so you can find it:

#

i figured all this out by trial and error a few weeks ago

idle owl
#

Ah ha!

#

It's in ~/Library/Thonny apparently.

tulip sleet
#

seems to vary a lot by platform and enviroment

idle owl
#

Is there any personal information in here?

#

Or can I safely post it to GitHub

#

Or should I simply give it to you to be safer

tulip sleet
#

you can give it to me privately -- it will have your paths and stuff

idle owl
#

Uff, ok. Will do.

tulip sleet
#

well, maybe, I don't really know. You could just look at it

idle owl
#

I'd rather play it safe.

idle owl
#

@tulip sleet So.... I thought I needed to enter the ROM bootloader to use the ESP Web Flasher, however, it connects while in the REPL or while running CircuitPython. Is this an ESP32-wide feature? Or is there something special about this board. Trying to do the CP install template for ESP32 boards, and want to make sure I'm doing it right.

#

Feather ESP32 V2 is the board in question.

tulip sleet
#

that's right, because it's serial only, you don't need to enter the bootloader. In fact, there is no BOOT button

idle owl
#

Hahaha. You're correct. I've been "entering" the ROM bootloader with the user button this whole time, thinking I was actually doing something. πŸ€¦πŸ»β€β™€οΈ

#

Ooof. Good job, Kattni.

#

OK, great.

tulip sleet
#

i was confused by that too, at the beginning, why is this button called SW38, etc.

idle owl
#

I knew it was named that. Thought it was still a boot button though.

manic glacierBOT
proven garnet
#

@tulip sleet I realize the requirements.txt for the BLE library should pin to the newly updated _bleio library, so a second PR for that is inbound shortly πŸ™‚

#

Once I release that

tulip sleet
#

@proven garnet bad edit, I think from a bad "suggestion"

proven garnet
#

I can touch it up!

manic glacierBOT
tulip condor
tame creek
jaunty juniper
tulip condor
#

i typed audiomp3 in the search box this repository and for code it says 0

jaunty juniper
#

yep that's github, better clone the repo and use git grep or silversearcher or similar

tulip condor
#

what im searching for is trying to answer that question about reading an mp3 that is in memory

blissful pollen
#

Which controller are you using? Never mind it seems it is port agnostic

#

shared-bindings is basically the API of the module and shared-module will have the implementation

tulip condor
#

i see fairly certain the answer to their question is no but wanted to check the C code to be sure

tulip condor
#

so two things aren't clear for me, checked the two first documents in the pins and second time I check the C code for someone

#

where are those macros like this MP_ROM_QSTR defined or explained?

tame creek
#

i think they're interned strings, to save flash memory

tulip condor
#

and 2) Looking at circuitpython-main\shared-bindings\audiomp3\MP3decoder.c and https://docs.circuitpython.org/en/latest/shared-bindings/audiomp3/index.html I'm trying to figure out how the link is done between what it says in the user help page and the .c file. The call to mp3decoder(data) seems to be audiomp3_mp3file_make_new as a sort of constructor (I assume?) whereas the other things have those STATIC MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_deinit_obj, audiomp3_mp3file_deinit); yet I was expecting to see something like (some_C_function(), "denit")

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.2 on 2022-07-20; Adafruit FunHouse with ESP32S2
Board ID:adafruit_funhouse

Code/REPL

import adafruit_logging as logging
from config import config


logger=logging.getLogger('logger')
# logger.setLevel(config.get('loglevel',logging.WARNING))


import another

Behavior

Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython cor...
tulip condor
#

or the 7-8 properties like channel_count

manic glacierBOT
blissful pollen
#

The MP_DEFINE_CONST_FUN_OBJ type calls are macros that help create the python functions based on the C functions

proven garnet
#

Anyone around for a quick review? The pyproject.toml update I just did for the _bleio library needs a quick fix before people on Blinka start having issues en masse!

tulip condor
#

I see thank you argonblue and Mark (Gamblor)

blissful pollen
proven garnet
#

Thank you kindly!

#

It probably might help to have a CI check that actually attempts to install a library so this can be caught

#

Weirdly, a botched pyproject.toml will still build and deploy the source and built wheel

#

So it only gets caught in dependent libraries currently

blissful pollen
#

I'll quietly admit I have never tried blinka out. I still feel I am beginner on python items

proven garnet
#

For what it's worth, despite all the pyproject.toml stuff, I've also not used it much (comparatively), though I have a project I want to use it for using my Pi Zero W2!

#

Also that fixed the issue, so thanks! After the mishap with the circuitpython_typing missing a dependency (or something like that) I remember seeing issues stemming from it for a few weeks, so better caught early haha.

blissful pollen
#

Yeah I can imagine. And you feel a bit more urgency when you realize that it was your mistake (looking at adafruit_bus_device ha)

manic glacierBOT
#

CircuitPython version

CP 7.3.3

Code/REPL

mp3 = io.BytesIO(my_mp3_as_bytes)
decoder = MP3Decoder(mp3)

Behavior

TypeError: file must be a file opened in byte mode

Description

I read a small (32kb) mp3 file into memory as bytes, from serial. Currently I must write those bytes to a file on the filesystem and then reopen it, because MP3Decoder only accepts FileIO objects. It would be useful to be able to give a BytesIO object to MP3Decoder, esp...

manic glacierBOT
lone sandalBOT
solar whale
#

In the "building CircuitPython" guide for updaing the repo, it still has ```git pull
git submodule sync
git submodule update --init

Then make again. at the bottom of the page <https://learn.adafruit.com/building-circuitpython/build-circuitpython#updating-your-repo-2986731> Is that correct? I have just been doinggit pull

make fetch-submodules``` and that seems to work OK.

spiral elk
#

The latter is correct

#

git submodule does a lot of unnecessary fetching from what I read

#

I.e. all of brocade-firmware

solar whale
#

That was my understanding as well @tulip sleet does the guide need to be updated?

jaunty juniper
#

ah that was updated at the top, not at the bottom !

tulip sleet
manic glacierBOT
#

The C implementation works only if the MP3 resides on a FAT filesystem such as CIRCUITPY or an SD card, because it makes calls like f_read to read data and f_lseek to seek.

It would be great if a community member could change the implementation so that it is in fact compatible with an in-memory file. At the same time, maybe it would be possible to implement streaming of mp3s over wifi.

Failing that, a doc fix for the type signature would also be good.

sullen needle
#

Good morning everyone,

I would like to contribute to https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 but I can not find documentation on how to setup the development environment. It looks like the project users pylint (I see a lint rc) and pre-commit (I see that config file as well). I assumed the optional_requirements file was for devs but it's empty.

Could someone direct me what to do? Or should I create a PR to add dependencies like pylint, and mypy (i'll add types)

Thanks!

proven garnet
#

@sullen needle I messaged you in the issue

proven garnet
#

Thanks!

onyx hinge
#

what did we do about wifi country settings in circuitpython?

#

in espressif port

#

I don't remember ever setting a country code or seeing docs about doing it

#

in principle this is important so that inappropriate/unlicensed frequencies aren't used unintentionally

stuck elbow
#

I've never seen anybody doing it, I know that in Japan you can use more frequencies than in US or Europe, but that's the limit of my knowledge

tame creek
#

yeah, a lot of Wi-Fi modules seem to technically support operations in multiple jurisdictions with different legally allowed frequencies. OSes do have to set them up properly to operate legally; i don't see how CircuitPython would be different

crimson ferry
#

in theory, we shouldn't be seeing channels 13-14 12-14 in the US, but there is traffic on those 12-13 (espressif chips don't do channel 14 that I know of)

ornate breach
#

You can use them as long as you dump the channels for flight radar

#

Ubiquiti APs use restricted channels but has it set up for flight radar detection so it can dump traffic if radar is detected

crimson ferry
#

is that on 2.4 or 5?

ornate breach
#

5GHz only as far as I am aware. No modern aircraft uses 2.4GHz radar anymore

crimson ferry
#

common microcontrollers don't do 5GHz yet

#

soon, we hope πŸ™‚

ornate breach
#

The new Nordic chip supports 5GHz and WiFi 6

#

Pretty excited to get my hands on it

#

Whenever they release it. I’ll try and write a circuitpython module supporting it if I do

crimson ferry
#

I have it on my to-do list to set country in espressif, but I probably won't get to it for a while

#

espressif port APs show up as CN or blank, depending on the scanner

crimson ferry
#

oh, did something change in CP8? shows up as US now

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.0-dirty on 2022-05-27; PyCubedv05-MRAM with samd51j19

Code/REPL

import msgpack, io
c = io.BytesIO()
msgpack.pack(145, c)
c.seek(0)
c.getvalue()

Behavior

Output in CircuitPython is b'\xd1\x00\x91', which is an int16, but this is encoded on unix as b'\xcc\x91', which is a uint8. The value is < 255 and positive, so I think it should be a uint8. Additionally, CircuitPython decodes `b'\xcc\x...

crimson ferry
#

Attention
2. The default country is CHINA {.cc=”CN”, .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO}

Attention
3. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which the station is connected is used.

#

So... if web workflow is on, the country code of the CP AP will match the external AP its Station is connected to, otherwise it will be CN (tested OK)

manic glacierBOT
tulip sleet
#

@idle owl I started working on the deep sleep issue. I thought you had written it up as an issue, but I can't find that issue. So, specifically, is it that ESP32 V2 does not appear to be deep-slepping. I just tested on Feather ESP32-S2 and I am seeing good deep sleep (about 80 uA)

#

also the status bar disabling is improved from yesterday, but I didn't try it with thonny yet

idle owl
tulip sleet
#

tnx!

proven garnet
#

Not entirely sure why the summary was giving weird answers for the number of assigned milestones buuuuut I did get the fix for it. Hopefully we have natural numbers of unassigned issues for the following meeting (sorry -2)!

idle owl
#

@tulip sleet Is the change in the status_bar PR something I should test? Or was it not to address the Thonny acting weird when I was toggling True and False in boot.py for the status_bar settings...

tulip sleet
#

It should fix the extra output you were seeing when the status bar was enabled (e.g. setting to True). It is more careful about when to write out the status line.

I don't know whether it fixes the Thonny problem -- I finished it late and did not get to test it with Thonny yet.

idle owl
#

Ok. I'll continue on my current track for now then, and if I still have time after this mission is complete, I'll test it with Thonny to see if it helps magically.

tulip sleet
#

I am seeing about 480 uA with the ESP32 V2 doing a timed deep sleep, with NEOPIXEL_I2C_POWER set to True

idle owl
#

Hmm.

#

With it False?

tulip sleet
#

just about to check that

#

seems like the same:

idle owl
#

I wonder why it's not working with my board and/or my code. 😦

tulip sleet
#
import alarm
import board
import digitalio
import neopixel
import time

# Remove these two lines on boards without board.NEOPIXEL_POWER.
np_power = digitalio.DigitalInOut(board.NEOPIXEL_I2C_POWER)
np_power.switch_to_output(value=False)

np = neopixel.NeoPixel(board.NEOPIXEL, 1)

np[0] = (50, 50, 50)
time.sleep(2)
np[0] = (0, 0, 0)
    
# Create a an alarm that will trigger 20 seconds from now.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 5)
# Exit the program, and then deep sleep until the alarm wakes us.
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
# Does not return, so we never get here.
#

basically same code as in the guide, except I changed the power pin name

#

not the greatest low power, though, 0.5mA, basically

#

I tested on a Feather ESP32-S2 also and got about 80uA with the same program

idle owl
#

So something is up

#

With the ESP32.

tulip sleet
#

it could be how we're setting up and calling the deep sleep. There are a lot of knobs and they may be different on the ESP32

idle owl
#

Hmm.

tulip sleet
#

I'll look at that next.

idle owl
#

Mine still isn't as good as that with my code.

#

So also something up with my code.

#

I guess.

#

Or the way it's interacting with the CP knobs.

tulip sleet
#

I am running a build with status bar forced off, like the one I gave you. Where is the arduino deep sleep example? I will compare that

idle owl
#

Um, hold on

manic glacierBOT
#

@dhalbert no worries. It's been awhile since I've been actively looking at circuitpython so I'll need to take a deeper dive with more recent versions before this can move forward I think. In hindsight this may be more of a blunt approach than is necessary if it ends up only being a few devices. Notably, the Solder Party Keyboard Featherwing needed this timeout value change for the keyboard to work, but I don't recall extensively testing with other I2C devices. I'll get back to you.

hidden rain
#

Finally performing some git operations in my new build env. it seems it can't find python. this is where I messed up last time. Do I alias, use deadsnakes, or python-is-python3, or what?

jaunty juniper
#

I would go with python-is-python3, that should work

hidden rain
#

ok..giving that a go...

manic glacierBOT
#

I looked at it briefly when somebody brought it up on discord a few weeks ago, it's an issue that msgpack can't really decode what is encoded by C python. I think adding uints is straightforward, but there's 64 bit types to support too, including doubles which is the default that C-python uses for encoding floats it seems.

https://github.com/adafruit/circuitpython/blob/884371fea7eabdb713a8b4b4f049e0b95efa0a80/shared-module/msgpack/__init__.c#L485-L490

jaunty juniper
#

@tulip sleet looking at the msgpack issue, I don't know how to decode bytes into a long int. Simply adding a matching (uint*_t) cast to the code that reads 8, 16 and 32 bits ints turns out to work for numbers below 0x3FFFFFFF , but higher numbers, and 64 bits numbers would have to go through whatever makes long ints

manic glacierBOT
tulip sleet
manic glacierBOT
tulip sleet
#

mp_obj_new_int_uint() will work for 32 bit unsigned ints

#

there is also mp_obj_new_int_from_ll(long long val) and mp_obj_new_int_from_ull(unsigned long long val). I think long long would be 64 bits

#

See py/objint.h and the longint impls, like py/objint_mpz.c
@jaunty juniper ^^ several

jaunty juniper
#

I would like to have doubles too, because C python seems to always encode floats into doubles

manic glacierBOT
#

I think adding uints is straightforward

To be more accurate when I say that, a simple (uint*_t) cast works for ints that fit in a CP int (below 0x3FFFFFFF) but higher numbers require to use long ints,. I'll see if I can look into that.

Python does not have native uint's - hence the encoder never generates them in the output.

Note that C-Python does use uint for positive ints in msgpack. I don't think we need it in CP because it's more code that does not add functionality, it ...

tulip sleet
#

it's true on both M0 and M4, because M4 does not have native double support

#

Might consider squashing doubles into floats "by hand" and complaining if they don't fit if the exponent is too large

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-7-g4ae97bec6 on 2022-08-23; Adafruit FunHouse with ESP32S2

Code/REPL

#none

Behavior

computer tries to boot from attached CircuitPython board.

Description

When I restart my computer it tries to boot from CIRCUITPY. This has happened with CP7.x as well.
I'm running Windows 10 on a Dell Precision 5500.
Usually it eventually boots on the internal disk but this time (after a bios update...

jaunty juniper
spiral elk
proven garnet
#

Maybe someone else can confirm, by the py.typed file inclusion in libraries is for type checking right? So like mypy. Type hint assistance like Pylance gets on just fine without it, so I assume it's not a signifying file for hinters.

#

Or does PEP-561 actually say that if you type annotate you're supposed to supply that file.

#

Trying figure out if that should (or supposed to per PEP) get added to typed libraries or whether it's only something we need if mypy enters the mix.

hidden rain
#

python in build env, still not quite correct. When trying to perform a git commit, I get this:

#

File "/home/latkinso42/.local/lib/python3.10/site-packages/pre_commit/repository.py", line 84, in _hook_install
raise AssertionError(
AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment

more info:

virtualenv python version did not match created version:

  • actual version: <<error retrieving version from /home/latkinso42/.cache/pre-commit/repogpa7707b/py_env-python3/bin/python>>
  • expected version: 3.10.4.final.0
#

Any ideas? (BTW, I did use python-is-python3)

manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet When we have a workaround for Thonny in CircuitPython, or a fix submitted to Thonny, we should announce it in this channel and #help-with-circuitpython so folks know. I keep forgetting about the problem because of my fancybuild, and suggesting it to new folks.

manic glacierBOT
tulip sleet
idle owl
#

@tulip sleet Is your latest code in the PR? I can test it right now too.

tulip sleet
#

it is; i am testing it right now; If I have a = 1+ as the only line in code.py, the thonny REPL goes into zombie mode after executing code.py. Trying without my code at all and with status bar completely disabled to seeing if I can duplicate

idle owl
#

Ok

#

I'll let you test it then. If you want me to try to replicate anything, let me know

tulip sleet
#

were you have the trouble on esp32 V2 or ESP32-S2 TFT?

idle owl
#

ESP32 V2

#

S2, I would be using PyCharm and tio.

tulip sleet
# idle owl ESP32 V2

ok, so far, confirmed code.py with an error does not mess up with main build with CIRCUITPY_STATUS_BAR = 0, which is what you already saw. Also PR with modification of CIRCUITPY_STATUS_BAR = 0 works. But there can't be an error in boot.py. An error in boot.py causes Thonny to mess up as well. PR without the CIRCUITPY_STATUS_BAR = 0 and disabling status bar in boot.py still does not work. Debugging...

idle owl
#

Oof.

#

Ok

idle owl
tulip sleet
#

I disabled in boot.py, still messing up, and suspiciously seems to be turning itself back on when I disable in code.py. It should be persistent between soft restarts even when done in code.py

#

It also looks like Thonny might have issues with errors in boot.py independent of the status bar

#

but I haven't tried that methodically yet

idle owl
#

Fair enough. Got it.

manic glacierBOT
manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet Any changes since the 24th that are worth you making me another STATUS_BAR = 0 build? Or is my existing one fine?

tulip sleet
#

i can make you another one in an instant to make sure

idle owl
#

That would be great. Thanks. Feather ESP32 V2.

manic glacierBOT
idle owl
idle owl
#

@tulip sleet Limor had me switch which alarm pin I was using because apparently the one I was using is Weird. It was potentially the reason for the power numbers, but turns out it's not. I tested again with the PPK, and it's the same "deep" sleep numbers. With a huge delay in sending data, the "running" numbers are different than they were, so that's helpful for battery usage, but that's only due to the new delay.

tulip sleet
#

I am not there yet, still working on status bar. I am getting a safemode HardFault_Handler, but it's only provoked by thonny, not by doing things in tio. ugh

idle owl
#

No worries, I was simply letting you know.

hidden rain
#

@tulip sleet: did you use python-is-python3 on your Ubuntu 20.04 ?

#

Has anyone?

tulip sleet
hidden rain
#

I'll wait..thanks

tulip sleet
#

so save your sysconfig.py as sysconfig.py.old or something and try the new version

#

There is a lot of finger-pointing going on over this but no one has really stepped up that I can see. I think it was fixed in Python 3.11 beta packages, but I didn't want to go there (and maybe that's why you tried 3.11).

#

If this works for you I will put in some temporary stuff in the Building CircuitPython guide about this.

#

the old file is sysconfig.py~. I am curious if that matches your current sysconfig.py

hidden rain
#

Great being diligent is always better. I ran off half-cocked last time. I will give this a try now....Thanks!

tulip sleet
hidden rain
#

I found it difficult to believe that everyone else had a working env except for me. I know there are many ways ... but we should have at least one known way that anyone can replicate. I'll let you know how this goes...thanks

tulip sleet
#

i think a lot of people don't use pre-commit in circuitpython builds. It's more common in library builds

#

i myself forgot to reinstall it after redoing my repo clones. You could just pre-commit uninstall if you get frustrated

hidden rain
#

LOL. i did uninstall and then reinstalled

tulip sleet
#

I myself don't understand the issue, but I haven't taken the time to really try to understand it; I just keep hoping it will get fixed by ubuntu

tulip sleet
#

it has to do with virtual env paths or something

jaunty juniper
#

I have not had that issue, then again I keep 3.9 as my default python, and I buld CP in a venv that I don't update anyway

tulip sleet
#

that is certainly the way around this. I think it became broken in 3.10, and maybe was fixed in 3.11 (or at least it's not broken in deadsnakes, etc.)

jaunty juniper
#

I use pyenv too to switch between versions if need be, which turned out to be useful when testing running Mu from source, which requires python < 3.9

tulip sleet
#

The issue is still open

#

pre-commit uses virtualenv, not venv

#

because venv is not available everywhere

random junco
#

The PSF sent out a survey today about packaging and environments, even they seem to know it's a problem now

jaunty juniper
#

speaking of Mu, I'm experimenting with using exec (or subprocess) to call powershell commands on windows, which seem to always be available, to find USB information (board name) without depending on additional python modules

#

(in relation to Scott's Mu PR)

#

I wonder if we could add the product field in Adafruit_Board_Toolkit with that

#

and then rely on that in Mu

tulip sleet
#

I tried to make the purview of Adafruit_Board_Toolkit be general, so you could add another .py or directory in there if it doesn't fit in the currentAPI structure

proven garnet
#

Is there ever a time that socketpool.SocketPool() doesn't use wifi.radio? I couldn't find anything, but adding the docstring now and wanted to know if I should say it always uses, or ALMOST always uses it.

jaunty juniper
#

it's a field that is just empty on windows

tulip sleet
#
void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *self, mp_obj_t radio) {
    if (radio != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) {
        mp_raise_ValueError(translate("SocketPool can only be used with wifi.radio"));
    }
}
#

lol

tulip condor
tulip sleet
#

@proven garnet maybe on a different port it might have a different value ... if there is a different network interface (e.g. ethernet capable, etc.)

jaunty juniper
#

I aim for "always available", the point being to try not to rely on python modules, but most importantly to never rely on non-pip installs

tulip sleet
#

so there is latent support in the API for other network hw

manic glacierBOT
crimson ferry
#

I suppose in theory ESP32-S7 or something could have an Ethernet or some other low-level interface with a socket source, and we could native that rather than using library code like in WIZnet. ESP32 has an Ethernet PHY.

onyx hinge
#

out of curiosity, I tried debian.org python3.10 and python3.11 packages in a debian:unstable docker image and both can 'python3.xx -mpip install pre-commit' and then run the pre-commit of a circuitpython module. I didn't try circuitpython core. I can't vouch for packages from ubuntu or from a ppa, either.

#

e.g., python3.11 -mpip install pre-commit; pre-commit run .

#

since it sounded like ANY created python environment was deemed 'not healthy' I was tempted to think this was a good test

tulip sleet
#

it would be interesting to compare the packages and that config.py file

onyx hinge
#
# apt update
# apt install python3.10 python3-pip git
# adduser jepler
# su - jepler
$ python3.10 -mpip install pre-commit
$ git clone https://github.com/jepler/wwvbpy
$ cd wwvbpy
$ ~/.local/bin/pre-commit run --all  
[runs successfully for me]
tulip sleet
#

what version of pip is it?

onyx hinge
#
Python 3.10.4
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
tulip sleet
#

that's what i have also. Is python3.10 the same as the installed python that comes in the docker image. I would think there is already a preinstalled python which would be 3.10

onyx hinge
#
Python 3.10.4
```yes
tulip sleet
#

3.10.4-0ubuntu2 is the version I have

#

of the package

onyx hinge
#
-bash: python: command not found
#

[python: command not found is "correct, for debian and derivatives"]

tulip sleet
#

apt show python3

#

right, python-is-python3 just adds a link

#

esp-idf needs it

onyx hinge
#
python3:
  Installed: 3.10.4-0ubuntu2
  Candidate: 3.10.4-0ubuntu2
  Version table:
 *** 3.10.4-0ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
tulip sleet
#

@hidden rain could you check your versions against the above?

#

pip3 list |grep pre-commit
'

#

is 2.17.0?

#

2.20.0 seems to be the newest

onyx hinge
#
pre-commit   2.20.0
jepler@a4748e7681b2:~/wwvbpy$ pip list | grep pre-commit
pre-commit   2.20.0
#

why do you mention 2.17?

tulip sleet
#

I just hadn't upgraded in a while. But I don't understand why @hidden rain's brand new installation had this problem.

hidden rain
#

@tulip sleet yes 2.20.0

tulip sleet
#

was this a VM install, or WSL?

#

I would like to try to duplicate your install and see the error

hidden rain
#

Oracle vbox

tulip sleet
#

did you run esp-idf/export.sh before you had the problem with pre-commit?

hidden rain
#

No

tulip sleet
#

did you update all the packages after the install?

hidden rain
#

Yes

tulip sleet
#

sudo apt update; sudo apt full-upgrade (or dist-upgrade)?

hidden rain
#

Oops. Not the later ...just the first

tulip sleet
#

the latter will upgrade more packages

#

hmm

#

do you mean you just did sudo apt update and not sudo apt upgrade

tame creek
hidden rain
#

My internet down..on cellphone...Will have to resume tomorrow.

#

Thanks for all the digging

tulip sleet
#

if you didn't do sudo apt upgrade or sudo apt full-upgrade, that may be the issue. THanks!

hidden rain
#

I'll try the full tomorrow...

#

πŸ‘

#

Have a good night does thanks for all your hard work

manic glacierBOT
brazen hatch
#

I got my hands on a beetle esp32c3 and loaded cp
I know esp32c3 chip support is beta but like are the bugs known?
I don't see much of the issues I see on git..

  • Pictures
  • usb_cdc is gon
#

esp-idf did verify just so we are clear

#

these issues are both on the 8.x beta 0 and latest commit builds

#

for now imma emulate usb_cdc to boot ljinux

jaunty juniper
#

usb_cdc is conditional to having actual USB in the first place, since it's handled by tinyusb

#

which means having to use prints and input, and I don't know how well sys.stdin and sys.stdout actually work in CP

#

I tend to advise using usb_cdc.console to have a cleaner interface than prints and input(), it might be worth having a common API for the console (repl) serial channel access ?

#

(I wonder if it would be possible to have a web REPL exclusive to the serial connection, freeing it for USB communication use)

brazen hatch
jaunty juniper
#

well you're set then πŸ‘

brazen hatch
brazen hatch
#

(sorry for ping, forgor da button)

#

discorb moment

jaunty juniper
manic glacierBOT
#

CircuitPython version

Applicable to CircuitPython 8.0.0-beta-0, and main branch builds.
Adafruit CircuitPython 0a7c1ef15 on 2022-09-02; DFRobot Beetle ESP32-C3 with ESP32-C3FN4

Code/REPL

>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Invalid run_mode

Behavior

ValueError

Description

Doens't work with any of the modes.
...

jaunty juniper
#

@brazen hatch what do you mean "use board.board_id as part of an import name" ?

#

could you show the code where you do that ?

brazen hatch
#

sure one sec

jaunty juniper
#

have you tried with imported = __import__("something") ?

brazen hatch
#

with open(board_config := f"/config-{board.board_id.replace("-","_")}.json") as config_file:

#

wait wrong one

brazen hatch
#

exec(f"from pintab_{board.board_id.replace("-", "_")} import pintab")

jaunty juniper
#

that one ?

brazen hatch
#

yea

jaunty juniper
#

so, how about:

pintab = __import__(f"pintab_{board.board_id}").pintab
#

or something like that

brazen hatch
#

lemme try it, I have never used __import__

jaunty juniper
#

(for the record I'm in favor of having all lower case and _)

#

the magtag has a "." in it too which would have a similar problem

brazen hatch
#

pain

jaunty juniper
#

__import__ might take the full file name

brazen hatch
#

I kinda thought all of them were and rolled with that piece of code

#

loading it now
making it takes a bit

#

whoa it actually worked

#

Thanks a lot!

jaunty juniper
#

yeah __import__ is for importing from arbitrary file names

manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet I'm going to test this updated PR build with my code and Thonny since we need to make sure it's going to work in situ.

#

Loading the bin now.

tulip sleet
#

I no longer see Thonny having trouble, so there may be nothing to PR to Thonny now.

idle owl
#

Yeah I saw that.

#

We'll see it if works for me. Since..... I'm really good at making things not work. πŸ˜„

#

@tulip sleet Back to the PROBLEM IN THONNY'S BACK-END error when I disable the status bar in the console, and reset the board. It does not auto-enter the REPL when the code is done running (or throws an error and stops running), and when I press enter to get to the REPL, the error occurs. If I restart the backend, and reset the board again, it begins working properly.

#

Let me try it one more time to make sure I can repro that exact sequence.

#

Oof. Deleted my error and set it to True in boot.py, reloaded the code, and then when I stopped the code, it did not enter the REPL automatically, so I hit enter, and Thonny threw the same error.

#

So I didn't even get to disabling it again before getting the same error.

#

Let me try with your code.

#

Error.

#
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your CircuitPython device and try again.


Process ended with exit code 1.```
#

Restarting backend, makes it work.

#

Also, it's not clearing the status bar on the first run after resetting the board with it disabled in boot.py.

#

Clears it when I restart the backend.

#

Hm maybe I should put this in the PR.

tulip sleet
#

I am testing with the code.py below and no boot.py, so status bar is on:

import supervisor
#supervisor.status_bar.console = False

a = 1+
idle owl
#

Ah ok

#

let me try that.

tulip sleet
#

every time I ctrl-D it reports invalid syntax and starts over again

idle owl
#

Error.

#

With that exact code.

tulip sleet
#

I saw the status bar in the REPL output the first time, but now it's being snarged up and display by thonny

idle owl
#

Yeah, it shows up in serial a lot. Heh.

tulip sleet
idle owl
#

Thonny was started fresh after the new bin was uploaded.

#

So it's not cached or something. Afaik.

tulip sleet
#

Help->About Thonny says 4.0.0, is that right?

idle owl
#

Yep

tulip sleet
#

i'll try the artifact as opposed to what I built locally

idle owl
#

Ok

tulip sleet
#

do you have a boot.py? If so rename it or delete it

idle owl
#

I don't, I deleted it via the web file server.

tulip sleet
#

artifact works for me ... hmm

idle owl
#

I'll check again though.

#

I don't imagine Thonny could create one without it showing up there.

#

I refreshed it.

tulip sleet
#

I do not have an .env, could you rename that and do a hard restart? You will need to rename it back in the repl later

idle owl
#

Sure.

tulip sleet
#

I can type ctrl-D over and over here and it just repeats what you see:

idle owl
#

Hahahaha, I renamed .env, restarted Thonny and the board, and this happened.

#

Got to the REPL this time and errored, that's a new one.

tulip sleet
#

if you press the STOP sign does it recover?

idle owl
#

Restart backend, and then soft reload, and it works again.

#

Yeah.

tulip sleet
#

and again and again?

#

ctrl-D over and over?

idle owl
#

Yep, a bunch of ctrl+D and it's still working.

#

Should I redownload and reinstall Thonny? I'm πŸ€·πŸ»β€β™€οΈ at this point as to why it works for you but not me.

#

I have an app that clears out background files when you delete a MacOS app.

tulip sleet
#

it should be fine if it self-identifies as 4.0.0

idle owl
#

I'll try getting it again.

tulip sleet
#

i'll try it on an M1 Mac later this afternoon. Unfortunately that was upgraded to Ventura beta to test something else, but hopefully it is not too much idfferent

idle owl
#

Oof.

#

Who knows there, heh.

tulip sleet
#

are you running Thonny in a venv or something

idle owl
#

No, I installed it from the .pkg file you download from thonny.org

#

I didn't do anything fancy with it

tulip sleet
#

this seems more like some timing or other difference about getting the serial connection set up. So it seems like it works eventually after a thonny reset or too.

#

I installed thonny with pip3 in my case

idle owl
#

OK, let me try this again.

tulip sleet
#

I did not try the standalone installer

idle owl
#

If it goes weird, I'll pip install it.

#

Well it didn't kill all the background files..... it still knew I wanted CircuitPython and which port to use. Bleh.

#

First hard reset of board, throws error.

tulip sleet
#

that is probably not the problem

idle owl
#

I'll delete it and pip install it.

tulip sleet
#

I don't expect it to work perfectly after a board hard reset. The serial output has all kinds of junk in it before it gets to the REPL prompt

idle owl
#

But this error happens literally every time.

#

In this sequence.

#

Restart backend, it works. But I feel like that's not really working.....

#

If you have to get around an error every time.

tulip sleet
#

i have to be afk for about 1.25 hours. I'll see about cleaning up the startup. But it's not crashing once it gets going, which I think is the main fix. CircuitPython was actually getting a HardFault_Handler error; that was a real bug I fixed

idle owl
#

Fair enough.

#

I'll try this one more time, and then probably go back to the guide.

#

Same error with pip installed Thonny.

#

Blergh. Dan, when you're back, let me know if theres anything else you want me to try.

manic glacierBOT
#

Tested with Thonny. I'm still getting the PROBLEM IN THONNY'S BACK-END error after rebooting the board. Tried it with/without boot.py, with/without .env, and with the same code as Dan used. I can consistently get the error when restarting the board or restarting the Thonny app. If I click the STOP button to restart the Thonny back-end, Thonny begins working smoothly again. If this is meant to be part of the workflow, it should be documented. If it's not, we need to figure out why it's happe...

idle owl
#

For the ESP32, are the code and library files still stored on a "filesystem"? Or is there some other word for how that works.

jaunty juniper
#

I would say yes, it's still a fat formatted file system where you can use open(), os.rename, mkdir, stat, etc.

idle owl
#

Ok thanks Neradoc.

crimson ferry
#

...and presumably, since there's no USB MSC, files can be written to flash from CircuitPython code at any time? (potential conflict between web workflow and code... but I'd guess the core manages that?)

jaunty juniper
#

I don't know what happens if a file is open in code and the WW tries to read/write to it πŸ€”

#

hopefully it just fails

crimson ferry
#

WW gives a notice if USB is cconnected, maybe some checking is needed for other possible filesystem conflcts

jaunty juniper
#

there is a "file write error" that returns 500 if open fails, so hopefully that's what happens

crimson ferry
#

CP open in web REPL gets OSError: [Errno 30] Read-only filesystem

jaunty juniper
#

on the ESP32 ?

crimson ferry
#

no, ESP32-S2

#

I don't have any [new] ESP32s (but I'd like to get my inventory of old ones working eventually)

jaunty juniper
#

oh ok that's normal

crimson ferry
#

but why would ESP32-S2 be different if USB isn't connected?

jaunty juniper
#

because the switch is on whether or not USB is enabled

crimson ferry
stuck elbow
jaunty juniper
#

we could make it that storage.disable_usb_drive() implies remount("/", readonly=False)

stuck elbow
#

you can remount the filesystem as rw

jaunty juniper
#

agreed

stuck elbow
#

explicit is better than implicit

jaunty juniper
#

since it's the expected behavior on the S2, I would sill need to enable it manually, you are already editing boot.py anyway

stuck elbow
#

note that on boards without usb you can also use better filesystem than fat12

crimson ferry
#

I'm just trying to determine if, on a non-USB or USB-disabled device, whether there are still conflicts between filesystem access between: web workflow, BLE workflow, CircuitPython code

stuck elbow
#

there should be no conflicts

#

since all file operations are then performed by CP's functions

#

there wouldn't also be conflicts with USB if we used MTP instead of MSC

jaunty juniper
#

that's what I expect, but you know, between theory and implementation... πŸ˜›

stuck elbow
#

well of course there can be bugs

crimson ferry
stuck elbow
#

if only Apple unlocked mtp, but then nobody would use itunes

silver tapir
#

I was trying to enable rotaryio on a qtpy-esp32c3. I noticed the module is missing, so I tried recompiling, and now it's complaining about soc/pcnt_struct.h missing.
Can support for rotaryio be enabled for the c3 or is there something missing on the hardware side or on the chip port side?

stuck elbow
#

make clean

silver tapir
#

I'm googling, and it seems somebody in C had to make it's own module as it doesn't have support for PCNT on the espressif library.

stuck elbow
#

but it's possible not everything is there

edgy flax
#

so @idle owl , @proven garnet or @lone axle - for https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305/issues/14

The init on this part is def init(self, bus, **kwargs) -> None

bus can be spi or i2c: in the past I've used displayio.I2C or displayio.Fourwire , so does this really make any difference here? or is there a better way to annotate 'bus'?

GitHub

There are missing type annotations for some functions in this library. The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error f...

jaunty juniper
idle owl
edgy flax
lone axle
#

Will post a reply on the issue in a moment.

edgy flax
idle owl
silver tapir
#

Oh, and for the rotary encoder, I'm using the stemma qt breakout, which has it's own seesaw, so I guess it's ok not to have hardware support for rotary encoder.

#

Or is it possible that I don't need to recompile the complete circuitpython, but just the rotaryio library?

idle owl
#

I'm not sure, though. Don't take this as a confirmation.

jaunty juniper
#

you don't recompile anything, just follow the example in the guide

silver tapir
#

@jaunty juniper Yeah, I just saw that this particular device has it's own learning guide separate from the rotary encoder one.

#

Thanks a lot, that solves it.

jaunty juniper
#

hey anyone wants to try the Mac build of my app ? It finds web workflows (and USB), and allows running circup type tasks on it as well as access the file system. Editing the files is not implemented yet and opens a direct link to the board in the browser

idle owl
#

Sure. I have an ESP32 Feather V2 sitting here, would that suffice for testing?

jaunty juniper
#

yeah

#

It's the alpha of an electron app so... you know... but I actually started using it for real

idle owl
#

Hehe

#

Taking a minute to load. Does it work with circuitpython.local?

#

Or do I need to get the IP.

jaunty juniper
#

it should find the boards itself, or you can enter the IP in the field at the top

idle owl
#

It didn't find any :/

#

Oh wait

#

I borked my env file for testing

#

no wonder

#

let me fix that

#

There it is!

jaunty juniper
#

I did test on another computer than my dev computer, but if it runs on someone else's that's already a victory πŸ˜›

idle owl
#

FIlesystem loaded!

#

Loaded three libraries

#

@jaunty juniper This is pretty slick. Great job!

random junco
#

@jaunty juniper Working here too on my Mac. This is cool

jaunty juniper
idle owl
#

Nice

#

@jaunty juniper Anything specific you want me to try? Or was it more to see if it works at all?

jaunty juniper
#

a little bit of both, see if it helps you and feel free to give feedback

idle owl
#

I don't have feedback really. I'm still a web workflow noob though.

#

This would be helpful though.

#

Loading individual libraries through the browser was annoying.

#

Doesn't let you select more than one folder at a time.

#

I only needed 3, but oof if you were using PortalBase or something.

jaunty juniper
#

yeah, the library installer has worked pretty well so far. The app doesn't handle connection errors too well, so once or twice I had to reinstall a library, but it detected that a library's directory was empty with "update all" and was able to fix it

idle owl
#

Convenient.

#

Also, it did not crash. There's some feedback. πŸ˜„

jaunty juniper
#

it's an electron app so if it looks stuck you can command-R to reload the window without restarting the app

tulip sleet
#

@idle owl testing some sleep current. 80uA on ESP32-S2 with just a time alarm, 160 uA with time alarm + pin alarm (the pin takes current when sleeping). But the clincher (maybe this is what you saw) is that if .env is present and working, the board does not deep sleep, maybe because it thinks it's potentially "connected". (I do not have the web workflow open in this case.)

idle owl
#

Oh hmmmmmmmmmm

#

I wasn't connected to the computer at all when I tested.

#

It still keeps it awake though?

tulip sleet
#

but you had a valid .env, is that right?

#

I haven't tested yet on ESP32 V2, but I would think it would be similar.

idle owl
#

Because it's a huge pain not to have one.

#

So I need to delete it and then recreate it every time to edit again?

#

Er wait. Thonny doesn't need it.

#

Only web workflow.

#

Let me try my code again, delete the .env, and test with the PPK.

tulip sleet
#

so we'll have to think about when we should go into deep sleep if there's no USB but there is a valid .env. Because the web workflow is not necessarily "connected" (because the file browser commands are HTTP requests that don't have persistent connections), then when is the board "disconnected" and it should deep sleep for real? Maybe only if there is a web serial connection??

idle owl
#

Uff.

tulip sleet
#

and suppose you deep sleep for real without a USB connection, and you incidentally wrote a loop that deep-sleeps nearly all the time, how do you get into safe mode or interrupt it to stop the loop? It would be a pain

#

I will write up the power consumption for real deep sleep somewhere after testing on a few other boards

idle owl
#

Ok.

#

@tulip sleet I will still need your help putting it in a guide. I don't know where it should live, and I don't really understand much of anything you and Limor talked about on whatever day. I'm happy to do it, but will need assistance, I think.

tulip sleet
#

i think I will write a draft page either for the deep sleep guide or the ESPxx product guides. Could be mirrored to both, actually

idle owl
#

Ah that would help.

#

@tulip sleet !!

#

Is it worth checking if the NeoPixel/I2C Power pin is actually being shut off?

#

I guess I could plug in a sensor with a power LED on it to the STEMMA QT port. Right?

#

I know Limor told you to use a scope, but this sounds easier.

tulip sleet
#

I will test this with the ESP32 V2 also. Your code is further up, right?

idle owl
tulip sleet
#

I was testing in a simple way with and without setting the power pin to low before sleep. I did not see a difference

idle owl
idle owl
#

Board is deep sleeping, sensor LED lights up when plugged in.

tulip sleet
#

I thought maybe yes, but I don't see that. I am going to simplify the program again not to do any radio stuff

idle owl
#

I disable the pin at the end of the code.

tulip sleet
#

it might be that the radio being left on in some way. First I will test on ESP32-S2 because it's so much easier

idle owl
#

Ok.

#

@tulip sleet Hah! OK, so I made the board wake up, ran the PPK, and then pulled the alarm connection to enter deep sleep. The power LED on the sensor went off for a moment right as entering deep sleep, and then came back on as it stabilised into deep sleep. The current usage with the sensor plugged in is 765uA, which almost double it without the sensor. Point is though, the pin shuts off when it's told to, and comes back up when entering deep sleep.

tulip sleet
#

so the 421 uA average is without the sensor?

#

what is the sensor? I thought it was just the switch?

idle owl
#

I added an I2C sensor to test the power pin.

#

MCP9808, no code for it

tulip sleet
#

ah ok

idle owl
#

It's simply plugged in and the power LED is on.

#

Unplug, drops back to 421uA.

#

But I don't think the power pin is turned off. Which, if so, could be what's keeping it from being lower.

#

I can also plug in a STEMMA QT cable, and hook something up to power/GND only.

hidden rain
#

@tulip sleet: the full-update did not help, neither did the sysconfig.py. Thanks for all the suggestions. I finally uninstalled the pre-commit. WAs able to clean up my repos and sync with remote on all branches (had to perform a merge once). About to work on changes to PR #6757.

tulip sleet
hidden rain
#

yes thats what i did first, then tried the python sysconfig replacement

tulip sleet
#

@idle owl I am seeing similar power draw (474uA, supplied at 3.7V via the PPK, not using an actual battery) with this simple test program. Notice no wifi, etc.

import time
import alarm
import board
import digitalio

time.sleep(2)

# Turn off the NeoPixel/I2C power for deep sleep.
power_pin = digitalio.DigitalInOut(board.NEOPIXEL_I2C_POWER)
power_pin.switch_to_output(False)

pin_alarm = alarm.pin.PinAlarm(pin=board.D27, value=False, pull=True)

print("Entering deep sleep.")
alarm.exit_and_deep_sleep_until_alarms(pin_alarm)
#

I will try some variants on this (time alarm instead of pin alarm, etc.)

idle owl
#

@tulip sleet I'm getting 3.3V off of the STEMMA QT power pin while in deep sleep.

#

Sensor not plugged in.

#

not powered from laptop.

#

Well not directly. Through the PPK at the moment.

#

It's entirely likely I don't understand what's going on here, so I keep coming back to this. I'll quit that since you're well aware at this point, and it might be a red herring since I don't get things anyway.

tulip sleet
#

I'm not sure it's a red herring. It might be that the pin is reset back high unintentionally when in sleep. That would explain a lot of things.

idle owl
#

That's kind of what I've been thinking.

tulip sleet
#

@idle owl pin alarm vs time alarm makes no diff in 470uA sleep consumption. I will see about forcing the power pin to low during sleep.

#

may not get to that right away

idle owl
#

Ok, good to know.

#

Thanks!

manic glacierBOT
#

I was reading up on all the nice optimizations to keypad.keymatrix() and it's scanner. (Thanks by the way) The one thing I couldn't find was...can the new scanner support a duplex matrix?
Specifically, the 'Japanese' style duplex matrix explained here https://kbd.news/The-Japanese-duplex-matrix-1391.html which uses diodes both directions. Think of it like charlieplexing for keypads.

This would require the keymatrix to scan Row to Column, then swap and scan Column to Row.

(The PRK ...

small cypress
#

Am I right to assume/tell someone in help that there's no BTLE support for the S3 right now? Any rough ETA on it?

gusty yarrow
#

Will there be any support for rgbw in led animation or framebuf? I really like the mapping tool. I fou d out I can just import PixelGrid module, but I would really like to use the image method of framebuf.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit MagTag with ESP32S2

Code/REPL

import re

text1 = "CircuitPython loves regular expressions"
text2 = "CircuitPython \u2764 regular expressions"

regex1 = re.compile("re")

for text in (text1, text2):
    match = regex1.search(text)
    print(text)
    print("Match:", text[match.start():match.end()])
    print()

Behavior

The start() and end() are borked if ther...

manic glacierBOT
tulip condor
#

does python have some sort of .net/java style reflection or C++ black magic where you could change an include at runtime ? Seems char_LCD is hardcoded to use an MCP23xx I2C expander but I have a PFC8574

#

I found an obscure library somewhere for the LCD so that's not the question. I'd just have prefered to use the standard character_LCD library

manic glacierBOT
small cypress
#

Small thing that folks might already have a solution for, but I finally found a menu bar app for macOS that lets you unmount drives, including CP ones. It's intended to do so automatically on sleep, but I'm happily using it manually, especially with it's "Force unmount" option enabled, means I don't have to do the quit VSCode, force eject it, reconnect it, then reopen VSCode dance, anymore: https://github.com/nielsmouthaan/ejectify-macos (you'll need to add https://github.com/sindresorhus/LaunchAtLogin to the Swift Package Manager in Xcode to get it to build).

orchid basinBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-8-gb48141154 on 2022-08-24; ProS3 with ESP32S3

Code/REPL

import board
board.I17
board.IO17

Behavior

'''>>> board.I17
board.NEOPIXEL_POWER

board.IO17
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'IO17'


### Description

    { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO17) }, // Second LDO Enable control
    {...
sterile sentinel
#

so, in the land of Blinka, strictly speaking, do we need to define a microprocessor and pin.py (does anything depend on these existing other than the board definition?). I ask because I'm currently doing some weirdness with firmata/telemetrix to add the LattePanda Alpha's Arduino Leonardo coprocessor support lol.

#

I'm setting it up as a Pin class available within generic_linux microcontroller stuff, but it really doesn't make much sense to me to define my actual pins in a microcontroller path since it'll be more abstracted to the board level; eg: the LattePanda might use intel native pins (which should probably be defined in a pin.py) alongside firmata-exposed pins and buses for the coprocessor.

sterile sentinel
#

Just going to move forward for the moment assuming I don't need a pin.py for the firmata-exposed coprocessor and I'll just build it into the board. I feel like this is going to be fragile enough not to make it into the main build anyway so it's mostly for lattepanda peeps looking for a way to run blinka, which probably isn't many of us πŸ˜›

manic glacierBOT
#

a NULL first pin object is used to indicate that there are zero of some kind of pin associated with the StateMachine. However, mask_and_rotate wasn't checking for zero. It actually read data from near address 0x0 and (in my case) got a nonzero mask, which then caused a program with GPIO11 and GPIO12 as input with pull-up and no out pins to erroneously encounter the error "pull masks conflict with direction masks"

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
small cypress
#

Asked this in help, but realised it might be better here: Would it be possible to add links to some more common CP errors that take you to mini guides explaining what they refer to and what to do about them in a bit more detail?

tame creek
small cypress
jaunty juniper
#

no need for decision making code, the board is a #if

small cypress
#

As in, the correct strings would be baked into the firmware for that board at build time?

jaunty juniper
#

but bigger messages means bigger firmware, and we can't put every troubleshooting info in the error messages

#

hopefully googling the error message would lead to a good answer, I would rather bank on that

tame creek
small cypress
jaunty juniper
#

yeah adding links πŸ˜‰

small cypress
#

Googling can find you an answer, but it won't always work, or be correct. Just trying to look at this from the perspective of someone brand new to this getting an error that means nothing to them.

#

"pull ups? check my wiring? I need to pull on the wire?"

tame creek
#

yeah, i would really like there to be some topic-focused troubleshooting guides for CircuitPython that have easily searchable common error messages

small cypress
#

Yeah, that was what I was thinking. A learn guide which covers common stuff, and then that can be linked to from those things. I don't know the numbers we're dealing with here, but I'd hope/assume adding a link to a few errors wouldn't take up that much more space? Trying to remember if Adafruit has any short URLs heh.