#circuitpython-dev

1 messages · Page 414 of 1

slender iron
#

feather rp2040?

idle owl
#

Yep

slender iron
idle owl
#

@slender iron Oof, it's worse.

orchid basinBOT
idle owl
#

This time included the following amongst the normal reloads: ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
OSError: [Errno 5] Input/output error

Code done running.
reset 18286
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
OSError: [Errno 5] Input/output error

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 19510
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.
soft reboot```

#

But reloads more, and faster.

slender iron
#

I see that too

manic glacierBOT
#

Ok, I essentially ported this over to MatrixPortal to test how it would do on the ESP32 Coprocessor and in the process found a bunch of stuff that is creating duplicate references. So I think the root problem is caused by 2 things:

  1. The code creates a lot of the networking stuff outside of the MagTag library (while at the same time automatically initializing the same stuff inside of the MagTag library)
  2. The later CircuitPython versions don't handle the conflicting references very well...
idle owl
slender iron
#

yup, the number is the internal time that the reset happened

#

☝️ seems better

#

I do still get a couple

idle owl
#

Loading it now.

#

I'm still getting a bunch. But not as fast as the last firmware you sent. And no I/O errors.

slender iron
#

how big of a file are you copying?

idle owl
#

I'm not copying a file right now. I'm adding or deleting one line to or from code.py and saving.

slender iron
idle owl
#

I can find a tiny file to copy if you want me to try that too.

#

Yes. I just updated the gist as well.

#

Want me to simplify and try again? I mean, people are going to have files more complicated than this, so it's a good test, but I can try it with less code if you'd like.

slender iron
#

nah. longer files may write more to the fs

idle owl
#

Ok

slender iron
#

I'm only really seeing one now

#

one reload per save

#

I don't have all of the libraries though

idle owl
#

This time when I pressed a key to start the time.monotonic() timer, it reloaded on its own, did 4 reloads before settling back down again.

#

All pretty close to reset 324494

#

If that matters.

#

Figures I would pick the finicky board for this project 😄 Is there a potential bug? Doesn't matter. Kattni will find one!

slender iron
#

ya, that's weird. mind posting the log for them?

idle owl
#

(Key on the project)

slender iron
#

the numbers should be at least 750 apart

idle owl
#

You mean the serial output?

slender iron
#

ya

idle owl
#

Press any key to enter the REPL. Use CTRL-D to reload.
reset 324494
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 325672
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 326768
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 337816```I think they're about that far apart, I meant they were relatively close to each other.
#

Not identical.

slender iron
#

are you using pycharm?

idle owl
#

I am.

slender iron
#

I wonder if it has special files on the drive

idle owl
#

Oh.... I bet it does.

#

Only because of how I opened it.

slender iron
#

that shouldn't be new though

idle owl
#

Also true.

slender iron
#

I'm not seeing an issue from finder now

#

I copied all the needed libs over and got one reload per copy

idle owl
#

Wait, it regenerates the .idea file on save. So it's not because of how I opened it specifically.

#

I can try opening it in something else, but I feel like this should still be fixed... There wasn't an issue with this before.

#

Atom: ```code.py output:

Code stopped by auto-reload.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 761727
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
OSError: [Errno 5] Input/output error

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
reset 762767
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:```

#

Which created no extra files on opening.

slender iron
#

I haven't seen an OSError yet. that's very weird

idle owl
#

Right?

#

There's a NeoKey FeatherWing on it, but it's using keypad, so I'm not even sure what would be failing.

slender iron
#

it could somehow be the import statements failing

idle owl
#

Oof. In the time it took PyCharm to open, I got something like 13 reloads. No I/O error this time though.

slender iron
#

have you tried a non-rp2040?

idle owl
#

No. This is what I was working on. I can try TFT Feather ESP32-S2, sitting here. Or go get a SAMD51/nRF.

#

TFT Feather is likely running Arduino at the moment. So I'd have to grab some code for it too.

slender iron
#

ya, anything with the same version of CP to compare

#

(but not an rp2040)

idle owl
#

right. ok. hold on.

slender iron
idle owl
#

three reloads opening PyCharm.

#

1 reload editing code.

#

on TFT Feather ESP32-S2

#

Running a digitalinput button = red LED example.

slender iron
#

that's still fewer than rp2040 right?

idle owl
#

by a lot.

idle owl
#

Wait...

#

four this time.

#

😕 Ugh.

slender iron
#

weird

idle owl
#

OK, rebooted, edited code, only one reload after saving.

#

¯_(ツ)_/¯

slender iron
idle owl
#

One reload again on save from simple edit.

slender iron
#

I do remember seeing a second reload sometimes

idle owl
#

rebooting now.

#

One reload. Takes ages (obvs), but only one.

#

Let me copy something

#

Small file, one reload

#

26k file.

slender iron
#

ya, it feels a little slow to me

idle owl
#

Agreed.

#

How long was the second to last one you sent?

slender iron
#

750

idle owl
#

I can try that one again.

#

2 reloads after save this time, which yeah, I've seen that too. Let me try copying something.

#

One reload.

#

Still feel slow, but I'll take it over waiting seconds for a bunch of reloads to end.

#

Also, that was a file that probably copied in the amount of delay time

#

let me try something like a lib.

slender iron
#

the delay should reset at the end of each write

#

since we're trying to ignore small delays between writes

idle owl
#

One reload!

#

Was a relatively big one too.

#

(or glancing at file sizes, seemed like it)

slender iron
#

the delay is a bit more noticeable now since we exit the code immediately

idle owl
#

Ah.

#

My dinner has arrived, I need to go eat.

#

Fancy pizza. 🙂

slender iron
#

🍕

idle owl
#

👋🏻

gloomy shuttle
#

Moving the timestamp calculation to only when you press the key fixed the flickering for me.

while True:
    key_event = keys.events.get()
    if key_event:
        if key_event.pressed:
            print(key_event.key_number)
            if key_event.key_number == 1:
                if START_TIME is None:
                    START_TIME = time.monotonic()
                    PULSE_TIME = time.monotonic()
            elif key_event.key_number == 0 and START_TIME:
                CURRENT_TIME = time.monotonic()
                elapsed = CURRENT_TIME - START_TIME
                elapsed_min = elapsed // 60
                elapsed_sec = elapsed % 60
                timestamp = f"{int(elapsed_min):02}:{math.floor(elapsed_sec):02} "

                keyboard.write(timestamp)
                
    if START_TIME:

        time_pulse.animate()
manic glacierBOT
#

This unifies the delay into the post-run delay that also waits
for user input and fake sleep. This ensures we always delay.
Previous code would only delay if the code.py was running when
autoreload was triggered. Now it will always delay.

We also now suspend autoreload when a USB write starts and then
resume on completion. This should prevent reloading in between
sectors of a single write.

idle owl
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron @idle owl I have 7.2.2 release notes ready to go with the MatrixPortal and auto-reload fixes. Can push the button any time and do the release.

half pendant
#

Can I play music using my Adafruit Metro M4 feat? I read on the adafruit website that the Metro M4 has audio input and output. I have a Adafruit STEMMA Speaker (Plug and Play Audio Amplifier), but all the syntax listed on the website for this speaker is for the CPX. Can I use this speaker with the Metro M4? What is the CircuitPython syntax?

tidal kiln
#

@half pendant please ask in #help-with-circuitpython , this channel is more for development work on the circuitpython core firmware

manic glacierBOT
#

Compiling mpy-cross with clang 13 currently produces a few warnings, which are incompatible with the -Werror flag configured in its .mk file.

TL;DR: Clang 13 adds a warning for "variable is set but its value is not used", which causes mpy-cross to fail to build. Adafruit's GitHub Actions use Clang 12, which does not include this warning.

This is reproducible on main, and mpy-cross in tags at least as far as 7.0.0. I see that there are successful builds in GitHub Action...

orchid basinBOT
slender iron
#

@tulip sleet go ahead with the release of you’ve tested the reload too and are happy with it. I won’t be at my desk for an hour and 20. We’re doing the car seat check this morning

dusk gull
#

I am really hoping this is not a bad place to ask this, because it is a bit more advanced and it involves the build and development side of Circuit python. I was going to create an issue on github but it suggest using dicord or forums first.

Basically I build a lot of custom boards, I have used Micropython heavily in the past and with Damiens help added some features that really improved this experience. I often use the clock input with an oscillator and not a crystal (bypass mode) and Damien made easier access to this. The SAMD51 and SAME51 chips are different because they also have two clock inputs that you can select from. I have dug in the repos and found references to the clock sources, but not how to config them in a board folder/definition.

Now if there is a good way to do this now, awesome! If not I would heavily suggest that more of the clock input sources and configuration should be easy to put into config for the board.

Again sorry I found myself between two worlds with this question.

tulip sleet
dusk gull
# tulip sleet We have support for no-crystal builds, but not general support for other clock i...

Thanks for the reply. Yeah that is what I noticed was many example of just using the internal clock. I am running CAN and other peripheral that need higher accuracy clocks over wide temperatures. Ideally this would be in the board config and passing a value to change from crystal to bypass mode would hopefully be simple enough.

#if MICROPY_HW_CLK_USE_BYPASS #define MICROPY_HW_RCC_HSE_STATE (RCC_HSE_BYPASS) #else #define MICROPY_HW_RCC_HSE_STATE (RCC_HSE_ON) #endif #endif

I will look at that repo.

Is this a not so bad place to discuss implementation regarding this?

jaunty juniper
#

this is the right place

tulip sleet
#

It's fine to discuss this in GitHub as an enhancement issue, too. See how far you can get with the code. We aren't so likely to add this ourselves because there is very little demand (sorry), but as I mentioned, we welcome contributions

dusk gull
#

No worries, I just want to make sure I can talk to devs, I work with another developer that can also help with implementation, he is just not familiar with the clock setup and wanted to know more for the core developers.

Very much appreciate your time, and the repo you sent me @tulip sleet looks like it might have what I need. Worst case I can make a docker of a of circuit python to house a custom build system until it can be pull requested.

tulip sleet
#

you can just fork circuitpython and samd-peripherals and keep branches in the forks with your changes. A docker should not really be necessary.

#

Once you like your changes, you can submit PR's.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.2\.2
dusk gull
# tulip sleet Once you like your changes, you can submit PR's.

Sorry, yes overkill. I just will need to support a build system for a client during the prototyping phase, and I can share the docker with them and interact with it easily within VS Code. It has worked quite well with Micropython. I have a script that moves my custom board files (stored in the app repo) over to the docker image that VS Code mounts, and then I run the build processes.

But for the short term a fork makes the most sense

orchid basinBOT
dusk gull
#

Another questions that I hope is worthy of the dev chat. I am working with a client that want to have as big as a filesystem as possible with external flash and avoid SD. I have seen examples of up to 64MB flash being used with Circuit Python, is there a limit outside of FAT? I am looking to use 125MB, but see no examples and was not sure there is a deeper reason for this, or that most people just do not need it.

tulip sleet
dusk gull
tulip sleet
dusk gull
idle owl
#

@tulip sleet Regarding the reload issue, I'm not sure what Scott finally decided to do. I was still running into issues last night, but didn't test whatever the final PR was. I can test it now if you like. Obviously, the release is in progress, but still.

tulip sleet
#

as well cmd line

idle owl
#

Fair enough. I need a new build anyway because I currently have a debug test build from Scott running on this. I'll grab something.

tulip sleet
#

it's a lot better, maybe not perfect? we can always do another one, but I didnt' wnat to leave 7.2.1 out for long (also due to the MatrixPortal _bleio missing)

idle owl
#

Right, I agree.

#

@tulip sleet Oof, reload is slow. But it's still faster than waiting for 5 reloads in a row. That's significantly better with the 7.2.2 build. Oh I see it says "Reloading soon." Good wording.

tulip sleet
#

that was a good wording change. The reload time really reflects what's going on: it's safer than before. It doesn't wait more than 0.75 second after that last right.

#

macOS writes so many files... cp -X or whatever may make things more palatable for you.

idle owl
#

It was doing it while editing code, was my real problem.

tulip sleet
#

does pycharm store backup files on CIRCUITPY?

idle owl
#

Copying files, eh, inconvenient. Waiting for multiple seconds, or it felt like it, for it to stop reloading and actually run the code every time I changed something was incredibly frustrating.

#

I tried it with Atom too.

#

PyCharm has that .idea folder it puts in your working directory

#

But I deleted that and tried Atom, and same results.

tulip sleet
#

the old way, it didn't stop the program immediately, which means files might be changing out from under the program while it was running.

idle owl
#

Ah.

tulip sleet
#

i think it's really only 2 or 3 seconds, but compared with the old one, it does seem longer. Even 0.5 -> 0.75 seconds delay is noticeable

idle owl
#

Yeah for sure.

lone axle
# idle owl PyCharm has that `.idea` folder it puts in your working directory

If you're interested in stopping it from creating that .idea directory on the device there are some steps here: https://learn.adafruit.com/welcome-to-circuitpython/pycharm-and-circuitpython#creating-a-project-on-a-computers-file-system-3105042-4 that show how to set it up so that the "project" in pycharm is stored on your local PC (which is where the .idea dir will live) but the CIRCUITPY drive is added in as an extra content root which allows you to see and edit files on it.

idle owl
lone axle
#

That is different from how I generally start it up. But I think you could still do it that way. You would open the terminal in the project directory that is on your PC rather than the CIRCUITPY drive and run your start command. I would guess that will open PyCharm to that project specifically which should remember the content root configuration and still show you those files.

idle owl
#

Ah fair enough.

lone axle
#

Honestly I didn't realize you could start it from the terminal in a certain location. That is awesome and actually probably easier than my normal workflow of using either File -> 'Open' or 'Open Recent'. Because I can find stuff outside of pycharms file explorer much faster. I'm glad you mentioned this, I will probably start opening it this way when I am trying to get specific projects open.

idle owl
#

I had to set something in PATH or some such, but now I can go into any directory and do pycharm . and open it.

lone axle
#

oh nice, I should add an entry in PATH for it. I had to do the full path to /opt/somewhere.

idle owl
#

PATH might not be right. I can't remember what was.

manic glacierBOT
#

@ladyada Use Case: I would like to use one core for monitoring a Loconet (from Digitrax) communication channel and a DCC reception (using PIO for the low level work) and use the other core for managing 16 GPIO (servos/buttons/current block detection/IR sensors, maybe other uses later), updating a neopixel bus, i2c communication (RFID, eeprom, display, etc) and possibly a bit more. I want to keep the loconet and DCC on it's own core to help prevent data loss in the PIO I/O buffers. I'm just ge...

lone axle
#

I think there are a few ways, maybe alias is another one. I've set up a few things like that. But I do it in-frequently enough that it hasn't gotten stuck in memory. I have some notes with the steps I've used before.

slender iron
#

@dusk gull This is definitely the right place to chat about circuitpython development and we'd love to have you PR your changes so that you can use upstream in the long run.

#

With the broadcom port I put the "CIRCUITPY" drive on an SD card and it worked with multigig just fine.

#

One limitation to check is that the QSPI or XIP peripheral supports flashes of the size you want

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.2 on 2022-03-15; Adafruit Feather RP2040 with rp2040

Code/REPL

No code or input needed to reproduce the problem.

Behavior

Connection lost (read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?))

Use Stop/Restart to reconnect.

This message occurs shortly (<30 seconds) after connecting thonny 3.2.7 to an ```Adafruit RP2...

dusk gull
#

Fully understanding people are busy, which includes myself and why I am asking, but does anybody internally or externally to Adafruit have time to help me with some modification to Circuitpython for external clock support. I have more money than time at the moment. And somebody that is much more familiar would be a help as well .

random junco
#

@dusk gull If no one responds here, maybe try posting on the Adafruit job board?

dusk gull
proven garnet
#

Is the CI acting up for anyone else?

#

Hopefully I'm not reposting 😬

#

Particularly on libraries, I'm having trouble in the "Install dependencies" step

slender iron
#

that's usually an actions problem

proven garnet
#

Rerunning resulted in the same issue for what it's worth

#

I guess I can file an issue there, thanks!

slender iron
#

¯_(ツ)_/¯

manic glacierBOT
proven garnet
#

Actually it looks like it links back to adafruit/actions-ci-cirvuitpython-libs

proven garnet
#

With install.sh

manic glacierBOT
#

Ya, I didn't follow that. I'm used to seeing someones example code and the backtrace for the exception they are seeing.

The simplest thing is probably to switch this check to this shared checker: https://github.com/adafruit/circuitpython/blob/main/py/argcheck.c#L173 It includes the variable name and the expected range in the error.

Would you be willing to try and make a PR to do it? You've already found the spot to change. :-)

#

Further investigation shows that the ESP IDF function get_calibration_offset() is returning a different value than it previously did. This is used to calculate the returned voltage value, and is the cause of the change in CP7.2, which now uses a newer IDF.
It looks like there was a significant change in the IDF when it comes to calculating the calibration offset.
@tannewt, do we need to change our calculations in CircuitPython to adjust for this?

slender iron
#

ok, I think we could do a 7.3 release once 6160 and 6144 are merged

idle owl
#

z00m

manic glacierBOT
slender iron
#

oh, I am seeing a crash with wifi on main now though

tulip sleet
slender iron
#

I can do it. I want to look into this wifi stuff first

#

I think the httpserver library needs to go into the bundle

tulip sleet
manic glacierBOT
slender iron
#

do you want to support it?

tulip sleet
#

eh, I could, but it could be nicer. The routing is pretty weak. The other WSGI libraries don't do file transfer out of the box, though, it's part of the routing code

#

I thought it was going to be used for the wordle stuff, but that's still in process

#

I wrote it as a bespoke thing for the word game demo

#

do you have a use for it immediately, so you want it in the bundle?

slender iron
#

I was trying to use it and noticed it wasn't in the bundle

tulip sleet
#

it was because I wasn't really satisfied with it, but it works ok

slender iron
#

I've got an idea on how we could do a wifi workflow and I was trying to start from it as an example

tulip sleet
#

main thing is that it supports EAGAIN, which some other ones didn't

#

we can release it as 0.x.0, and the API will change

slender iron
#

release is different from being in the bundle

tulip sleet
#

yeah, I just mean in the bundle as 0.x.0

#

subject to change

slender iron
#

ya, that works for me

#

I like things to always be subject to change

tulip sleet
#

ok, I will PR it to the bundle

slender iron
#

🙂

#

ty

tulip sleet
#

lol

slender iron
#

you can always bump a major version number

tulip sleet
#

ah, i missed your resolution

slender iron
#

np, I can bug you more and more as needed

slender iron
#

@onyx hinge I'm considering picking up your mdns work

onyx hinge
#

@slender iron I think that would be great! You had a clear idea about some of the naming stuff, and I'd love to see it finished.

slender iron
#

I'm wondering if we could use it so expose a rest api at circuitpython.local

#

for a wifi workflow

onyx hinge
#

I wasn't thinking about wifi workflow pe se but that would sure help

slender iron
onyx hinge
#

you can also (by going further than my patch set) actually define a service so that programs can enumerate just circuitpython-style devices

#

that I do not know

slender iron
#

I'll rework your branch so I can test it

#

won't hurt to have a mdns module anyway

#

have you tried .local on your phone?

#

I wonder if android and ios do it too

onyx hinge
#

on android, chrome and firefox can both browse to a "http://example.local" address. of course, you can never have an SSL certificate for a .local so https would bring up warning dialogs

slender iron
#

I wonder what that warning looks like if you have json do a request

manic glacierBOT
onyx hinge
#

apparently insecure websockets ws:// are basically not allowed. wss:// presumably requires a valid security certificate matching the name being used

idle owl
#

@lone axle I updated the gist, by the way. jfurcean suggested moving the time calculation into the key event instead of outside of it, and said it eliminated the flickering. I wasn't seeing it using the LED Animation library anyway. I left the "manual" pulse code in there as well in case you'd rather do that. Let me know what you think and I can PR it to your repo. Or I can PR it and you can review it that way, if that would be easier.

onyx hinge
#
  • Install the Browser extension to test unsecure (ws://) connections
  • Modern browsers do not allow connecting to an unsecure server from a secure origin.
    [from some online web socket test page]
idle owl
#

Either way, wanted to let you know it's working, you don't have anything to fix. It's now a matter of preference. 🙂

slender iron
#

seems like they should have an exception for .local

onyx hinge
#

🤷

#

neither of us make web standards (probably for the best in my case)

slender iron
#

we can do insecure websockets from insecure pages though right?

#

maybe circuitpython.local is the main page you visit

lone axle
idle owl
lone axle
slender iron
#

@lone axle I'm thinking we could have circuitpython devices editable that way

lone axle
#

if the webpage is deployed and is under https:// protocol then the browser will not allow it to connect to insecure websocket though ws:// will not work in that case.

slender iron
#

we use mdns to advertise circuitpython.local

#

each device checks for circuitpython.local before it takes that name

viscid pine
#

you could do a wildcard cert and dns trick like plex does

lone axle
#

Interesting. So user would be able to open their browser on another PC on the same network to that page and it would be a basic code editor / file manager type thing?

slender iron
#

the .local is set by the host computer though

#

@lone axle that's my idea...

lone axle
#

That would be awesome

slender iron
#

it can also run the detection for other devices and publish their hostnames

#

(this is what I'm trying to test to make sure it's possible)

onyx hinge
slender iron
viscid pine
slender iron
#

too many asterisks?

viscid pine
lone axle
#

the xs I think probably got it caught by the bot.

slender iron
#

yup

viscid pine
#

tldr: it allows the https site at app[dot]plex[dot]tv to request local addresses over https

slender iron
#

haha, that's tricky

onyx hinge
#

that's interesting but I doubt you'll get letsencrypt or other free and api-driven issuers to let us play that game

slender iron
#

I'm not sure we need to either

#

as long as we're ok not encrypting locally

#

and anyone who cares could setup their own domain and certs

onyx hinge
#

get something working, then find help from someone more sophisticated, isn't the worst way to do it.

#

though you have to go into that discussion with little attachment to your code or architecture

slender iron
#

that's how I try to operate

crimson ferry
slender iron
#

interesting...

#

@crimson ferry what's your feeling on doing a wifi workflow this way?

crimson ferry
#

hadn't thought about it, not sure I know enough to have an opinion at this point

slender iron
#

any objections to an iterator style of results for searching for services?

#

similar to ble scanning

onyx hinge
slender iron
#

ya, I'll take a look at those

#

I saw zeroconf for cpython but don't like the query method

onyx hinge
#

I'm sure you can find some other ones. nothing I found seems super well adopted. maybe I was on the wrong search terms, I don't know how mdns, dns-sd, zeroconf, avahi, and maybe some other name all interrelate

slender iron
#

I like the potential that circuitpython.local will "just work"

manic glacierBOT
#

In the past I have done a lot of custom boards using Micropython, lately I have been moving to SAME51 chips and one client is wanting to use Circuitpython.

So far the main limitation I have found is support setting external clock inputs, and allowing them to be just a clock input (bypass mode) so I can use an oscillator instead of a crystal. There are two main clock inputs so having that selectable would be good also.

Ideally this would be just another value passed in the board config...

onyx hinge
#

https://godbolt.org/z/sTPG4eoKv Apropos of nearly nothing, I was sketching out a ROM emulator for RP2040. I believe output enables can be handled from a PIO module, so this function just concerns itself with reading the address [12 of them at GPIO2..13], indexing into the ROM array, and sending the data back out the GPIO.

clang implements the bit trick I was thinking of when I chose to put address[0] on gpio2, while gcc needs two additional instructions to do the address calculation. Chalk one up for clang's optimizer. I still think it'd be neat to see if we could build one of our ports with clang someday.

My long-suffering friend whose workflow involves a DOS computer, a floppy, and a UV-eraseable EPROM needs something better... no, it won't be a circuitpython project 😁

slender iron
#

I'd like clang too but the code size has always been more than needed

#

should be easy to do on a per-port level

slender iron
#

I got pretty far today

proven garnet
#

Looking at adding type annotations to adafruit_imageload, and it says in the functions that it accepts things using the Bitmap and Palette APIs. Does that mean there should be a typing.Protocol for those types in circuitpython_typing?

lone axle
#

@idle owl I tried out your latest version. Nice job, I like the led_animation variation better than the pixel color manual fading. Looks good to me. When you have a chance PR it and I'll get it merged in.

lone axle
#

Seperate from that, I did have the thought the other day that Color would be another good typing protocol for us to have though. and it would allow tuple 0-255 values or hex i.e. (0, 255, 0) or 0x00ff00 lots of things support these interchangably.

proven garnet
lone axle
orchid basinBOT
manic glacierBOT
#

Here’s a brief summary of what I did to make the bitmap redrawing work.

  1. Call lcd_ll_start once in an initialization step.
  2. I hacked the ESP-IDF definition of esp_lcd_panel_t to include a new function to do the bitmap copy only. This function checks the x,y bounding box ranges, takes the Semaphore, copies the bitmap into the framebuffer, flushes the cache, then gives back the Semaphore.

Note, the esp_lcd_panel_t Is the generic base class structure for a panel, and each d...

manic glacierBOT
#

A macro in py/bc.h declares five variables that are used to hold data temporarily, without their values being used after the assignments. This causes "unused-but-set-variable" warnings in clang 13. We mark these variables as explicitly ignored to avoid this new warning.

Initially reported in #6158; the fix with (void) var_name; was suggested there and I was asked to open a PR with this fix.

#

@tannewt opened! I noticed that the same issue had actually been addressed with other macros already, e.g. in cfd08448a1cba0040ad3c62bce02b5f8bd76dd1d.

I hit more warnings somewhere else while building mpy-cross (negative array bounds with sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] in py/vm.c), I'll investigate and will open a separate issue once I understand exactly what's going on. I looks like clang being too strict and not recognizing a previous pointer increment.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.2 on 2022-03-15; Adafruit FunHouse with ESP32S2

Code/REPL

import board
import time
from i2cperipheral import I2CPeripheral

from adafruit_dotstar import DotStar
dots = DotStar(
    board.DOTSTAR_CLOCK, board.DOTSTAR_DATA,
    5, brightness=0.2)

def dispatch(request):
    print(request)

def service():
    t=0.25
    with I2CPeripheral(board.SCL, board.SDA, (0x42,)) as device:
        while Tru...
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron @onyx hinge We need a 7.2.3 ^^. I am going to the dentist in less than an hour. Will see if I can fix it before then.

onyx hinge
#

ooof thanks dan

tulip sleet
#
(gdb) bt
#0  mp_obj_print_exception (exc=0x20002208 <mp_state_ctx+84>, print=0x6385c <mp_plat_print>) at ../../py/obj.c:204
#1  pyexec_friendly_repl () at ../../shared/runtime/pyexec.c:667
#2  run_repl (first_run=false) at ../../main.c:784
#3  main () at ../../main.c:890

#

backtrace, just documenting in case I have to stop before done; have to do non-work things now

tulip sleet
#

I think this is because autoreload_suspend is not being checked before raising the exception in one or more new places

#

off to the dentist, back in 2-2.5 hours, prob

orchid basinBOT
orchid basinBOT
tulip sleet
#

@slender iron i think I have a a fix for autoreload issues from this morning. finishing testing

slender iron
#

@tulip sleet ok great! I just got to my desk

manic glacierBOT
slender iron
#

@tulip sleet are you sure we want to ignore triggers during all suspends?

#

I guess that matches the old behavior

tulip sleet
#

I originally put a check for autoreload_suspend in the initiate function, but it didn't work quite right

slender iron
#

initiate is used by supervisor.reload() too

#

so that needs to be thought of separately

tulip sleet
#

I think there are some races, but in general, if you're suspended, you don't want an autoreload, even a deferred one.

#

there is something broken about the PR: it didn't start a build or post here

#

I'm opening an identical PR

slender iron
#

is github broken?

#

yup

tulip sleet
#

I dunno. An issue posted. It looks like just that PR

slender iron
#

we should have held off these reload changes to 7.3

onyx hinge
#

reverting it all is an option, now that we know it's more of a can of worms than initially anticpated.

slender iron
#

I like to think that we're close

onyx hinge
#

Me too, each time

tulip sleet
#

I think the new way is better, but it's not quite what people expect. There was a significant bug in 7.2.0

slender iron
#

folks can always use old versions too

tulip sleet
#

what we had was inadequate testing

slender iron
#

@tulip sleet do you have a feather rp2040 build?

tulip sleet
#

yes, I do, you want to try it?

slender iron
#

ya, agreed

#

yes please

#

right after talk of inadequate testing 🙂

#

of course I don't use thonny anyway

tulip sleet
#

github still broken

manic glacierBOT
#

Do not raise ReloadException if in the REPL.
Also undo autoreload suspend before triggering autoreload. This is not imperative, but if autoreload_trigger() were to check the suspend state (it does not currently), it would have the wrong value. This was originally necessary when I was testing a different fix.

  • Fixes #6159
  • Fixes #6165

Please test! I tested on macOS and Linux with a Metro M4 and a Feather RP2040,
modifying a running code.py, copying a 40kB file while running, and ...

tulip sleet
#

@slender iron did you test with Thonny? I don't know how, but I could try

slender iron
#

no I didn't

manic glacierBOT
#

Do not raise ReloadException if in the REPL.
Also undo autoreload suspend before triggering autoreload. This is not imperative, but if autoreload_trigger() were to check the suspend state (it does not currently), it would have the wrong value. This was originally necessary when I was testing a different fix.

  • Fixes #6159
  • Fixes #6165

Please test! I tested on macOS and Linux with a Metro M4 and a Feather RP2040,
modifying a running code.py, copying a 40kB file while running, and ...

tulip sleet
#

tested with Thonny, and I made release notes

slender iron
#

you probably want to wait until actions is happy again

tulip sleet
#

yeah, not pushing the button yet

#

I am out to give blood around 2:35 ET

slender iron
#

shakes fist at matrix portal build

tulip sleet
#

in the PR, or locally? Maybe we should think more about what to remove

slender iron
#

in my 7.2.2 pr

#

freezing stuff is so inefficient

idle owl
tidal kiln
idle owl
tulip sleet
tidal kiln
#

@tulip sleet cool. thanks. i'll just keep an eye on it.

manic glacierBOT
#

You found the right repo. We're happy to review and merge pull requests.

Us Adafruit-funded folks don't have the time to add this either though. Others can speak up if they'd like to help. The Adafruit jobs board is another place to get the offer out there.

It'd be awesome to have you available as a contractor for CircuitPython. You aren't the first person to want to hire someone to make additions.

#

I am definitely still getting up to speed with circuitpython and developing on the build system. But I do work with others that are. I think with minimal pointers on review I can help get this developed.

I feel like github search in repo is less powerful than it used to be, as I am trying to search for references to function calls in the clocks section so I can continue to piece together how to modify this, both to test it works and to suggest implementation changes for a pull request.
...

#

CircuitPython version

Adafruit CircuitPython 7.2.2 on 2022-03-15; Adafruit CircuitPlayground Express with samd21g18

Code/REPL

import time
import gc
print(gc.mem_free())
import digitalio
import touchio
import busio
import board
import usb_midi
import neopixel

import adafruit_lis3dh
print(gc.mem_free())
from adafruit_midi import MIDI

from adafruit_midi.note_on          import NoteOn
from adafruit_midi.control_change   import ControlChange
fr...
#

I feel like github search in repo is less powerful than it used to be, as I am trying to search for references to function calls in the clocks section so I can continue to piece together how to modify this, both to test it works and to suggest implementation changes for a pull request.

https://cs.github.com is an invite-only codesearch beta that is very nice. You might want to get on the list.

@tannewt and I use ag or similar grep -r tools to search through the source tree.

#
[adafruit/circuitpython] New tag created: 7\.2\.3
orchid basinBOT
main furnace
#

Dang I just install 7.2.2. 🤷

tulip sleet
manic glacierBOT
manic glacierBOT
idle owl
#

@tidal kiln With three address pins (+1, +2, +4), and a base address of 0x20, is the max available 0x27?

#

And there's only 8 possible addresses that way?

lone sandalBOT
tidal kiln
#

probably...if it's a simple 3 bit addition onto the base

#

what sensor?

idle owl
#

MCP23017 I2C GPIO expander

#

Three address pins instead of the four I've been dealing with lately.

tidal kiln
#

yep

idle owl
#

Ok.

#

I'm doing up another table for you. 🙂

#

Wanted to make sure I had done the math right.

tidal kiln
#

you're setting these 7 bits. one is pre-set to 1. the others, A0 etc are set by the pins

idle owl
#

hmm

#

Is this right?

tidal kiln
#
>>> hex(0b0100000)
'0x20'
idle owl
#

ohhhh

#

ok

tidal kiln
#

that's A0=A1=A2=0

#

the first three bits

#
>>> hex(0b0100111)
'0x27'
#

etc

#

yah, table looks correct

idle owl
#

Thank you!

tidal kiln
#

oh, and 3 of the bits are set to 0

#

basically, the first four are always 0100 and you only change the last three

idle owl
#

Ok, that makes sense from the image you sent

manic glacierBOT
idle owl
#

@lone axle In commenting my code, I realised something we missed. There's no hours conversion in the code! I'm pretty confused by how you did the minute and second math (Python magic!), so I have no idea how to make elapsed_hours happen, and I also don't know how to add it to the _time_str. Related, does _time_str need to be private? Seemed a little odd in this code, but perhaps there is a reason I am missing.

#

The meetings do top an hour from time to time, so I think it's worth adding hours to the timestamp versus using extended minutes.

lone axle
idle owl
#

@lone axle I added separate directories for the MacroPad and NeoKey versions. I think it's worth renaming the repo to "CircuitPython_Timestamper" once this is merged. 🙂

lone axle
#

@idle owl Agree'd I will change that. RE the minute / second math:

elapsed = CUR_TIME - START_TIME  # elapsed running time in seconds
elapsed_min = elapsed // 60  # total seconds divided by 60 in order to get minutes
elapsed_sec = elapsed % 60  # "remainder" of seconds past the highest full minute

I find it easiest to think about with a specific example in mind. So lets say that the counter has been running for 730 seconds.

elapsed will be 730.
elapsed_min will be 730 / 60 which is 12.16667. But it uses the double slash division to drop the remainder decimal portion so we end up with just 12
elapsed_sec is where we will get back that remainder decimal that we ignored in the previous step. I tend to think of % modulos as the very first way that I learned division in elementary school. We would divide and get answer and remainder (rather than exact answer with decimal). Modulous operator will find just the remainder portion and ignore the answer portion.

So 730/60 = 12 with remainder 10 so the modulos value is the 10

In this example we end up with 12 elapsed_min and then 10 elapsed sec. So our 730 seconds is equal to that 12 minutes 10 seconds.

idle owl
#

Ah ok

#

So we'd have to do hour math, and then add logic that if it is less than an hour, don't include the hour in the string, or let it include 00:00:00 all the time?

lone axle
#

Yep that is correct. I think I like leaving off the hour if it's not needed even though it's more logic in the app. it matches how youtube shows the time that way

idle owl
#

Exactly! That's what I was thinking.

lone axle
#

I'll add that functionality to it. I'll go ahead and put it into both of them after it's merged.

idle owl
#

Oh, ok. That works. I super commented the code, so it'll need more commenting if new code is added.

#

I'll submit a PR now, it's ready other than the hour code.

lone axle
#

sounds good. Thank you for adding the version for feather and all of the comments!

idle owl
#

You're entirely welcome! I'm looking forward to using it.

lone axle
#

@idle owl unrelated but interested in your opinion on this. What if we had an extra marking that got rendered on this page: https://circuitpython.org/contributing for PRs that are in draft status?

idle owl
#

Hmm. That would be nice. I can see how that would be helpful too.

lone axle
#

I'm not sure how it gets generated. But I am curious to learn more about how it comes together. I'll poke around in circuitpython-org repo a bit sometime to see if I can figure out how to add that.

idle owl
#

Ok, sounds good.

#

Please keep me posted on the addition of the hour code. So I can pull it down, test it, and most importantly... use it.

lone axle
# idle owl Please keep me posted on the addition of the hour code. So I can pull it down, t...

I just pushed the change for hours to the NeoKey Featherwing one. I'm going bring the comments to the macropad one as well so it'll be a bit longer before that one is pushed.

I cheated by adding arbitrary extra time to CURRENT_TIME in order to test and it seems like it works as expected, but the true test will be in ~55 minutes when it's run long enough to roll over on it's own.

idle owl
lone axle
#

My other job has from time to time required programming things that rely on relatively long schedules before. After waiting for long timers to elapse only to realize some reason why something was broken a few times I started figuring out how to artificially raise things to get some basic sanity checks done more quickly. Occasionally something will still fail due to unforeseen real-world circumstances, but have saved so much time catching basic stuff this way.

idle owl
#

Makes a lot of sense!

tulip sleet
manic glacierBOT
manic glacierBOT
#

Whenever calling supervisor.reload() on my new, freshly updated Slider Trinkey, it just stops the code, forcing me to manually reset the device for supervisor.set_next_code_file() to take effect, which isn't the case for my other Trinkey devices running Circuitpy. I pasted the relevant code below:

`import time
import board
import analogio
import supervisor
import neopixel
import touchio
import gc

pixels = neopixel.NeoPixel(board.NEOPIXEL, 2)

analog_pin = analogio.AnalogIn(board...

slender iron
#

oops. I meant to test that....

manic glacierBOT
lone axle
#

@idle owl It successfully wrapped to an hour and seems good 01:13:21

idle owl
manic glacierBOT
#

Thanks, I make BOARD=??? clean after each build.
I restarted from scratch and managed to build the firmware with asyncio working. I had to tinker with circuitpy_mpconfig.mk which is not optimal (as opposed to a purely mpconfigboard.mk solution) but I understand you cannot easily serve all kinds of custom builds and the stock build types at the same time.

BTW make -j4 BOARD=trinket_m0 clean all doesn't work...

manic glacierBOT
idle owl
#

@lone axle 01:00:20

#

🎉 Worked!

manic glacierBOT
orchid basinBOT
manic glacierBOT
slender iron
#

anyone looking into the supervisor.reload issue?

#

(I just subscribed to github status here using a webhook)

idle owl
#

@tidal kiln I managed to explain the address jumper concept to Liz, and blew her mind. She's never understood what they do, only that they change the address. Anyway, point is, you taught me well enough to teach someone else. Thanks!

tidal kiln
#

@idle owl 0xneat!

tulip sleet
slender iron
#

ok, I can shortly

#

almost through my email

idle owl
#

@tidal kiln Still not comfortable explaining how it maps to bits, but explaining how to calculate the addresses, and what that part means is pretty clear to her now. 🙂

#

I can picture how it maps, but can't put it into words well enough to teach someone else.

manic glacierBOT
tidal kiln
#

ah. yah. with just words, tough. that diagram from datasheet should help though?

idle owl
#

Oh right. Yeah.

tidal kiln
#

it's a very simple mapping. there's not much going on.

idle owl
#

Issue is, I at least have some experience with registers and so on, so the image makes sense to me.

#

We have to get that part clear first.

tidal kiln
#

don't really even need to think about registers

idle owl
#

No, I know

tidal kiln
#

just binary notation for numbers

idle owl
#

But I'm saying picturing how bits work is easier for me because I've worked with registers.

#

Yeah I tried to explain from that stand point too

#

To say there were eyes glazing over is an understatement 😄

tidal kiln
#

fwiw - i'm constantly doing quick checks in python, things like hex(98) or print(0b100110)

tulip sleet
#

me too

idle owl
#

Yeah I mentioned how you usually show me the results in Python.

tidal kiln
#

i don't have one of those brains that can think in arbitrary base. i'm base 10 only. 😦

blissful pollen
#

Is there a learn guide that talks about binary (and even hex, and octal). It could be useful for a lot of concepts

stuck elbow
#

for a long time I didn't even know how to convert between decimal, hex and binary, I just used functions for that, it was just enough for me to know they are different representations of numbers

stuck elbow
#

no unary system :(

manic glacierBOT
#

Here is what 4.1.2 has available in the REPL:

Adafruit CircuitPython 4.1.2 on 2019-12-18; Adafruit CircuitPlayground Express with samd21g18
>>> import gc
>>> gc.mem_free()
21168

And 7.2.2:

Adafruit CircuitPython 7.2.2 on 2022-03-15; Adafruit CircuitPlayground Express with samd21g18
>>> import gc
>>> gc.mem_free()
17808

I glanced at the map file and think this is a combination of TinyUSB updates and the switch to split stack (c and pystacks).

The difference...

blissful pollen
#

I wonder if there was something that gave a practical example as to why you use them. Such as registers for binary, colors / addresses in hex. I know for me examples always help.

idle owl
#

Hmm.

stuck elbow
#

hex is mostly used because it's easy to convert to binary, and always has the same number of digits at 8 bits

#

well, ok, the latter is true of any system if you add leading zeroes

manic glacierBOT
blissful pollen
#

I always feel hex is a shorthand to binary. At least when it is 1 or 2 digits. Many more that gets tricky to picture

jaunty juniper
#

we put bytes at addresses that are multiples of 8, so hex maps naturally to that

tidal kiln
#

it's easier to see 0xFF0000 as "red" vs. 16711680

jaunty juniper
#

like html colors coded 0-255 0xRRGGBB

#

yeah that

manic glacierBOT
stuck elbow
#

@tidal kiln then 0xff doesn't scream "blue" at me

idle owl
#

I always guess my way through hex colors when trying to make colors other than red, yellow, green, cyan, blue, violet.

blissful pollen
#

For colors I try to always use leading zeros (e.g. 0x0000FF for blue) for clarity

stuck elbow
#

I used to work as a web developer a few years, so I can look at a color and type its hex rgb

stuck elbow
jaunty juniper
#

I never got to that point, though I can do yellow, cyan, magenta, and infer shades of it

idle owl
#

Same.

#

Can't translate to (r, g, b) directly, but I can kinda do something similar.

jaunty juniper
#

but if one of the components is not zero (or equal to another one), I'm lost

stuck elbow
#

the absolute difference between components gives you the saturation, the balance between them gives you hue, and the average value gives you brightness

blissful pollen
#

Then add the gamma stuff PaintYourDragon uses for LEDs and really make your head hurt 🙂 But it looks so nice

idle owl
#

Uff.

stuck elbow
#

it's easier to think about colors in terms of HSV

idle owl
#

Not for me 😄

blissful pollen
stuck elbow
#

you have to make the correction that blue doesn't add brightness

#

because of a bug in how our optic nerves are connected

#

this is why even blue light seems dark

idle owl
#

We are super buggy.

stuck elbow
#

you want bright blue, you have to add red and green to it

blissful pollen
#

I was reading why we cannot make brown in LEDs that also was messing with my head

stuck elbow
#

brown is just orange

#

but dirty

jaunty juniper
#

I want to object to the idea that blue light seems dark, after I put black tape on a billion electric devices with a piercing blue LED 😉

stuck elbow
blissful pollen
idle owl
jaunty juniper
#

yeah, brown is orange next to something that makes it look brown 😉

stuck elbow
#

I mostly tape the logotypes, because being autistic I can't help reading them each time I look at them

#

so it's very annoying when I think "DELL" each time I look at the screen

idle owl
#

I mostly tape things headed for the bedroom, because I can't sleep with any form of light in the room. It's.... more than annoying.

idle owl
stuck elbow
#

in Pattern Recognition the main character is allergic to logos and excessive design

idle owl
stuck elbow
blissful pollen
jaunty juniper
#

right ? Asus, Samsung, Belkin, Plantronics, JBL... Clue

idle owl
blissful pollen
stuck elbow
#

yeah, many bugs

idle owl
# stuck elbow ouch, sorry for that

🤷🏻‍♀️ I remember decades ago being told by my orthodontist to hold my tongue back because it was pushing my teeth out. I never mastered it, and my teeth now have huge gaps between them along the inside. Perfect for a tongue to fit into and kind of get chewed on. 🙄

stuck elbow
#

I didn't realize tongue can be so strong

manic glacierBOT
#

I agree, and that is what I started. One good thing about the external clock vs crystal is basically all the clock settings are the same except if you need to drive the crystal or not. I am hoping this could be a single flag.

One thing that is odd to me is CAN at speeds greater than ~125K wants a much higher accuracy clock, but the Feather M4 CAN only as the 32kHz crystal on it. So I am not sure if it actually fits into the expected tolerance for CAN at 250K and above.

manic glacierBOT
slender iron
#

(had to shrink a board build)

tulip sleet
#

@slender iron my xhci driver gets upset too, and it's an Intel board with its own USB hw. I think it's Linux drivers. Every few days I lose all USB and have to reboot

slender iron
#

ya, mine is an asus motherboard

jaunty juniper
#

ugh pylint and its:

adafruit_esp32spi/adafruit_esp32spi.py:389:26: E1101: Module 'struct' has no 'unpack' member (no-member)
idle owl
#

@jaunty juniper As long as everything else is happy, it's ok to explicitly disable Pylint no-member for that line. Sometimes it's the nature of CP that Pylint can't find things where it expects to.

jaunty juniper
#

I believe that's an error that only happens locally, not in the CI, I'm just baffled since it's a basic built-in module in python

#

I had a case where it would not report 10 struct errors if there was another error in the code, but not if it's the only one, so it went away on its own 🤷

idle owl
#

The CI often has more things installed than you do, so it is able to find things more easily.

#

I ran into that quite a bit, but the more libs and Blinka stuff that got installed, the less it happened.

#

I think that's part of the issue though, is that CP doesn't have struct bits where it should, so it's looking for it where Python would keep it, and it's not quite right.

manic glacierBOT
manic glacierBOT
jaunty juniper
idle owl
#

I know I have an extra one somewhere, it keeps telling me I don't need it anymore, but I'm lazy.

jaunty juniper
#

oh wait that's not the issue in the repo itself

idle owl
#

Ugh.

jaunty juniper
#

bumping the pylint version from v2.11.1 to v2.12.2 in .pre-commit-config.yaml solved it

idle owl
#

Um... This is for an actual lib? We don't want to change the config files on a single library and not others. And changing it across the board is a whole other process.

jaunty juniper
#

I wonder if pre-commit had a weird version cached independently too

idle owl
#

Also possible. I'm not sure how it reinstalls after the first run if something changes.

jaunty juniper
#

after I changed the version it showed that when I ran pre-commit:

[INFO] Initializing environment for https://github.com/pycqa/pylint.
[INFO] Installing environment for https://github.com/pycqa/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
idle owl
#

Makes sense.

#

Especially since it says it will reuse it once installed.

jaunty juniper
#

HA deleting ~/.cache/pre-commit fixed it

idle owl
#

Oooh.

jaunty juniper
#

had to snoop to find out where it was running pylint from

idle owl
#

Nicely done!

manic glacierBOT
#

I've been trying to piece together a simple example, but it just keeps not failing. Unfortunately, maybe a complex example is all that does fail, like maybe it's related to memory or something. You can still access the old Google Calendar code before I fixed it up here:
https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/d9e11884fbe45d1502447be6f74f665a4be47c2c/MagTag_Google_Calendar

slender iron
#

any opinions on what the default hostname should be for networked circuitpython devices? maybe cpy-<board name>-<mac>?

jaunty juniper
#

Nina uses arduino-**** with the first 2 bytes of the mac address

blissful pollen
#

mac is kinda long to use the whole thing? But not sure of another good method to make the names unique

jaunty juniper
#

which is weird now that I think of it, aren't the first bytes the manufacturer ?

blissful pollen
#

yup as far as i recall

jaunty juniper
#

maybe it uses the last bytes

blissful pollen
#

last 2-3 bytes may be okay, kind of a balance of ease of remembering for newbies to uniqueness

slender iron
#

ideally you won't need to remember

manic glacierBOT
slender iron
#

I think I can have a unique name and circuitpython.local

#

this one would be cpy-espressif_esp32s3_devkitc_1_n8r2-7cdfa1e076e0

viscid pine
#

Can you test this with a dac instead of PWM?

jaunty juniper
#

let me see if I have that

viscid pine
#

samd usually have dac, right?

slender iron
#

ya

viscid pine
#

turns out the example mp3 file was already low sample rate and plays fine, the thing i was experiencing was different completely :(

#

running out of ideas

manic glacierBOT
viscid pine
#

the plot thickens

gloomy shuttle
slender iron
#

I think so. I hardcoded it and it worked

#

I think shorter would be better though because on my phone you only see the start of the long hostname

#

with cpy-<mac> I can see some of the path

jaunty juniper
gloomy shuttle
viscid pine
#

thanks @jaunty juniper

jaunty juniper
#

ah

#

wait

slender iron
#

I like this.

blissful pollen
#

that looks good

jaunty juniper
#

ok it's good if I reduce the gain, it was a little too high, that wasn't the case with the PWM

slender iron
#

that's the non-manufacturer part of the mac

gloomy shuttle
#

so there could still be collisions but statistically unlikely?

slender iron
#

yup

viscid pine
slender iron
#

@tulip sleet httpserver is pretty nice! did you think about handling request headers at all?

tulip sleet
#

I didn't think about anything, hardly 🙂 I took some existing code and made it work better, but it was done in a hurry for the wordle demo

slender iron
#

kk

#

I like the respond with file 🙂

jaunty juniper
#

is there a misunderstanding on how to use the speaker ?

viscid pine
#

i dont know

#

the user describes it as static

blissful pollen
#

I vaguely recall compression level being a problem for me too. Like too much and it took too long to decode. But I could be wrong

viscid pine
#

and sample rate

#

stereo 44.1KHz fails, have to mono it or lower rate

#

but thats not the case with the file the user has

viscid pine
jaunty juniper
#

yes

manic glacierBOT
jaunty juniper
slender iron
#

now the next question is: do we have the circuitpython service run on port 80?

jaunty juniper
#

8080 ? 8888 ? 5000 ?

tulip sleet
#

8888 is easy to remember

#

88

#

circuit=7 letters, python=6 letters, 76

#

I wonder if those low ports are reserved in some RFC

slender iron
#

probably

tulip sleet
#

88 is kerberos

slender iron
#

we'd need to explain it as circuitpython.local:####/ then

tulip sleet
#

I think that's ok

slender iron
#

which would redirect to cpy-######.local:####/

tulip sleet
#

7676 is not in the list

blissful pollen
#

Anything above 1024(I think there?) is free to use

slender iron
#

I'm not actually to the point of adding it yet 🙂

tulip sleet
#

there are just some canonical ones, but it doesn't matter, tomcat, etc. is not going to run on a CPy board

slender iron
#

I think I did prove out the idea will work though

#

I can advertise as both circuitpython and cpy-###### at the same time

tulip sleet
#

can you advertise as something.circuitpython.local, that could be on 80, and would not necessarily conflict with a user server on circuitpython.local:80. Does mdns allow that

#

board.circuitpython.local

slender iron
#

not really

#

the thing I found said it works sometimes

#

it treats "board.circuitpython" as the hostname

#

and some implementations don't like the .

tulip sleet
#

hmm, too bad

slender iron
#

any domain differentiation would need to be done by the http server I think

manic glacierBOT
manic glacierBOT
#

Let's add a way to work with CircuitPython over the (local) web!

How it should work

  1. First, load http://circuitpython.local:7676 in a web browser. This uses mDNS to do a local domain lookup.
  2. All CircuitPython devices on the network will reply with their IP. The first will win.
  3. The browser will then request / from that IP.
  4. The running webserver will see the circuitpython.local host and will return with a 302 redirect to the device's specific domain which will be `cpy-...
manic glacierBOT
#

Given that these devices can (in some cases must) have their SSID/KEY set and perhaps an IP, I think it would be good to add a way to set the hostname. In the secrets.py file, an optional parameter named mDNS name or hostname or the like would be super helpful.

If that isn't found, then the circuitpython.local would be the default. But this allows a longer-term solution when there are > 1 CP device on the network.

Also, why are we using port 7676? That makes the assumption that W...

#

Given that these devices can (in some cases must) have their SSID/KEY set and perhaps an IP, I think it would be good to add a way to set the hostname. In the secrets.py file, an optional parameter named mDNS name or hostname or the like would be super helpful.

This is possible with wifi.radio.hostname already. The mDNS hostname currently defaults to cpy-###### but we should probably have them align.

#6175 allows for changing the unique name through `mdns.Server(wifi.radio).hostna...

manic glacierBOT
#

wifi.radio.hostname does make it to the router via DHCP.

The ability to "pin" or reserve DHCP MAC-to-IPv4 addresses is a convenience offered by the router, I'm not aware of any standards that cover it.

As I read this, hostname and mDNS hostname may get aligned, but since wifi and mdns would be separate imports, it should hopefully support use cases where a wifi.radio.hostname is desired but not an mDNS hostname.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Stop resetting WiFi completely between VM reloads. We want to keep the serial connection alive.

This is desirable for web workflow. However, users are currently in full control of starting and stopping a Station and connecting to an AP, starting and stopping an AP, starting and stopping wifi, etc. There should be a mechanism where user code still retains full control of whether / when / how the device interacts with a wifi network, during code execution and across reloads and resets. In ...

manic glacierBOT
solar whale
#

When did alarm.pin get merged into alarm. It used to be imported separately. import alarm import alarm.pin now it is part of alarm.

manic glacierBOT
#

Instead of true use GC_ALLOC_FLAG_HAS_FINALISER. Not using a finali(s/z)er here would be an easy mistake to make in a fresh implementation of Server; is there a way to move the allocation step to a place where it would be shared by all ports?

For that matter, why is RemoteService in the common-hal? If it's just a container for some data found during a search, then why not make it a kind of NamedTuple or similar, allowing it to live in shared-module.

lone axle
#

@low sentinel I am interested in diving into vectorio a bit to see if I can make some tweaks. Peeking into the code I came up with a few questions that I think you may be able to point me in the right direction on. 1) The DEBUG function here https://github.com/adafruit/circuitpython/blob/8319faa032639012a5618670a5e0797012ccf4b5/shared-module/vectorio/VectorShape.c#L27-L28 in order to "enable" this would I just need to un-comment the bottom line and comment the top line? Then all of the debugging messages will print to serial? 2) The specific I am interested in first is adding an optional argument to constructor to allow user to specify a different color index within the palette for the shape to get filled with (by default it will use color index 0) I found the code that I think is responsible for setting that index here: https://github.com/adafruit/circuitpython/blob/8319faa032639012a5618670a5e0797012ccf4b5/shared-module/vectorio/VectorShape.c#L371 I'm curious if that is actually the right spot though.

We had someone ask about this functionality the other day and It seemed like a nice challenge for me to attempt in order to get some more practice working on things in the core. I happy to tinker with it a bit to get it done but am trying to make sure I'm not way off base with my initial understanding of things.

low sentinel
#

Hey @lone axle

  1. correct.
  2. you’re close, but line 395 is the place in VectorShape. Notice though that VectorShape does support multi-color shapes. If you bake the index into VectorShape you will wall off multi-color shapes, which is not a great thing to do.
    Instead I’d recommend either (a) adding the palette parameter to each IShape implementation or (b) writing a Decorator IShape that marshals a 1 from a decorated IShape to a configured palette number instead. Either way seems fine. (a) is more memory and performance efficient (1 fewer dynamic method call per pixel, 1 fewer heap structure).
crimson ferry
#

ESP32SPI UDP Sockets

manic glacierBOT
#

If you're making wifi persistent, how about a telnet server for the repl too?

Yup! I mention something similar in #6 but forgot to add it to the TODO list.

This is desirable for web workflow. However, users are currently in full control of starting and stopping a Station and connecting to an AP, starting and stopping an AP, starting and stopping wifi, etc.

Agreed! I'd probably add a supervisor.disable_web_workflow() just like supervisor.disable_ble_workflow(). That'd move it ...

#

I agree, and that is what I started. One good thing about the external clock vs crystal is basically all the clock settings are the same except if you need to drive the crystal or not. I am hoping this could be a single flag.

Great! Simple is good.

One thing that is odd to me is CAN at speeds greater than ~125K wants a much higher accuracy clock, but the Feather M4 CAN only as the 32kHz crystal on it. So I am not sure if it actually fits into the expected tolerance for CAN at 250K a...

lone axle
manic glacierBOT
low sentinel
# lone axle Thank you! I appreciate the guidance. Do I understand correctly that the `-= 1` ...

Not quite - there's comments in there about how vectorio IShape uses the special value 0 to communicate "not covered by this shape." VectorShape bridges between that semantic and the palette semantic by subtracting by 1.
IShape color selection is internally 1-based indices while Palettes are 0-based so VectorShape is just translating IShape's index domain to Palette index domain.

#

in an ideal world this thing would return a struct, but it is called once for every pixel so every abstraction and data type indirection you add reduces pixel fill rate. Vectorio tries to be as close to the same speed as bitmaps as it can be and a magic 0 was measurably faster (on my feather m4 express, I don't remember by how much) than other options like a pixel struct.

manic glacierBOT
manic glacierBOT
prime flower
crimson ferry
#

I took me 5 years to get a collision on the last two bytes (across esp8266, esp32, esp32-s2, and esp32-s3 devices), so even with Espressif having multiple OUIs, the odds of collision on the last 3 are exceedingly low 😉

manic glacierBOT
lucid solar
#

@slender iron I want to port the ST7565 driver over to displayIO, who knows that API the best, do you think?

slender iron
#

I'd just start with the most similar driver

lucid solar
#

I've tried that...but have got stuck

#

The other ST**** driver is totally different, and the other GLCD driver isn't compatible in the slighest

slender iron
#

I can try to help you through it

#

welp, I thought I fixed my doc build and checked locally but actions disagrees with me and 🦄 on load build output...

lucid solar
#

@slender iron I'll look at it again tomorrow. And let you know...thanks!

viscid pine
#

@slender iron your board init has these lines, they probably kill usb: // This board has LEDs connected to the USB pins USB_SERIAL_JTAG.conf0.usb_pad_enable = 0; USB_SERIAL_JTAG.conf0.dp_pullup = 0;

slender iron
#

Oh! Did I copy that over?

viscid pine
#

yep

slender iron
#

trying it now

viscid pine
#

also maybe you have to make sure they arent getting reset?

slender iron
#

ya, I did try that

#

that was it!

#

not perfect but enumerates

#

thanks!

viscid pine
#

this is what im working on, you might find it handy

slender iron
#

I'll wrap it up next week. thanks again

misty garnet
#

would asyncio fit on a custom, stripped-down SAMD21 build, or are there other issues as well?

tulip sleet
stuck elbow
#

you can decrease the filesystem size to 48kB, then you can fit some more stuff in it

crimson ferry
#

Should there be separate board definitions when pin polarity changes on a board rev? It will get confusing with the * and *_INVERTED <#help-with-circuitpython message> it would be nice to continue to be able to write generalized cross-device code using hasattr or similar to know how to interact with a pin or feature

manic glacierBOT
#

Implementing color_index argument and property for all of the vectorio shapes. This allows user to specify which color index to fill the shape from the given palette. Previous behavior was always defaulting to the 0 index within the palette.

There is a script illustrating it's usage in this PR inside of tests/vecotrio/color_index.py

manic glacierBOT
manic glacierBOT
manic glacierBOT
minor plume
#

Has something changed with GitHub or our build procedure, or is something confused on my local system? I made a fresh fork of adafruit/circuitpython and cloned it, but when I try to “make fetch-submodules”, I get a whole bunch of errors like “fatal: reference is not a tree: a8abc3aa8dece6c4d0152b001dfca7d2c279f899”, followed by a bunch of “fatal: Unable to checkout” errors (starting with “fatal: Unable to checkout '5d01882c41dbc4115bc94f0b61c093d5a6b812b6' in submodule path 'extmod/ulab'), and then the make exits with an error code 128.

solar whale
#

Are you running the make fetch-submodules in the top directory of the repository?

manic glacierBOT
minor plume
#

@solar whale Yup.

#

It could be something messed up on my machine but I figured I’d ask before I spend a lot of time chasing ghosts.

manic glacierBOT
manic glacierBOT
#

@gamblor21 good question on the outside range. There isn't automatic wrapping for values outside the range, however they also don't result in an exception. Current behavior is values outside of the valid range result in the shape being drawn black which is maybe unexpected behavior.

I'll add some more explicit checks that raise an exception for invalid values.

Thanks for having a look over this!

manic glacierBOT
manic glacierBOT
#

I evaluated the recent commits to assist with rgb LCDs and they resolve the issue that I observed above. I'm getting decent speed, here's an example of a 10x10 pixel bouncing box:

https://user-images.githubusercontent.com/33587466/159185726-9074ed31-64d8-4fc6-ad23-4fe3b42abbf6.MOV

I performed an alternate test with 400x400 squares (about half the display size) and am getting around 25 frames per second.

Here's my example code. Adjust box_size to see the impact of redraw size on t...

slender iron
#

@minor plume does it have to do with st_driver?

minor plume
# slender iron <@!353373147199832074> does it have to do with st_driver?

The first of the string of errors was in extmod/ulab but there were a bunch of them. I haven’t spent any time troubleshooting but can tomorrow if need be. Here’s the log from my second attempt at “make fetch-submodules” (so, skipping the part that seems to have cloned successfully):
https://gist.github.com/tammymakesthings/2d30d9951e172b8a579497a01f19dcb5

Gist

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

slender iron
#

looks like the data/nvm.toml directory is broken

#

the "unable to checkout" errors are expected

#

the git submodule foreach after should handle it

minor plume
#

Ah. That makes sense.

#

Last time I did this I did the “make fetch-submodules” and then walked away for a while. So I wasn’t sure which errors are expected and which aren’t.

slender iron
#

maybe do git submodule update --init data/nvm.toml

#

you want to avoid blanket doing that though because the broadcom folder has a giant repo in it

minor plume
#

Let me try that and see what happens. One moment…

#

Huh. That produced no output, but I did a fresh clone of my repo fork and it seems to be working now. So I’m not sure what’s going on…but I think I won’t worry about it unless it happens again.

#

Oh! Maybe I do know the problem. I typically rename my remotes (origin => tammymakesthings, upstream => adafruit). The last time I cloned, I renamed them before I did the make fetch-submodules, and this time I did the make fetch-submodules first. So maybe whatever the fetch-submodules Makefile target is doing is getting confused if the remotes are renamed.

#

Nope, that can’t be it. It still errored on data/nvm.toml.

#

Hmm.

#

Let me check something in my git config.

#

OK. Figured it out, I think. I had clone.defaultRemoteName set in my .gitconfig, and that was messing up the make fetch-submodules target. It’s fetching now, and we’ll see if my hypothesis is correct, but I bet that will fix it.

#

Yup. Seems to have fixed it. So now I know: make fetch-submodules will fail if you have clone.defaultRemoteName set in your .gitconfig. I wonder if that’s a common enough condition to be worth documenting someplace that it’ll break the Makefile target. 🤷‍♀️

#

(Or, in the alternative, if it’s worth adjusting the way make fetch-submodules works so it asks Git for the configured default remote name if one is set. Also an option, but I don’t know how common people using that setting is.)

manic glacierBOT
onyx hinge
#

I'm really having trouble / feels while using the recently updated "changes" view in github. I am sure part of it is just the "hates change" note on my character sheet, but in particular I can't seem to figure out how to view the whole change at the spot of a resolved comment where the line that the comment was made on was deleted in a latter commit. Also, because there are scrollbars within scrollbars (WHY!) mouse scrolling just doesn't quite work consistently. That seems to be triggered by opening or closing a resolved comment(?)

manic glacierBOT
idle owl
#

@onyx hinge So... CI failed on my MicroPython PR. Damien provided a suggestion to fix it, but I a. have no idea which version of the IDF I'm supposed to be referencing, and b. have no idea where to put that line. I figured I'd ask you first, and then ping Limor if you're unsure. https://github.com/micropython/micropython/pull/8406

manic glacierBOT
manic glacierBOT
slender iron
tulip sleet
#

@idle owl i was using black 22.1.0 locally, but pre-commit specifies 20.8b1. They are fighting with each other. I can update .pre-commit-config.yaml to be 22.1.0. Is there a reason not to do that? tnx

onyx hinge
#

@idle owl I just got back to my desk, can try to sleuth the answer now if it's still pertinent

idle owl
tulip sleet
#

this came up before, but I can't remember what the resolution was

idle owl
idle owl
onyx hinge
#

@idle owl it's a matter of having to go check things inside idf git, i can do it and limor is not likely to "just know" without doing the same.

tulip sleet
#

Adafruit_CircuitPython_Requests. I am looking in cookiecutter, and the black version is not specified at all

tulip sleet
#

🤦‍♂️ I was looking in cookiecutter's own .pre-commit-config-yaml

idle owl
#

😄 I figured

#

Ok, so, I think Eva can run a patch this week, or walk me through it since I'm trying to learn how.

#

Go ahead and update Requests for now, and the patch will simply skip it.

onyx hinge
#

@idle owl ```esp-idf$ git tag # What are some release tags?
...
v4.0.4
v4.1
...
esp-idf$ git grep GPIO_NUM_20 v4.0.4 || echo 'no results' # not in 4.0.4
no results
esp-idf$ git grep GPIO_NUM_20 v4.1 || echo 'no results' # is in 4.1.0
v4.1:components/soc/include/hal/gpio_types.h: GPIO_NUM_20 = 20, /*!< GPIO20, input and output */

idle owl
#

Ok!

tidal kiln
crimson ferry
#

@tulip sleet looks like when I reviewed requests, it bumped the other reviewers off, didn't mean to do that... is there a way to control that?

idle owl
crimson ferry
#

@tulip sleet adafruit_requests #102

tulip sleet
#

I am fixing some issues; I did a rebase and it got all messed up

#

I will re-request

crimson ferry
#

ok, I'll just comment so the other reviewers list stays intact

tulip sleet
#

what you reviewed is not correct

tidal kiln
#

@idle owl thanks. any ideas why?

idle owl
idle owl
lone axle
lone axle
#

I'll see what I can find.

idle owl
#

Thanks!

tidal kiln
idle owl
#

@tidal kiln Some of them failed for Reasons, and need to be manually rebuilt. Not sure if that's one of them.

#

That did not resolve Portalbase.

lone axle
#

I think the ones with the failing badge are a different issue. As best as I can tell RTD was just having downtime or some other problems coincidentally when we did a sweep that caused the docs to get re-built, their system didn't complete the builds successfully. But has since been repaired and can build them but there is no easy way to trigger a mass re-build.

idle owl
#

Right. Each one must be run manually.

lone axle
#

With this branch from the PR my local build does seem to include all of the API docs though. I'll keep an eye on CI to see if it builds successfully there.

idle owl
#

We can fumble with PortalBase if needed.

onyx hinge
#

@idle owl so long story short I think that for "#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, x, 0)" , x is 1.

idle owl
#

I didn't see anything like it in the file....

onyx hinge
#
+    {{&machine_pin_type}, GPIO_NUM_20},
+#else
     {{NULL}, -1},
+#endif   
``` I think the change ends up looking more like this
idle owl
#

Oh......

#

That makes sense.

lone axle
#

Interesting. PR is merged and RTD does show a new build: https://readthedocs.org/projects/adafruit-circuitpython-portalbase/builds/ but still missing the content. I will poke around some more after the meeting. There are definitely a few differences in my environment vs. the RTD / action container. None that I would have expected to cause this issue. But I'll try to get a local venv matching the container to see if I can get the same results.

onyx hinge
#

<@&356864093652516868> I failed to send out an earlier reminder, so here's your 5-10 minute reminder: the weekly meeting starts soon. Please update your notes in the document and join us in the voice channel when we wrap up our internal meeting! https://docs.google.com/document/d/1oq50yQiocKcPcGAHEyFuRJqNOz5ipXDD62D0aPNctq8/edit

slender iron
#

brb

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

33675

Roles

35

solar whale
#

what's a "work day"?

errant grail
#

Just listening today.

idle owl
#

Nope!

#

Not this time.

slender iron
#

turbid radish
#

😁

#

Yes please contribute

#

Yes, big or small

hidden oxide
#

Hello

mental nexus
turbid radish
#

Congrats!

solar whale
#

@slender iron Remember to make the FS witeable on the QTPy C3

slender iron
#

shouldn't it by default because it has no USB?

solar whale
#

I don't know -- I recall that for the ESP32C# devkit - it had to be changed. -- ah but I think you made that for all with out USB

slender iron
#

ya, I think I made it depend on CIRCUITPY_USB

crimson ferry
#

there are also some duplicated PIDs

manic glacierBOT
idle owl
#

21st 🙂

slender iron
#

@tulip sleet when do you want to go over things?

lone axle
#

@idle owl and @tidal kiln I am thoroughly perplexed now. But on the up side the page does now seem to contain the proper content. I noticed that adding index.html to the URL did pull up a page with the proper content on it: https://docs.circuitpython.org/projects/portalbase/en/latest/index.html so it seems like for some reason the https://docs.circuitpython.org/projects/portalbase/en/latest/ was not pointing specifically to that index page. Looking through the build logs one of the things that jumped out to me was a missing sections about examples since portalbase does not have any examples in the repo. I made this PR: https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/pull/67 to add one to see if that resolves our problem..... But now all of the sudden the RTD page does have the proper content in it. So I'm not sure if my push to this PR branch somehow caused a difference on the real page, or if it changed coincidentally. But either way it seems like it does have the right things on it now.

ember iris
#

Thanks all!

blissful pollen
#

Ha I was able to join just as I heard "have a good week everybody"

crimson ferry
#

@idle owl what's the CP code mechanism to distinguish between ESP32-S2 Revs B and C for the power control pin? I was thinking we'd need two board defs

idle owl
mental nexus
#

Thanks everyone!

candid sun
#

thanks folks!

proven garnet
#

Thank you!

gilded cradle
#

Thanks

idle owl
solar whale
#

Our first was 3 weeks late 😮

tidal kiln
solar whale
#

2nd was early

idle owl
lone axle
idle owl
#

@slender iron Good luck, hopefully I don't see you next week 🙂

lone axle
#

My guess is either 1) it coincidentally re-built itself as I was working on attempt #2 and succeeded, or 2) somehow me pushing and making the new PR caused the live page one to also re-build in a successful way. I'm unsure whether we need the newer PR or not. But maybe the lack of examples dir was causing our trouble, that was my theory at least.

idle owl
ember iris
#

Is there a guide that suggests/outlines how to make packages that are suppose to sit on the pc, and process data from a circuit python device? Like the PM2.5 particle sensor has a lot of noise on the signal, and a desktop pc setup can easily filter it and report a cleaned up signal. It wouldn't be a circuit python library, but a helper library/script

idle owl
ember iris
idle owl
#

Probably without all the extras and so on that cookiecutter adds, but following some of the basic concepts, is what I'm saying.

ember iris
#

Awesome! That'll give me a direction to go, thank you!

idle owl
#

You're welcome!

#

@onyx hinge Did you end up stepping away or are you still around?

onyx hinge
#

@idle owl still here for the moment

idle owl
#

Fuzzy on what the indentations should be, there are other if's in there at that indent.

onyx hinge
#

I think so! they have a CI check for the code's indentation, and that may be the correct style

idle owl
#

Ok good.

#

That was my next step was to remember how to run all of that again.

#

Reading the code conventions page first this time.

#

Can I do git commit -ms "Commit message" for it to also sign off?

onyx hinge
#

-s -m "Commit message" maybe?

idle owl
#

ok

#

I'll try that.

onyx hinge
#

. tools/ci.sh and then one time ci_code_formatting_setup and then each time you want to check, ci_code_formatting_run. that's for indenting the code. ci_commit_formatting_run was for checking commit messages.

idle owl
#

Ooh ok.

#

Thank you!

#

@onyx hinge ci_code_formatting_setup is asking for a password, is that expected?

onyx hinge
#

yes but it won't work on a mac now that I look at it

idle owl
#

oh.

#

ok

onyx hinge
#

sudo apt-add-repository --yes --update ppa:pybricks/ppa
sudo apt-get install uncrustify
It has to install the program "uncrustify". Do you have it installed for circuitpython core? it's the same.

idle owl
#

Yeah, it's in a venv for building circuitpython.