#circuitpython-dev

1 messages Β· Page 316 of 1

solar whale
#

  Product ID:    0x2812
  Vendor ID:    0x2109  (VIA Labs, Inc.)
  Version:    b.e0
  Speed:    Up to 480 Mb/s
  Manufacturer:    VIA Labs, Inc.         
  Location ID:    0x14240000 / 12
  Current Available (mA):    500
  Current Required (mA):    0
  Extra Operating Current (mA):    0

Saola 1 w/WROVER:

  Product ID:    0x80a6
  Vendor ID:    0x239a
  Version:    1.00
  Serial Number:    0000000000000000160000000CFCDF
  Speed:    Up to 12 Mb/s
  Manufacturer:    Espressif
  Location ID:    0x14244000 / 24
  Current Available (mA):    500
  Current Required (mA):    100
  Extra Operating Current (mA):    0
  Media:
Saola 1 w/WROVER:
  Capacity:    2.1 MB (2,097,664 bytes)
  Removable Media:    Yes
  BSD Name:    disk9
  Logical Unit:    0
  Partition Map Type:    MBR (Master Boot Record)
  S.M.A.R.T. status:    Verified
  USB Interface:    2
  Volumes:
CIRCUITPY:
  Capacity:    2.1 MB (2,097,152 bytes)
  Free:    2 MB (1,954,816 bytes)
  Writable:    Yes
  File System:    MS-DOS FAT12
  BSD Name:    disk9s1
  Mount Point:    /Volumes/CIRCUITPY
  Content:    DOS_FAT_12
  Volume UUID:    2015F2C7-4C99-3402-9C9C-147B7AEDFE6F
#

that is with a build from a few days ago

onyx hinge
#

maybe the code to get the serial number is simply not functioning as expected, like @main meteor says

solar whale
#

I don't want to try it on my Linux box because it usually kills it...

onyx hinge
#

oh ... ```void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
}

solar whale
#
bytearray(b't\t\n@\x02\x00\x00\x00\x01\x00\x00\x00e\x00\x00')
>>> ```
#
['0xc5', '0x4e', '0x8', '0x80', '0x1', '0xcd', '0xfd', '0x3f', '0x0', '0x0', '0x0', '0x0', '0xd0', '0x60', '0xfc']
>>> 
#

hmmm iit is not constant ```>>> [hex(x) for x in microcontroller.cpu.uid]
['0x74', '0x9', '0xa', '0x40', '0x1', '0x0', '0x0', '0x0', '0x1', '0x0', '0x0', '0x0', '0x63', '0x0', '0x0']

[hex(x) for x in microcontroller.cpu.uid]
['0x74', '0x9', '0xa', '0x40', '0x1', '0x0', '0x0', '0x0', '0x1', '0x0', '0x0', '0x0', '0x30', '0x0', '0x0']

onyx hinge
#

yup

#

it is using uninitialized memory, looksl ike

solar whale
#

ruh roh...

stuck elbow
#

''.join('%x' % x for x in microcontroller.cpu.uid) btw.

#

hey, found even shorter way: ('{:x}' * 15).format(*microcontroller.cpu.uid)

crimson ferry
#

I like the first one, different CPUs have different lengths

solar whale
#

just to check -- just rebuilt from main ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-83-ga6c20208b on 2020-07-15; Saola 1 w/Wrover with ESP32S2

import microcontroller
''.join('%x' % x for x in microcontroller.cpu.uid)
'92f000000e4300400'
''.join('%x' % x for x in microcontroller.cpu.uid)
'91f000000e4300400'
''.join('%x' % x for x in microcontroller.cpu.uid)
'90f000000e3300400'

silver tapir
#

@lone axle It looks like the commit is now in the pr, and it's trying to do the checks but I guess the system is still recovering and has stuff on queue.

#

@stuck elbow Where did you get the pcbs for fluff m0?

stuck elbow
#

@silver tapir elecrow

silver tapir
#

I'm thinking of making a video series in spanish about how to load cpy on one, and the fluff m0 seems like the correct board for that.

stuck elbow
#

I can send you one

#

I mean assembled

silver tapir
#

Oh that would be very nice, thank you.

stuck elbow
#

do you want it flashed, with just bootloader, or empty?

#

I guess you can always erase the chip

silver tapir
#

Yes, whatever is simpler for you.

idle owl
#

@slender iron You updated the bundles, but not circuitpython.org. I'll submit a PR today.

tulip sleet
#

@solar whale @onyx hinge The serial number code is different for different chips. Maybe it is just wrong for ESP32S2 (wrong address or length).

uncut nexus
#

@tulip sleet - do you have a couple of minutes to chat?

manic glacierBOT
slender iron
#

@idle owl thanks! I looked on the downloads page but didn’t look elsewhere.

tulip sleet
#

@uncut nexus

#

sure

idle owl
silver tapir
#

Oh yeah, py bundle. That is useful.

slender iron
#

Oops! Now I know

lone sandalBOT
manic glacierBOT
#

Before this, the uid was referring to uninitialized memory and varied from run to run.

On my hardware, esptool reports

MAC: 7c:df:a1:02:6c:b8

after this change, the USB descriptor says SerialNumber: 7CDFA1026CB8 and microcontroller.cpu.id has

>>> "".join("%02x" % byte for byte in microcontroller.cpu.uid)
'c7fd1a20c68b'

Note that the nibble-swapping between USB and cpu.uid is typical. For instance, an stm32 board has USB SerialNumber
`24002500F005D42445632302...

onyx hinge
#

@slender iron thanks for your work on esp32s2 so far -- the issues I've been filing don't mean that most of it isn't AWESOME and ready to build on

slender iron
#

@onyx hinge just means you are ready to help on it πŸ˜‰

manic glacierBOT
ionic elk
#

@slender iron I thought I had a USB breakout but I don't 😦 I've got one coming in express but I won't be able to get drive access until Friday. I can read up on the timer API and even start coding but I won't have a PulseIO PR until next week.

manic glacierBOT
onyx hinge
#

@ionic elk You might be able to sacrifice a whole cable to get access to the individual wires, splicing them to some nice jumper wires

ionic elk
#

True! I'll dig around and see if I have a junk cable I could use for that.

onyx hinge
#

80+% the wiring color inside will be accurate. Verifying GND and VCC is easy, then you can try both orientations of D- and D+ without damaging anything

#

but yeah it assumes you have a cable you don't mind ruining for science πŸ§™

ionic elk
#

I've got tons of junk cables that come with chargers and things, but I don't know if they contain the data lines (which is the reason they're junk)

onyx hinge
#

yeah that probably won't work, I'd start with one that is known good for data

ionic elk
#

They ought to have a mandatory marking for power only cables

#

so much irritation in my early debugging days

onyx hinge
#

thorns

#

transparent outer insulation so you can see there are only 2 wires in there

ionic elk
#

A tiny dunce cap attached with a zip tie

onyx hinge
#

lunchtime! πŸ‘‹

ionic elk
#

πŸ‘‹

manic glacierBOT
ionic elk
lone axle
#

@silver tapir looks like the actions system never did notice the commit even though it's now showing on the PR page. If you end up having a moment it might be worth trying one more push of something innocuous to see if a new commit/push will get it to retry the actions run.

silver tapir
#

@lone axle For some minutes it, for me, it is showing the new commit, and it did ran the new checks as it now does not have the failure, so your suggestion was correct.

lone axle
#

Hmm, maybe the front end is still being weird on my end. I see the commit now, but it seems like it didn't run the actions check. I am seeing 0 checks and still a grey circle instead of red or green for the status symbol thing:

idle owl
#

@lone axle @silver tapir Actions is having issues right now

onyx hinge
#

@ionic elk done

lone axle
#

Oh, thank you. That is encouraging. Earlier it seemed they were having issues but the status page was still green.

idle owl
ionic elk
#

@onyx hinge does only PaintYourDragon have merge permissions?

#

Thanks for taking a look

onyx hinge
#

yup; or at any rate, I don't.

idle owl
#

@onyx hinge @ionic elk I do... Is it good to go?

onyx hinge
#

I didn't run the code but I read it and it looks fine. so assuming @ionic elk has run it πŸ™‚

idle owl
#

Or does it make sense to leave it for Dragon?

ionic elk
#

I mean it'll only run once the timer code is in, and that hasn't been approved yet.

onyx hinge
#

I don't know them well enough to anticipate if it will feel like stepping on toes or stepping up

ionic elk
#

I'm not sure what your preference is for this kind of thing

idle owl
#

@ionic elk Hmm. Does the timer code rely on anything?

ionic elk
#

It'd be nice for my testing if it was on some kind of branch so that I can check it out in my timer code, so the timer code can pass CI

idle owl
#

Typically we wait to merge things dependent on other things until the other thing is in.

onyx hinge
#

this is the part that needs to go first

ionic elk
#

The timer code relies on this protomatter code to compile, because otherwise it has conflicts in the IRQ definitions

idle owl
#

Ah!

ionic elk
#

but at the same time, this protomatter code won't work until the timer code is reviewed and merged

onyx hinge
#

it's the submodule, and it needs this change before circuitpython can be improved

idle owl
#

Then if you're both happy with it, I'll merge it.

onyx hinge
#

thank you

ionic elk
#

Ideally I would think that the best thing would be to put this change on a branch of protomatter that I can check out

#

is that possible?

idle owl
#

Jeff would know, I have no idea.

onyx hinge
#

you mean for yourself locally or for the github CI?

ionic elk
#

I mean we actually make a branch in the protomatter repo and have this change on that branch

#

so this change doesn't impact the main performance of protomatter? But it's not my workflow, if that's too weird than don't do it

#

Am I making any sense at all?

onyx hinge
ionic elk
#

I just don't want to break protomatter if the timer code runs into some other issue and needs further fixes

onyx hinge
#

(is that the right pr?)

ionic elk
#

Yeah that's the right PR. I don't have any changes to protomatter in that, because what would I even be checking out?

#

my changes aren't in yet

ionic elk
#

So it's failing CI on most STM32 chips because there's a build conflict with the IRQ callback definitions

#

Sorry if I'm missing something and just being an idiot that happens sometimes πŸ˜†

onyx hinge
#

In my experience, if my PR in CircuitPython makes a submodule point to a ref that has been added to a PR in that github repo, the CI is able to chew on it and give useful results

ionic elk
#

Oh so I can make a submodule point to a PR?

#

I did not know that

onyx hinge
#

You will always have my sympathy when it is submodules or merge conflicts that confound you

ionic elk
#

ok awesome I'll just do that then

idle owl
#

Submodules are jerks at times.

ionic elk
#

And we shouldn't submit it until both of them are ready

onyx hinge
#

you just commit the submodule ref the same way you would if it was merged somewhere else already

ionic elk
#

nice, ok, learned a new thing today. That's handy

onyx hinge
#

now, this thing I said about github CI being fine with it and doing the right thing .. I'm surprised at it each time, but it really does seem to work. Now watch me be a liar.

manic glacierBOT
solar whale
#

@idle owl tell us how you really feel...;-)

onyx hinge
#

@idle owl that's a pretty @vapid mango thing to say

idle owl
#

@solar whale I WILL.

#

@onyx hinge It really is.

onyx hinge
#

I'm gonna step away for a bit thanks @idle owl @ionic elk and if it doesn't work out do @ me

idle owl
#

Thanks @onyx hinge. Have a good one.

#

Jeff's git fu is strong. He's the reason I'm able to check out other people's PRs and push back to them.

manic glacierBOT
idle owl
#

@slender iron Am I seeing correctly there's no way to use board.I2C() if you want to set frequency? I tried a couple of things and it's all failing.

slender iron
#

yup, looks like its at construction time only

idle owl
#

Ok thanks.

slender iron
#

reason is that all devices on the bus need to agree

idle owl
#

Wasn't sure if I was missing something.

slender iron
#

so it's not good to change it

#

πŸ‘

idle owl
#

Fair enough.

tulip sleet
idle owl
#

@tulip sleet Hah! Fair enough.

tulip sleet
#

I feel like my life is sometimes "There's an issue for that!"

idle owl
#

I'd be annoyed about that memory sector being dedicated to issues that could be being used for something else. πŸ˜„

onyx hinge
#

"you've got issues" turned out to be a bad slogan for bug tracking software

manic glacierBOT
idle owl
gilded cradle
#

Yes @idle owl, I do have one. I might have the cycles tomorrow for that.

idle owl
#

@gilded cradle That would be perfect. Thanks!

thorny jay
#

@idle owl When you said in the weekly meeting "PM2.5 Air Quality sensor" do you mean the old UART PMS5003 or the new I2C PMSA003I ?

idle owl
#

@thorny jay I'm currently working with the PMSA300I, but will be updating the guide for the UART PM2.5 sensor as well, they use the same library. I have both. That is, if the PMS5003 is the UART PM2.5 sensor we sell.

thorny jay
idle owl
#

Yes, that's up next for updates. And what I plan to use to test your code.

thorny jay
#

That is what I have and I am running in some issues.

#

My code?

idle owl
#

I am perhaps wrong. I thought you submitted a PR to update the example code?

thorny jay
#

Maybe... I have been working a lot on it.

#

Not sure anymore.

idle owl
#

Yes, it was you πŸ™‚ - I checked. Anyway, I'll be testing it in the next couple of days and merging it once done.

thorny jay
#

I shared my "analysis" of the piece of code around that UART sensor. The code in Python and the code in CircuitPython.

#

I think I need to put some "recovery" logic on the serial part. Either my hardware/cable is faulty (and that can be usefull to make the library more reliable) or this is a general problem. But with a single board, it is hard to tell.

idle owl
#

What faults are you experiencing? I ran into an issue with the PMSA300I doing I2C scan. Example code works fine, but it was iffy with the scan.

#

Which I just realised has nothing to do with the lib, so it's not the same thing.

thorny jay
#

Within one or two minutes, I get a "bad packet" either because the signature is not what is expected, or the checksum is wrong.

#

Depending on the library or demo code, I can survive that, or it never recover.

idle owl
#

Ah, fair enough.

thorny jay
#

So I think I need to embed some of the logic to find the next packet into the library.

idle owl
#

Sounds like an ideal thing to add

thorny jay
#

Right now it might just read one byte, maybe generate an exception.

#

But I need to figure out the best way to do that in the library... I have a long week-end ahead, so I might spend more time on this.

idle owl
#

I'm working with it in the next couple of days, so I may be able to test things for you, but not over the weekend.

thorny jay
#

My ultimate goal is to have something "fail proof" that I can run four hours and record on an SD card the readings. Then keep in running at the office, or at home and get a clue about the air quality. If that works, then see if I can advertise that in BLE or push to AdafruitIO. But right now it will fail quickly.

#

My long week-end start on Friday. πŸ™‚ And I am maybe 6 hours ahead of you in daylight/timezone.

#

I'll try to write simple test code and if you can run that for 5 minutes without a glitch then my hardware is the problem. If you have the same problem, then you would be able to review a PR if I do one.

#

Speaking of timezone, it is sleeping time here. Let's stay in touch.

idle owl
#

Sounds good! Have a lovely sleep!

silver tapir
#

@lone axle Do the checks on the pr look ok to you now? Githubstatus says it's all ok.

lone axle
#

Will take a look in one minute.

#

I think if you push another small change to something it may do them correctly now though that the status is looking better.

silver tapir
#

That is were it used to show the error, I think.

lone axle
#

yep, and to clarify a bit. I do think the previous error is now gone. But it doesn't seem like it ran successfully either. It looks like it just didn't try this time (likely due to the issues with github)

#

ordinarily this page should have something green and indicating success on it

#

and the "Checks 0" in the tab near the top should show "Checks 1"

silver tapir
#

Ok. I'm looking for a typo in the comments or something :)...

#

Yeah, it's in build ci now, it worked. Thanks for the suggestion.

lone axle
#

Nice looks good now. I will test it out tonight

silver tapir
#

@slender iron BTW, I was testing the new json on my pyportal and found a bug but not with your code but on the pyportal lib. (already fixed in a pr)

slender iron
#

k, great!

silver tapir
#

I'm also processing a local.txt, and there I am running out of memory. Tomorrow I'll probably add mm to it to see if I can process it better.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
thorny jay
#

I have a suggestion of change for https://io.adafruit.com/ when you ask to see your "Adafruit IO Key", it show you code sample for Arduino, Linux Shell and Scripting. But maybe it should show the syntax for CircuitPython secret.py file.

manic glacierBOT
manic glacierBOT
ionic elk
#

@onyx hinge are you online

#

Trying to figure out how to do this submodule PR trick, but I'm not finding anything online about it, and it won't compile locally either

tulip sleet
#

did you want to make a change in a submodule and then PR that?

ionic elk
#

No, my issue is that my current Circuitpython PR (for timer module) relies on a change to a submodule (protomatter) that is still in the PR stages

#

so it is impossible for my PR to pass CI, but I'm reluctant to just ask for the submodule to be merged, because my protomatter PR might also need further changes

#

@onyx hinge said I could actually make the submodule in Circuitpython point to a reference within a PR, so I could essentially link the version of protomatter I'm suggesting in my timer PR

tulip sleet
#

there's a commit for your PR in the adafruit repo for protomatter; if you git fetch the submodule, and then check out the PR commit, you should be sync'd up with your proposed change.

ionic elk
#

fatal: reference is not a tree: 4c8bed230392573a7104ebb11d77d8e895a71943

tulip sleet
#

did you pull down the latest commits for protomatter into the submodule

ionic elk
#

with git fetch? yeah

#

I also moved to the master branch and pulled, still can't check out PR commits

tulip sleet
ionic elk
#

But do you mean to imply that I can check out an unmerged commit on github? Because I thought you could only do that with git CI

#

Oh, I guess it's the same thing, with a new branch and all that

#

so I guess when the protomatter request does get merged, it'll break my Circuitpython PR

tulip sleet
#

Alternatively what I have done is to add my own fork as a remote in the submodule, and then check out my pr branch there

#

i find that easier to understand; i haven't done it from the PR

#

so the clone of the submodule repo inside circuitpython becomes my development area for the PR

ionic elk
#

I'll just use gh pr checkout ###

tulip sleet
#

i didn't know about gh; i've been using hub

ionic elk
#

@onyx hinge Looks like the merge of master into protomatter is causing all of the nrf boards to fail?

#

../../lib/protomatter/arch.h:1234 :11: error: unused variable 'clockMask' [-Werror=unused-variable] 1234 | uint8_t clockMask = core->clockMask >> (core->portOffset * 8);

onyx hinge
#

@ionic elk filing an issue at the protomatter repo is my recommendation

ionic elk
#

Ok, no problem. Wanted to make sure it wasn't something I had messed up

onyx hinge
#

possible change needed is something like ```-#if defined(_PM_portToggleRegister) && !defined(_PM_STRICT_32BIT_IO)
+#if defined(_PM_portToggleRegister)
+#if !defined(_PM_STRICT_32BIT_IO)
// core->clockMask mask is already an 8-bit value
uint8_t clockMask = core->clockMask;
#else
// core->clockMask mask is 32-bit, shift down to 8-bit for this func.
uint8_t clockMask = core->clockMask >> (core->portOffset * 8);
+#endif
#endif

#

as we experience more of these libs that are maintained externally to circuitpython devs, we will need to investigate technical aides to keeping up to date. For instance, we don't get warnings when the upstream repo has a new tagged release; and nobody is testing whether the releases build against CircuitPython... there's CI for microlab, mp3, and protomatter; but they only build against micropython (in the first case) and arduino (in the other cases), so we don't find these problems until late unless we go looking

#

circuitpython uses MUCH more strict compiler diagnostic flags than arduino

#

if you didn't MIND rolling this fix into your PR it'll probably make things come to a successful conclusion sooner

ionic elk
#

Yeah, no problem

lunar crown
#

@indigo wedge Are you still moving ahead with the iMXRT 1011 and/or 1062 projects, or have they been set aside?

indigo wedge
#

half and half, I want to move forward but I'm blocked by another board I wanna put on sale first to get funds to produce the Feathers

#

otherwise the 1011 design is done and verified, just need to produce and document

manic glacierBOT
slender iron
tulip sleet
#

@slender iron Sorry! I confused this with another PR that had seen very recent commits, and thought you were still working on it.

#

or was it failing the build before the force-push? Anyway, will review right now.

slender iron
#

I pushed to that branch last night. I forgot I made a PR for it already

#

and ya, those commits did fail

tulip sleet
#

@slender iron I thought this was the PR where you saw a big increase in small allocations instead of a few large ones, and that you still wanted to work on it. I'm confused, where is the allocations one?

slender iron
#

I haven't made one for the allocations yet

#

it's all esp32spi and requests. not core cp

tulip sleet
#

ok, I got those mixed up. I thought you were still going to revise the json PR because it was doing too many small allocations, but I wasn't paying attention enough. sorry

slender iron
#

np

#

I'll try and explicitly state on a PR if it isn't ready for review

orchid basinBOT
manic glacierBOT
manic glacierBOT
trim elm
#

@solar whale Is there any advantage for the DHT library to use pulseio instead of just bitbanging on the raspberry pi? It seems like it's causing a bunch of issues and bitbanging seems to work fine (at least from what I've seen from a few minutes of testing).

#

Pretty much every issue currently open on the DHT library doesn't present itself when bitbanging but does when using pulsio

solar whale
#

I thought it did use bitbanging on the Pi. Isn't that why it was added to the library?

trim elm
#

it can use bitbanging, but if pulseio can be imported, it uses pulseio, and since pulseio is in blinka, it always uses it

solar whale
#

ah -- OK -- I guess pulseio was added to blinka after that was set up. Is the problem only with the DHT or is there a bigger issue with blinka and pulseio? FYI -- I can't get bitbanging to work on an M0 board -- if I remove Pulseio.

#

In any case, I have no objection to using bitbang on the Pi, especially if it works better πŸ˜‰

trim elm
#

So I think the issue is that we're not using it as a context manager and the process never gets exited, which I don't think causes any issues on circuitpython, but does cause issues on the pi

#

I'll add a check so it only tries importing pulseio on CircuitPython

solar whale
#

No objection from me but I still wonder if there is something with the pulseio implementation that needs to be looked into.

manic glacierBOT
solar whale
#

I would still leave it to use bitbang if pulseio does not exist -- even in CP

#

you can just ignore pulseio on the Pi if you want to.

tulip sleet
#

is something running as a separate process that hangs around after the main script is running? It could possibly be made dependent. This is a stretch, but the Python threading stuff can prevent a process from exiting, but if you set the thread to be a "daemon", then it exits quietly when the parent process tries to exit. Maybe there is something similar that could be done here? (I assume it's not a thread.)

solar whale
#

@trim elm in regards to your original question, I think there IS an advantage to to using Pulseio, but only if it works...

trim elm
#

@tulip sleet Yeah, that's what some people in github think the issue is, and I'm pretty sure they're right. Do you know how I would go about doing that? I know that atexit isn't in circuitpython, and having __exit__ run would require it to be run in a context manager.

tulip sleet
#

you call call __exit__ explicitly

trim elm
#

Ok

tulip sleet
#

you might need to catch any exceptions it throws, but I think that might work

manic glacierBOT
trim elm
#

Yeah, that's what I'm thinking would be the best way

#

And the example already has a try/except, so it wouldn't be that big a deal

solar whale
#

good -- better to fix the root cause than to implement a workaround!

lapis hemlock
#

Once the code itself is accepted, I will add the stubs, so you won't have to trouble yourself with the documentation.

manic glacierBOT
#

The bug, as described here, has been fixed. There are other ways with multiple devices on the SPI bus that can cause similar problems, but these scenarios are much less likely to occur, since the two most common devices (displays and SD cards) can now be used without deadlocks.

The remaining scenario is when the same SPI bus is used by foreground Python code that locks the SPI bus (including using bus_device) and is also used by display or by sdcardio.

ionic elk
#

@onyx hinge so, what's the target frequency on the RGBMatrix again? I see there's no prescaler set, so it's running at 168MHz, and you have the period set to 1000 so I'm guessing it's at 168kHz unless you set it again elsewhere?

onyx hinge
#

@ionic elk the arduino code from long ago shows an overall refresh rate of either 150Hz or 250Hz, but that's displaying multiple planes. Each plane is shown a different length of time, based on powers of 2 I think

#

and then there's the scanning of the rows of which there are 8 or 16 row-pairs

ionic elk
#

Oh nevermind, it's because TIM6 maxes out at 42MHz

onyx hinge
#

different timers have different capabilities?

ionic elk
#

Dang I probably do need to program that in somewhere

#

yeah it all kind of depends, as is typical for ST

#

every chip has a different frequency, buses have different max frequencies, different timers land on different buses depending on the chip line

onyx hinge
#

you'd have to double check my math but to get an overall refresh rate of 250Hz with a depth of 5 (= 32 brightness levels) and 16 line-pairs your interrupt will need to be something like 250HzΓ—32Γ—16 = 128kHz

ionic elk
#

I might need some kind of minimum frequency parameter in my timer setting system

onyx hinge
#

this is for sure an "Ask Dragon" question, my answers are only what I can infer

#

or maybe that's a depth of 4, so 64kHz ? I don't know. I know the examples/protomatter/protomatter.ino printed a number close to either 150 or 250 when I ran it on M4 at the very beginning

#
// around 250 Hz is where things firm up. And while this could proceed higher
// in some situations, the tradeoff is that faster rates use progressively
// more CPU time (because it's timer interrupt based and not using DMA or
``` in the Arduino code
#

also not every interrupt is the same period of time .. successive color planes each are given twice as much time, so you might have one interrupt that is 7.8us, one that's twice that so 15.6us, and so forth.

#

A 48MHz clock should be plenty to count at if you need to measure out 7.8us, your counter top/bottom/max/preload/whateveritis-in-stm32 would be 374 or something

ionic elk
#

@onyx hinge Ok, I think my timer PR is basically done! I tested the RGBMatrix and it's still kind of broken and fuzzy, but not anymore than it was already for me. I just got my USB cable in for the ESP32S2 so I might push the fix for RGBMatrix behind ESP32 PulseIO for now.

trim elm
#

@solar whale If you'd like to, and if you have time, it'd be really great if you could test my branch of DHT. For the life of me, I can't figure out why pulseio can't find libgpiod, so I can't test the pulseio version, but the bitbanging approach seems like it's still working fine. Just note that I did add a parameter where you can disable using pulseio when you initialize the DHT22 object, so you will have to change that to test the simpletest with pulseio. https://github.com/adafruit/Adafruit_CircuitPython_DHT/pull/46

solar whale
#

@trim elm I should be able to try it tomorrow.

trim elm
#

Awesome. Thanks

onyx hinge
#

@ionic elk excellent .. still wish we knew what was going on with your setup. I should test again over here... but don't seem to find the time.

idle owl
#

@lone axle You working on any library code at the moment?

lone axle
#

No, not at the moment.

idle owl
#

Fair enough. Thanks. I'm trying to decide which library to move to main first, and figured if I'm going to rock somebody's git world, it might as well be yours. πŸ˜„

#

I figured you'd be up for following instructions to make sure I'm clear on explaining how to update.

lone axle
#

Heh, yep I am up for that.

#

I will be out for a bit this evening but I'd be happy to try it out when I can.

idle owl
#

@lone axle I more meant if I changed a lib you were working on out from under you, you could see if my instructions are clear enough for updating. But I'll let you know if/when I need someone to test things.

lone axle
#

Ah, I see.

slender iron
#

I'm enabling PYSTACK

#

should speed up calls to large functions

onyx hinge
#

I don't know what that is but I like it when you speed things up 🏎️

manic glacierBOT
lone axle
#

@idle owl as fate would have it I did end up working on the display_text library a bit tonight. I have a draft PR that needs to be finished up and have some more testing still before it's ready. I can try out your instructions on that if you want.

#

I'll be getting back to it tomorrow night.

manic glacierBOT
#

Hello world,

I'm making a file reader, and I have a cursor implemented so far (because in the far future I would like to implement writing someone). I would like to use the character β–“ as my blinking cursor, similar to nano on linux.

Unfortunately using these characters results in an OverflowError. Is it possible to use these types of characters in CircuitPython?

(I think they are called extended characters, because they go from 128 to 255, unlike regular characters that rang...

manic glacierBOT
manic glacierBOT
#

I have some suggestions of things to change or double check.

Protomatter submodule update looks right, gitk says:

  > Fix NRF compile warning issue
  > Merge branch 'master' into cpy-timer-allocator
  > cpy-timer-allocator
  > Merge pull request #12 from adafruit/teensy4
  > Merge pull request #9 from adafruit/actionsci
  > Merge pull request #7 from jepler/circuitpython-build-fix
  > Merge pull request #8 from adafruit/esp32
  > Fix clang-format detail
  > clang-format the l...
#

The other ports don't do this. I think it would be better to either

  • Add it to all ports, and make it a part of the contract of never_reset_pin_number that it claims the pin
    • if so, maybe there's an overall code size savings if claim_pin calls can be folded into never_reset calls.
  • or assert(claimed_pins[pin_port] & (1<<pin_number) so that mistakes are caught as soon as possible.
    • again, probably better to add the assertion on all ports
    • requires developers to te...
manic glacierBOT
#

Yeah this one was kind of frustrating, because it's really an API issue: across all ports, claim_pin is always called with a pin object as the parameter, but never_reset_pin_number is called in the context of a reset function. Reset functions don't actually have pin objects, they just iterate through port and mux numbers, so I can't call claim_pin without doing a wasteful lookup for the correct pin object.

I should probably just make another alias for claim_pin that uses the port and ...

#

I added the original file for the F405 very early in the port process - back then, we had less clear distinction between the STM32 line and the package. So when I originally put these and the pin files together, I didn't fill out the later GPIO banks because we didn't support the packages they appeared in. We now support new packages with minimal effort, so these represent additional timer and peripheral opportunities that should be included.

trim elm
#

In the latest versions of chrome 83 and 84, files with .uf2 extensions appear to be blocked from being downloaded. Hopefully this will be resolved soon, but in the meantime, you can get around it by going to settings -> Privacy and Security -> security, and turn on 'No protection' while you download the files.

idle owl
#

@lone axle It would need to be pre-PR. Coincidentally, I was going to do Display Text, it turns out, but held off, and now in your process wouldn't be a good time. Thank you for letting me know though.

idle owl
#

@tulip sleet @onyx hinge Ok, so how did things go when you moved CircuitPython from master to main? I was thinking about it this morning, and realised that all existing forks will have to be updated, right? I don't need to know how to move to main, I want to know what miscellaneous steps you had to follow once CP was moved, if you remember.

onyx hinge
#

Scott did all the legwork on github. It doesn't do anything to existing forks, but that didn't affect me as I don't use the branch called "master" in my own fork; I think other people may work differently.

idle owl
#

Hmm fair enough.

onyx hinge
#

One thing Scott did that I wondered whether it was automated: fixing pull requests so that they were to the new "main" branch

idle owl
#

That one I think I know how to do, I think it's part of the instructions I have. But I'm uncertain.

onyx hinge
#

yeah I am sure it can be done manually at any rate

#

if there's a script for updating PRs I'd love to run on some repos for software I maintain

idle owl
#

I'll have to ping Scott then. I thought I had everything he did, but it sound like I don't.

onyx hinge
#

He may have done it manally, the number of PRs is relatively small

idle owl
#

Seems likely.

#

And not feasible in my case long term.

#

@slender iron When you're around, I have some questions about moving from master to main.

slender iron
#

@idle owl I'm around now

idle owl
#

Hello. I'm following Scott Hanselman's post, but I feel like there's more to it than that. What else did you have to do?

slender iron
#

change the default branch in github settings

idle owl
#

Right.

slender iron
#

update all pending PRs to be against main and not master

idle owl
#

Ah ok

slender iron
#

I copied the branch protections from master to main

#

and set master to requiring 5+ approvals after we accidentally merged to it πŸ™‚

idle owl
#

fair enough

#

Alright thanks.

slender iron
#

also need to check any CI stuff that may have a branch restriction

ionic elk
#

whyyyyyyyy

idle owl
#

@slender iron Hmm do we have a lot of that?

slender iron
#

not sure, lemme grep

solar whale
#

the power rails snap off

slender iron
#

@idle owl looks like readme.rst has a link to the CoC in master

idle owl
#

Bleh. Alright. Noted.

#

Thanks

slender iron
#

np, just grepped the bundle for master

idle owl
#

Fair enough.

#

Might be able to patch that pretty easily.

slender iron
#

yup, think so

#

ci files look ok

idle owl
#

That's good, didn't think there would be an issue, but good to check.

slender iron
#

πŸ‘

manic glacierBOT
#

Sorry for the late response, I just got the computer on. (finally)

Here is the code:

# https://learn.adafruit.com/circuitpython-stage-game-library/bouncing-balls
# https://circuitpython-stage.readthedocs.io/en/latest/README.html

import stage
import ugame
import time

def update_text(lines_to_skip=0, highlight=False, highlight_x=0, highlight_y=0):
    terminal.clear()
    with open("bible.txt", mode="rt") as file:
        for _ in range(lines_to_skip):
            f...
idle owl
#

@slender iron Remembered my other question - what happened with your fork? Or because you made the change from your local setup, you didn't run into issues with your fork not being updated?

#

I mean, what will happen to others who don't know to update and try to PR to a lib with main

slender iron
#

I don't keep my main branch of my fork updated

idle owl
#

Jeff doesn't either. You're no help! πŸ˜„

slender iron
#

github should default to PRing to main

#

I believe

idle owl
#

Yeah that's what all my research said

#

Or rather, indicated. Nothing said it explicitly.

slender iron
#

people do need to know to start from main rather than master

#

otherwise they may need to rebase

idle owl
#

The guide is being updated. But that doesn't mean people will read it.

manic glacierBOT
slender iron
#

yup

#

we could delete the master branch which should cause an error if they try and update it

#

but I left it for core

idle owl
#

Any reason not to delete it? I mean, I did the -m so it kept things into the main branch. Might be worth throwing the error. Either that or we'll spend the next year pointing people's PRs to main and pointing folks to the guide. Which is also a viable solution.

#

There will be growing pains regardless.

slender iron
#

I'm fine trying it

#

only one way to find out how it'll work πŸ™‚

#

we can always add it back

idle owl
#

Yep. I have Dylan working with a open PR right now, so I guess we'll find out how that goes down.

#

I was going to wait, but better to have something fail hard on Dylan than someone new.

slender iron
#

haha, ya πŸ™‚

orchid basinBOT
idle owl
#

@slender iron Did you run this? git symbolic-ref refs/remotes/adafruit/HEAD refs/remotes/adafruit/main

slender iron
#

I didn't

idle owl
#

Ok, neither did I. I'm not entirely sure what it's doing. The explanation is "update the default branch to be (adafruit)/main" but I don't follow entirely.

slender iron
#

ah hrm

idle owl
#

It's for updating your "local clones".

slender iron
#

it must not be part of my workflow

idle owl
#

I'll have Dylan run through things and see if he needs it.

slender iron
#

kk

#

when I start a new branch I always checkout git checkout adafruit/main first and then create the branch

idle owl
#

That's what I said to do in the guide. And what I do as well.

#

Adding instructions on moving your local clone from master to main though, in the guide, and am not sure about that last one.

#

About to find out! πŸ˜„

slender iron
#

ya, I'm not sure what that means. does it mean updating your own github fork?

idle owl
#

I believe so, yes.

slender iron
#

ya, I think I okayed it

idle owl
#

Ok.

slender iron
#

similar things happen when folks rebase

idle owl
#

Ah fair enough.

manic glacierBOT
#

This looks like a stage library issue. @deshipu may have ideas.

Note that we don't support extended ascii, Python3 and CircuitPython use UTF-8 for it's native string encoding. The "dark shade" character is 3 bytes long in UTF-8.

Mu serial support is a known issue: https://github.com/mu-editor/mu/issues/797

I've seen a difference in iTerm vs Terminal on Mac as well.

lone sandalBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

@slender iron did you get your json "readinto" to work?

tulip sleet
#

i merged it yesterday

onyx hinge
#

There was a problem where sockets didn't actually have "readinto"; that's what I'm wondering about

tulip sleet
#

That I don't know, but sockets are being Pythonized, so it could be added? But Scott can answer authoritatively.

onyx hinge
#

looks like esp32spi sockets are a bit of distance from that at the moment, I don't know if the work scott's been doing is with esp32s2 or esp32spi

#

I added support for "objects with readinto" to mp3 playback but it also can't work with current esp32spi

tulip sleet
#

he's doing esp32spi

#

i think :). it's a big rewrite

#

i was confused by this too

onyx hinge
tulip sleet
#

or make it a draft PR?

onyx hinge
#

If I understood right, Scott prefers I don't do that, so that draft PRs don't clutter up the pull request tracker.

tulip sleet
#

I didn't know that; I think a draft is good because it's easy to find. If we are counting them wrong we can change the counting code. But I'll leave it to thim.

tulip sleet
#

@onyx hinge In the background PR, the intention is that the whole callback list be gc'd, right?

onyx hinge
#

yeah I think the problem scott pointed out is real

#

every pointer on the list should have its "data" pointer included as a valid GC pointer

#

I got bogged down thinking about how/whether to use the critical section macro in this list traversal

tulip sleet
#

I agree, makes sense. At first I though you only wanted to gc the head of the list, and I knew it would walk the whole list. btw, do you use the prev ptr? I don't know why it's a two-way list

#

so you can remove a middle easily?

onyx hinge
#

hm originally I did have a "remove callback" call but I didn't end up using it

#
+    // We don't enter the callback critical section here.  We rely on
+    // gc_collect_ptr _NOT_ entering background callbacks, so it is not
+    // possible for the list to be cleared.
+    //
+    // However, it is possible for the list to be extended.  We make the
+    // minor assumption that no newly added callback is for a
+    // collectable object.  That is, we only plug the hole where an
+    // object becomes collectable AFTER it is added but before the
+    // callback is run, not the hole where an object was ALREADY
+    // collectable but adds a background task for itself.
+    //
+    // It's necessary to traverse the whole list here, as the callbacks
+    // themselves can be in non-gc memory, and some of the cb->data
+    // objects themselves might be in non-gc memory.
     background_callback_t *cb = (background_callback_t*)callback_head;
-    gc_collect_ptr(cb);
+    while(cb) {
+        gc_collect_ptr(cb->data);
+        cb = cb->next;
+    }
 }
#

here's what I've got at the moment that I'm ruminating on

#

I do end up using prev, only to detect whether an item is inserted in a list. A bit weird. ```void background_callback_add_core(background_callback_t *cb) {
CALLBACK_CRITICAL_BEGIN;
if (cb->prev || callback_head == cb) {
CALLBACK_CRITICAL_END;
return;

#

("cb" is an interior pointer within an allocation, never it own allocation; so directly gc_collect_ptr()ing it doesn't really make sense)

tulip sleet
#

The gc will walk the next and prev pointers if they point into heap space, but are the objects not in heap space?

onyx hinge
#

I think for the most part the objects are in the GC heap but not always.

#

and some of the data pointers are NULL

#
supervisor/shared/usb/usb.c:    background_callback_add(&callback, usb_background_do, NULL);
``` these don't really have objects that they act on per se
tulip sleet
#

I asked the q above because I was writing up a comment about this very thing, thinking that you might unintentionally gc the non-head, but that's what you want

#

so the code above makes sense to me

onyx hinge
#
``` this one is non-heap data, it's global static data
#

it is okay to pass such pointers to gc_collect_ptr, or not?

#

calls gc_mark, which ```// Mark can handle NULL pointers because it verifies the pointer is within the heap bounds.
STATIC void gc_mark(void* ptr) {
if (VERIFY_PTR(ptr)) {

tulip sleet
#

yes, we pass statically allocated ptrs to gc all the time, to gc the things those objects hold

onyx hinge
#

gc_collect_root would scan for pointers within a block

#

but head->next->next->data wouldn't get scanned just by gc_collect_ptr(head) would it?

#

specifically if head->next is NOT itself heap memory

tulip sleet
#

that's right, you're right, I was thinking they were on the heap

onyx hinge
#
``` is the example where the data pointer `dma` and the callback itself `dma->callback` are both static data
manic glacierBOT
slender iron
#

@onyx hinge esp32spi.socket will have recv_into

#

requests will create a file-like wrapper for it to pass to json

#

I'll try and push all my changes today during my stream

onyx hinge
#

@slender iron cool, I'll revisit that code when esp32spi.socket is upgraded.

slender iron
#

yesterday I got it so socket.recv_into makes zero allocations

#

πŸ™‚

onyx hinge
#

dunno if it'll work out, vis a vis the speed of esp32 at transferring data, it'll be fun to see though

#

do you think I should write the core code to check recv_into and readinto both, then?

slender iron
#

I chose not to because recv_into isn't standard

#

and it's not hard to wrap

#

socket is just an old api I think

onyx hinge
#

Thanks for the reviews and help @tulip sleet @slender iron

idle owl
#

@lone axle There's not a lot that changes if I move to main in the middle of your PR, but it borked another PR so I'd rather not risk breaking your PR. I'll consider moving the lib once your PR is merged.

#

Thanks for offering to be a test subject - Dylan ended up there today. πŸ˜„

lone axle
#

Okay sounds good. I'll be working on that here in a bit tonight. I'll try to get it finished and ready for review tonight. But might not make it until tommorrow. soon(tm) either way.

idle owl
#

No worries. Nothing will be happening until at least next week. And then I'm uncertain what our overall plans are.

#

We're doing this slowly. Which has its own challenges, but it is what it is.

#

@lone axle I will still appreciate you looking at the updated guide - it's not finished yet because I realised the GitHub UI update and our move to Actions rendered a bunch of it out of date. So I need to decide what to do there. And document one more thing about the move from master to main before that bit is done as well. I'll let you know when I'd like another set of eyes on it

#

Anyway, heading out for now. Cheers!

lone axle
#

okay sounds good to me. See ya! have a nice night.

manic glacierBOT
#

@UnsignedArduino Stage doesn't use CircuitPython's fonts, it instead has its own pixel font, with more colors. But due to size constraints, it only handles the 128 ASCII characters, and doesn't have any extended or unicode characters.

However, I included a few extra symbols in the font in place of the control characters β€” you can look at the whole font here: https://raw.githubusercontent.com/python-ugame/circuitpython-stage/master/font/font.bmp

So terminal.char(x, y, "\x19") might d...

manic glacierBOT
#

Could you say more about the advantages and disadvantages, and also how you choose the size?

It sounds like this could save a lot of heap churn. Is 1024 a good size? I looked in micropython and I see only a few ports have PYSTACK turned on. stm does not but it does have a stack size in case you do turn it on:

halbert@salmonx:~/repos/micropython$ ag pystack ports/*/main.c
ports/javascript/main.c
92:    #if MICROPY_ENABLE_PYSTACK
93:    static mp_obj_t pystack[1024];
94:    mp_pyst...
#

When a byte code function is called the vm allocates state for the function's "code state" as-is any code states over 44 bytes will be allocated on the heap. Otherwise, it'll be allocated on the stack with alloca. These allocations will be slower and potentially clutter the heap. This will impact performance on tiered memory systems even more where the heap may be slower than internal memory.

Enabling the pystack establishes a separate area for these and other vm temporary allocations to...

manic glacierBOT
#

Ahh, okay! Thanks a lot for helping me.

It seems like that I can specify a font, according to the docs: https://circuitpython-stage.readthedocs.io/en/latest/README.html#stage.Text

Stage doesn't use CircuitPython's fonts, it instead has its own pixel font, with more colors. But due to size constraints, it only handles the 128 ASCII characters, and doesn't have any extended or unicode characters.

Could I specify a font that includes extended and unicode characters, and Stage would...

manic glacierBOT
low sentinel
#

Anyone object to removing displayio.Shape in 6.0.0? I don't think anyone uses it.
vectorio is probably better anyway
@slender iron It's used for bitmaps right? I think it might could be collapsed together? vectorio is better than Shape for most cases, and for simple shapes like rectangle and circle it is basically as fast as a bitmap; but for things like the adafruit_display_shapes library there is some tradeoff to consider between O(n*m) memory and computing pixel winding numbers (for polygons). But vectorio is not available everywhere displayio is on account of small controllers' memory running out.

Tangentially related, I had thought about reimplementing RoundRect as 4 circles and 2 rectangles. Due to the draw masking that displayio does, I think it would be almost indistinguishable speed-wise from the bitmap and require O(1) memory for any sized RoundRect.

#

Your allocation optimization work is ❀️. I can't wait to use the new stuff, but my next foray into cpy c code will probably be getting async/await up to CircuitPython acceptance standards.

manic glacierBOT
#

Is there an issue ticket that describes this work? I saw this was mentioned in a long YouTube video: https://www.youtube.com/watch?v=iQQLMhxAR34&t=39m30s but I've not yet gone through all of that, is there an editted highlights for that?

I've run up against memory issues in Makecode before especially in the blocks mode. @mileswatson started a thread on this on MakeCode Forum: Memory Tools in MakeCode Arcade.

onyx hinge
#

@low sentinel thanks for sticking with async. Consider attending a weekly meeting so we can discuss what Tannewt wants to see. If we have general agreement (about how the user code will look, for instance) before you do a lot more coding, that helps when we get to the PR review step. It's up to you but voice chat can often help conclude these discussions faster.

#

(wow a lot of activity overnight!)

lone axle
#

is vectorio new-ish? I don't think I've seen that before. Also not sure that I have ever run across displayio.Shape before is there code somewhere that shows how that could be used?

onyx hinge
#

@lone axle yeah I think vectorio is new in main and not in 5.3.x.

orchid basinBOT
#

I have repeatedly been tripped up by wanting to enter a manufacturer name in the text search area. While it is possible to open the filter panel and select manufacturers, it is more convenient and intuitive to simply enter this in the single text search box.

By concatenating several fields from the dataset (name, id, manufacturer, and features), and then searching that it becomes possible to text-search e.g., for "alligator" (board feature), "diary" (manufacturer) or "metro_m4" (board id)...

lone axle
#

Is this behavior expected?

>>> i = 0.0
>>> while i < 1.0:
...     i += 0.05
...     print(i)

it outputs as expected up to 0.5 and then seems to get off somehow:

0.45
0.5
0.549999
0.599999
#

Without the loop it doesn't seem to have the same issue:

>>> p = 0.5 
>>> p += 0.05
>>> print(p)
0.55
solar whale
#

same in CPython -- just the nature of floating point, I think ```IndentationError: unexpected indent

while i<1.0:
... i = i +.05
... print(i)
...
0.05
0.1
0.15000000000000002
0.2
0.25
0.3
0.35
0.39999999999999997
0.44999999999999996
0.49999999999999994
0.5499999999999999
0.6
0.65
0.7000000000000001
0.7500000000000001
0.8000000000000002
0.8500000000000002
0.9000000000000002
0.9500000000000003
1.0000000000000002

lone axle
#

I see, interesting. I will play with it some, maybe counting with ints and then dividing could be better

solar whale
#

There is no loss of precision,, just some numbers cannot be represented exactly in Floating point

#

never test floats with ==

honest dust
#

The way to avoid things getting out-of-whack because of this is to do: value = i * 0.05 and let i go from 0 to 20.

#

So don't add small float values up in a loop, but always compute the value based on the current loop index.

lone axle
#

Thank you matthijs

onyx hinge
#

That's a very good suggestion @honest dust !

solar whale
onyx hinge
#

Usually with these kinds of loops, you can convert it from thinking about fractions instead of decimal numbers. Loop over integers which give the numerators and divide by the denominator. Then you'll get equally spaced values and a minimum of floating point misery. You still can't have exactly 1/3 or 11/20 but you'll get the right number of values within the range you want, and they'll be as accurately spaced as possible

#

(i / 20 and i * .05 being approximately the same)

solar whale
#

approximately ??

honest dust
#

The general formula is x = start + (end - start)*step_size*i where i is your counter.

#

There is no 0.05 in floating point math, @solar whale

#

Only an approximation πŸ˜‰

solar whale
#

as shown above

honest dust
#

Only integers are exact in floating point math (up to 2^54 or something).

#

Maybe I should write the formula as x = start + (end - start)*i/num_steps where i goes from 0 to num_steps.

main meteor
#

Some specific fractions are exact in floating point math, but many are not.

solar whale
honest dust
#

Fair enough πŸ˜„

manic glacierBOT
lone axle
#

Is there a "proper" place for examples of things that are builtin to the system like vectorio? if it were a library there would be simpletest and perhaps some others in the examples folder, but as part of the system I'm not sure where those would be.

stuck elbow
#

well, there are tests

#

and you can include examples in the docs

lone axle
crimson ferry
#

I'd anticipate a vectorio Learn guide at some point

lone axle
#

I look forward to it! having no luck figuring out how to use it and I couldn't find example code anywhere

crimson ferry
lone axle
#

In an older newsletter I found this blurb:

The vectorio library builds on an Feather M4 Express and draws concrete shapes are composed into a VectorShape, which is put into a displayio Group for display 

But if I create a Rectangle and try to add it to a group I get this error:
ValueError: Layer must be a Group or TileGrid subclass.

crimson ferry
#

circle, polygon, and rectangle don't have (x, y), so I wonder if you have to have a vectorio.VectorShape to anchor them

lone axle
#

Ah, I got it packed inside of a VectorShape now and It did draw something to the screen. But it's only two sides of the rectangle.

#

If I add a second color to the rect palette I see more get drawn:

rect_palette = displayio.Palette(2)
rect_palette[0] = 0x0000FF
rect_palette[1] = 0xFF0000
vector_shape = VectorShape(shape=rect, x=10, y=10, pixel_shader=rect_palette)
low sentinel
#

hm what if you

palette = displayio.Palette(2)
palette.make_transparent(0)
color_palette[1] = 0xFFFFFF
crimson ferry
#

oh, Circle and Rectangle are polygons, some mathematicians might disagree πŸ˜‰

low sentinel
#

What makes you think they are polygons?

lone axle
#

@low sentinel is palette index 0 of the shapes palette (rect_palette in my example) supposed to be the outline of the shape? or is it meant to only be on the top and left sides?

low sentinel
#

no, what's happening there is the shape's invalidation box is supposed to be filled with transparency. If the pixel shader expects to return a color for index 0 I believe it's drawing a strip of bounding box (rather than transparency)

#

that is too subtle a sharp edge and needs to be rounded off.

lone axle
#

Ah.

low sentinel
#

I had some ideas about extending color utilities in vectorio so I left this a little raw to not design the api into a corner

#

tragically, a corner is all you drew

crimson ferry
#

so to speak πŸ˜‰

lone axle
#

I was able to get a red rectangle showing like this:

rect = Rectangle(319, 239)
rect_palette = displayio.Palette(2)
rect_palette.make_transparent(0)
rect_palette[0] = 0x0000FF
rect_palette[1] = 0xFF0000
vector_shape = VectorShape(shape=rect, x=0, y=0, pixel_shader=rect_palette)
splash.append(vector_shape)
low sentinel
#
rect_palette.make_transparent(0)
rect_palette[0] = 0x0000FF

is surprising

#

but 🀷 if it works

crimson ferry
#

Circle and Rectangle are accepted as polygons in class vectorio.VectorShape(shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int = 0, y: int = 0)

lone axle
#

Interestingly the blue outline on the top and left is outside of the shape. If I put the shape at 0,0 I don't see the blue line

#

@low sentinel do you have any sample code that shows usage of the module?

low sentinel
#

@crimson ferry then I did a bad in the documentation. They're absolutely not vectorio.Polygons

crimson ferry
#

This is cool. Need to grok the paradigm, just like starting with displayio, but then pretty powerful!

low sentinel
#

@lone axle give me a few minutes and I'll clean up an old example I used for testing. It kind of showcases the strengths and weaknesses of vectorio and drawing dynamic vector shapes on microcontrollers without graphics hardware (like EVE2 or whatever)

crimson ferry
#

a lot faster too than the display-shapes library I'm guessing

low sentinel
#

Faster was a non-goal. I hoped to match the bitmap implementation's speed only.
Memory usage is where vectorio shines

lone axle
#

My intention is to ultimately see if it would make a better solution for the ProgressBar library. Currently it's using a bitmap and filling pixels with x,y for loops.

low sentinel
#

and, well I guess initialization speed and mutation speed

#

oh you'll probably have a better time with a vectorio.Rectangle and just adjust its width property.

#

or you could use polygon and adjust its right side. That way you don't have to compute positioning on update, only width.

#

in either case you would not need a fixed 2d array of pixels allocated.

lone axle
#

How do you change the width of rectangle?
I tried like this:

rect.width = 100

but got this error:

AttributeError: 'Rectangle' object cannot assign attribute 'width'
low sentinel
#

welp looks like another bad. I spent more effort on polygon and circle than rectangle tbh; I faintly remember a reason for keeping rectangles of fixed size but that reason (if it exists) is lost to me now.

lone axle
#

Okay. Thank you. I really appreciate your help and insight! I'll tinker around with Polygon. I would love to see a repo of examples or a learn guide for this module get created.

#

or maybe a new page within the displayio guide

low sentinel
#

this old vectorio test uses async/await and a whole bunch of debug tooling I made. It's going to take me a few minutes yet πŸ˜…

lone axle
#

No worries, no rush on my end. With what you've given me so far I was able to get it drawing as expected so I can do quite a bit more tinkering on my own now as well.

#

Thank you for creating this module btw as well. I somehow missed this when it first got merged in.

crimson ferry
#

interestingly, hitting 0 free memory gets an exception, but no error text MemoryError:

manic glacierBOT
#

Could I specify a font that includes extended and unicode characters, and Stage would use them? If I can, how?

You can do it, but it still can only have 128 characters at the maximum β€” so you could replace the first 32 symbols with your own, but that's it. To generate the font data, you can use the genfont.py script from the directory I linked to. You basically edit the font.bmp file to fit your needs, and then copy the output of the script into your program as the font data.

...

stuck elbow
#

@crimson ferry that's intentional, there is no room to format the message

manic glacierBOT
#

use displayio for your application

Ahh, I didn't like how displayio managed text (If you had 30 characters at the beginning and assign a 32 character string, you get an exception and I think the strings can't be more than 1 line tall) and stage seemed like a good replacement for it, since handling text was so intuitive.

But I've heard that the display_text module got some improvements - should probably go check it out (again)

I'll close this, because I got my thing to work, (yay, ...

low sentinel
lone axle
#

Thank you!

fringe ginkgo
#

Specifically, can't get past the adafruit_bme280 import. Is this a known problem?

lone axle
#

@fringe ginkgo I believe it is a known problem. The non-express M0 devices like the M0 RFM9x's have very little memory. Over time the core system and libraries have grown a bit and I think they no longer fit. I believe jerryn is working on optimizing the size to try to get it to fit, or perhaps looking into different sensors with smaller libraries.

fringe ginkgo
#

ok. Suspected this was the problem.

lone axle
#

In general though those M0 devices are going to have very little left over after the radio library. Its probably best to try to get an M4 if you can. I don't think there is a "all in one" feather M4 but there are Lora breakouts by themselves or on featherwings that can work with a variety of M4 devices.

fringe ginkgo
#

Thanks @lone axle I do have an M4 and an RFM95 to attach to it. Had hoped to use the combined M0+RFM9x to drive a simple sensor network. Not clear if I can do anything now with the M0+RFM9x.

solar whale
#

@fringe ginkgo I am working on a build for the feather_m0_rfm9x that has the rfm9x library β€œfrozen” into the build. That greatly reduces the RAM needed. It is still a β€œwork in progress” some other modules have to be removed and I am struggling to make it fit. I don’t have an ETA. I would recommend using Arduino for the M0_rfm9x board. The RadioHead library works well and there is plenty of RAM under Arduino.

stuck elbow
#

@solar whale if you can get rid of analogio, it's rather large

#

also usb_hid

solar whale
#

@stuck elbow yes - I also need to take out pulseio but then the DHT sensors don’t work and they are popular....

#

I was hoping to use bitbang for the DHT, but it is not working....

stuck elbow
#

yeah, 1wire is sensitive

#

one of the worst protocols, together with neopixels

solar whale
#

I’d be happy to just give up the DHT’s many better choices.

stuck elbow
#

I assume you already removed usb_midi, touchio, pixelbug, neopixel_write, apa102, audioio and samd?

solar whale
#

I was hoping to preserve neopixel_write, but it may have to go and keep pulseio.

stuck elbow
#

also audiomixer

solar whale
#

I think that is gone already. Will check tomorrow.

lone axle
#

I've run into a really strange situation that I do not understand. I am working on converting the progress bar library to make use of vectorio polygons instead of holding a bitmap. I mostly had to change the constructor and the progress property. The constructor seems to be working properly. Here is the code for the progress property: https://github.com/FoamyGuy/Adafruit_CircuitPython_ProgressBar/blob/a531e9e55cab0aa62a5d5f35f4e9a5c11d10e336/adafruit_progressbar.py#L148

using this version of the library If i set the progress like this:

progress_bar.progress = 0.5
progress_bar.progress = 0.85
progress_bar.progress = 0.35
time.sleep(0.02)
progress_bar.progress = 0.1

The last change will not have any visual effect. The bar is stuck at 35%. There is a debugging print statement inside of progress property and it does print out the proper points of the polygon, but visually it doesn't change on the screen. If I change the sleep time like this: time.sleep(0.01) then I will see the last progress change take effect. The bar will properly go back down to 10% visually on the screen.

#

How could sleeping 0.02 vs. sleeping 0.01 before a particular action affect whether the action is working successfully?

#

Interestingly if I remove the ProgressBar class from the equation and just use a vectorio Polygon directly I am able to update the points while utilzing sleep:

    for i in range(50, 150):
        rect.points = [(0,0), (i,0), (i, 30), (0,30)]
        time.sleep(0.1)

This is the same basic approach that I am trying to use inside the progress property but for some reason it's behaving differently

fringe ginkgo
#

Thanks @solar whale Will go with Arduino but keep an eye out for your frozen lib solution.

onyx hinge
#

@lone axle 5.3.1 or main? If it's main-only then it may be a problem I created with recent changes. If it is newly broken, for sure file an issue.

#

probably file an issue either way. I guess we discussed that vectorio wasn't in 5.3 so maybe it's not easy to determine whether it's new or not

ivory yew
#

hmmm I want to change how CircuitPython talks to the ADC just for Big Honking Button. I'm trying to figure out how to do this with the least amount of surgery to anything outside of the boards/winterbloom_big_honking_button.

#

I thought of making common_hal_analogio_analogin_get_value weak so that I can create a new implementation in board.c.

#

Or maybe exposing a custom get_value function defined in board.c.

lone axle
#

@onyx hinge its on 6.0.0 i believe. I will try a few other versions in the morning and create an issue

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

I'm running latest CircuitPython 5 (as of yesterday's build) with current libraries. When I try to run the second example in the Airlift Featherwing guide (code included below) I get this error:

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

You are in safe mode: something unanticipated happened.
The CircuitPython heap was corrupted because the stack was too small.
Please increase the stack size if you know how, or if not:
Please file an issue ...
manic glacierBOT
solar whale
#

@fringe ginkgo If you are interested in it, I do have an experimental build and you are welcome to try it with the caveats that it is totally unsupported (Adafruit has not endorsed or approved it). Several modules have been removed (analogio, pulseio (no DHT sensors), neopixel_write, hid, midi and more) It does work with the bme280 sensor and should be OK with most I2C devices. Let me know if you want to try it and I can post a .uf2 file here. It's also fine if you prefer to wait for something more final ... this version will most likely not be released.

#

adafruit_rfm9x and adafruit_busdevice are "frozen" into the build so they should not be loaded onto the file system

manic glacierBOT
#

I am working on trying to update the ProgressBar library to make use of vectorio to hopefully save some memory, but I've run into some strange behavior that do not understand. I've narrowed it down to this self contained example:

import board
import displayio
from vectorio import Polygon, VectorShape
import time

class Progress(displayio.Group):
    def __init__(self, x=0, y=60):
        self._width = 100
        self._height = 30
        self._x = x
        self._y = y...
lone axle
#

@low sentinel I found some strange behavior with Polygons ⬆️ I'm not really certain if this is an issue inside of vectorio or something larger within Circuit Python. If you have a second to take a look some time I am curious if anything jumps out to you as immediately problematic about the way I've attempted to use Polygons in the example from that issue.

manic glacierBOT
#

With the following vectorio Polygon example code:

import board
import displayio
from vectorio import Polygon, VectorShape
import time

# Make the display context
splash = displayio.Group(max_size=10)
board.DISPLAY.show(splash)

rect = Polygon(points=[(0,0), (100,0), (100, 30), (0,30)])
rect_palette = displayio.Palette(2)
rect_palette.make_transparent(0)
rect_palette[1] = 0xFF0000
vector_shape = VectorShape(shape=rect, x=1, y=1, pixel_shader=rect_palette)
splash.appen...
manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
thorny jay
#

Now what I need is a format and place to store the list of file/folder needed. Maybe some json file per project that I would read from.

wooden nest
#

Cool snippet!

#

Have you tried using pathlib before? It makes path handling much easier

thorny jay
#

Thanks, did not knew about pathlib. I'll have a look.

wooden nest
#

Hello, world!

If you are bored, have a PyGamer/PyBadge (Both types should work)/EdgeBadge, and have CircuitPython (recent version) loaded on it, you can try out my program.

It's a text editor.

Make sure that you have a text file on the FS called text.txt (It should have some text on it so that you can write to it - I think)

Also make sure that you can someone enable write access to the FS from CircuitPython (I use this program - press any key within 2 seconds and the FS will be writeable from CircuitPython)

boot.py

import storage
import time
import ugame

print("Press any key to enable writing to the file system from CircuitPython!")

time.sleep(2)

buttons_pressed = ugame.buttons.get_pressed()

if buttons_pressed:
    storage.remount("/", False)
    print("File system is now >>>writeable<<< from CircuitPython (Exposed drive is read only now)!")
else:
    print("File system is now >>>read-only<<< from CircuitPython (Exposed drive has write access)!")

time.sleep(1)

And here's the text editor, put it in code.py:

#

(Sorry, I have to put it in a file. There is over 6.6K characters in it!)
Alternativly, heres a link: http://txt.do/1geg3

You should not need to install any modules in lib.

It's kinda similar to nano, where you have a block cursor, and move around with the d-pad/joystick if you are in read mode. Press B if you are in write mode to go to read mode. To go to write mode, press A. You will see at the bottom, you can use the up/down buttons/joystick to select a character. Press A (in write mode) to write that character. You can still move left/right in both modes. (It's a little glitchy) Press Start for a newline and Select for backspace. You will need some practice if you want to achieve 1WPM ;)

I'd appreciate any feedback! (I hope this is the correct channel to post this in!)

manic glacierBOT
low sentinel
#

@lone axle if you can produce a more focused repro example for the other issue that would be ideal. I'm setting up my development environment for circuitpython core again.

lone axle
#

Okay thank you. I will see how far break down the other

low sentinel
#

I can't believe I did vectorio entirely in vim. VS Code + WSL2 is the only way to develop on windows. (i have to have windows because of my day job)

lone axle
#

The thought of using only vim for something like this makes me dizzy πŸ₯΄

#

I stick to Mu and PyCharm mostly. "One of these days" I intend to try to replicate some of the neat tools that have been made for VSCode over to Pycharm.

#

I do think that on the other issue I am conflating a few things together. I'm going to close that and I think I can make a much more focused one shortly on at least one of the actual things that was the root of my trouble.

manic glacierBOT
#

After adding a VectorShape to a displayio.Group changing the groups x and y positions does not move the VectorShape.

In this example we make a vectorio.Polygon and VectorShape both using 0,0 for x/y position. The VectorShape is added to a group that has it's x/y position set to 50,50 but the VectorShape is still drawn in the top left corner at 0,0

import board
import displayio
from vectorio import Polygon, VectorShape
from adafruit_display_shapes.rect import Re...
lone axle
low sentinel
#

it depends on the shape actually.

#

a polygon's axis is at (0, 0), which lets you get really creative with positioning and orientation.

lone axle
#

Ah, Circle is probably in the center then? I haven't played with that one as much yet.

low sentinel
#

A circle's x/y position is its center yes

#
>>> from vectorio import Polygon
>>> rect = Polygon(points=[(0,0), (100,0), (100, 30), (0,30)])
20002f00 polygon_construct
polygon_points_list len: 4
>>> rect.points
20002f00 vectorio_polygon_obj_get_points:  len: 1393, items: 571

this is a cool bug.

#

i'm embarrassed to have missed it tbh.

manic glacierBOT
low sentinel
#
#define c(f) compile_##f

πŸ’”

manic glacierBOT
manic glacierBOT
#

I downloaded the "absolute newest" build for the PyPortal recently and today I noticed with this build flashed on my device if I connect to the device via serial the connection will freeze within a few seconds. In Mu this makes the app not respond. In Putty it stops sending and receiving any messages but can still be closed just fine.

This is the link to the firmware: https://adafruit-circuit-python.s3.amazonaws.com/bin/pyportal/en_US/adafruit-circuitpython-pyportal-en_US-20200717-9cdf5e1...

#

Whatever the issue with my PyPortal serial connection is I don't think it's related to this. I replicated that with another recent build strait from the S3 site that did not include anything to do with this.

I tested this fix with PyGamer, EdgeBadge, and CLUE by accessing the points property of a Polygon. In all of my tests this issue seems to be resolved all are printing the points list as expected and none crashed.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

It looks as though some of the anomalous timing was due to cache lines. Turning off cache made things a little more sensible.
I did test using the improved background that @jepler has developed, but it did not make any real difference.
The measured overhead of running RUN_BACKGROUND_TASKS is even less than I had previously thought ( I had to increase the Mhz resolution on my logic analyzer to get more accurate values). It looks like the overhead for the ~4 second run in the test script was...

manic glacierBOT
#

@dahanzimin You're right, on closer inspection they don't have direct support for a board using a F103. I had assumed they did because their drivers reference the F1 and account HAL differences for it. I'd have to dig around more to find out why they did that without any actual F1 boards on their support list.

If you or anyone else is interested in setting this up, this would be the general Todo List based on what it took to add the F7 and H7.

  • [ ] Create a family category i...
manic glacierBOT
#

Odd, the only changes from 9cdf5e1 to 8f92834 are to pewpew_m4. 9cdf5e1 is the merge of the background-callback stuff.

I loaded 9cdf5e1 on my pyportal and ran a script at the REPL to print:

Adafruit CircuitPython 6.0.0-alpha.1-108-g9cdf5e148 on 2020-07-17; Adafruit PyPortal with samd51j20
>>> while True: print("hi ", time.time()) or time.sleep(.2)
hi  946684984
hi  946684985
hi  946684985
...

It ran for at least 30 seconds before I stopped it.

Please feel free to re-op...

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

53

Voice Channels

6

Members

22444

Roles

32

manic glacierBOT
#

While investigating #3173 I found that the display would usually stop auto-refreshing after soft reset. This stemmed from not correctly clearing the state of tasks that were queued at that moment. In theory, it could have caused #3173 as well depending on the order in which multiple background callbacks were added, and not happen consistently.

This also fixes a potential problem with framebufferio auto refresh over soft reset, by making the code match displayio.

Testing performed: sof...

onyx hinge
#

@lone axle thanks for setting me on the trail of this, I did find a problem that would have vexed a lot of users as a result of investigating it

lone axle
#

! happy to catch it, I figured somehow my PyPortal had gotten weird. It also started doing the "Find and Fix Errors on this drive" pop-up in windows recently.

#

FWIW I was noticing the freezes happening when I went to REPL. I would spam ctrl-C several times and would get about 3 or 4 instances of >>> before it became unresponsive.

lone axle
#

Is there a relatively easy way via git magic to bring in some remote changes from a different repo in order to make a build of Circuit Python, but do it inside of my existing workspace that already has submodules sync'd and updated etc...?

#

or is it best to just clone the whole new one and start fresh with everything in it?

stuck elbow
#

@lone axle check out the cherry-pick command

lone axle
#

Will do thank you!

manic glacierBOT
#

@DavePutz Thanks for the more thorough testing. To expand,on this, I suggested disabling the I/D cache in case the odd results were due to crossing a cache line or something like that.

I'm thinking that the reason that multiplication makes a difference, but not division, is because the issue is really repeated multiplication due to the ** operator being atomic. If I understand correctly, the test program is exponentiation, not explicit repeated multiplication. The background tasks will g...

#

I'm fine with merging this now, as a board-specific special-purpose module. It would be great if you could do a more general PR later. Some notes:

  • The current always-double-read in AnalogIn is because we don't know whether the state of the ADC has changed since the last read. It could have been used with different settings (e.g., to read CPU voltage or temperature). There could be a flag to keep track of that.

  • It's great to drop use of ASF4 when it's easy to do s. I think a future...

#

Could you post the exact version of 5.x you are using? Most stack issues on the STM32 have been caused by an issue fixed in #2866, which was included in the 5.4 release. Can you confirm you are using 5.4 or higher?

Absolutely! Here's what I'm running:

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.3.1 on 2020-07-13; Feather STM32F405 Express with STM32F405RG
drowsy geyser
#

@ionic elk I closed the issue about the heap error when using Airlift on the STM32. 5.4.0-beta.1 fixed it. Should I be going to 6-alpha yet?

manic glacierBOT
#

@dahanzimin The two scripts in the tools directory do the following:

  • parse_af_csv.py: This script generates boilerplate to fill the periph.c and pins.c files, based off a .csv file created from the "alternate function mapping" table of the chip datasheet. Many of these .csv files have been created already by micropython, and you can see an example of the format in the stm32f767_af.csv file. Use the syntax python parse_af_csf.py Filename.csv -pins-only to generate the pin tables, a...
slender iron
#

@slender iron It's used for bitmaps right? I think it might could be collapsed together? vectorio is better than Shape for most cases, and for simple shapes like rectangle and circle it is basically as fast as a bitmap; but for things like the adafruit_display_shapes library there is some tradeoff to consider between O(n*m) memory and computing pixel winding numbers (for polygons). But vectorio is not available everywhere displayio is on account of small controllers' memory running out.

Tangentially related, I had thought about reimplementing RoundRect as 4 circles and 2 rectangles. Due to the draw masking that displayio does, I think it would be almost indistinguishable speed-wise from the bitmap and require O(1) memory for any sized RoundRect.
@low sentinel I think the shape library just uses bitmap and never displayio.shape. displayio.shape is weird because it's two values per pixel row plus mirroring

manic glacierBOT
slender iron
#

@ionic elk I closed the issue about the heap error when using Airlift on the STM32. 5.4.0-beta.1 fixed it. Should I be going to 6-alpha yet?
@drowsy geyser Ya, use the alpha. It's only alpha so we can break APIs. It should be stable

#

we'll pretty quick through beta to rc

onyx hinge
#

I hope so! The background task list stuff could sure use some testing. foamyguy ran into an issue and it was super helpful to have his feedback.

#

@slender iron do we need to talk about whether the next release is alpha or beta In The Weeds?

#

or if you think "alpha" then I don't have anything to talk about πŸ™‚

slender iron
#

Β―_(ツ)_/Β―

#

I don't usually take it too seriously

#

I'd say alpha if we think APIs will change

tulip sleet
#

alpha usually means feature-incompelte

slender iron
#

beta otherwise

tulip sleet
#

what scott said

onyx hinge
#

Fair enough, I'm convinced

slender iron
#

(I could go straight to rc if you are confident about background stuff)

onyx hinge
#

haha no

slender iron
#

kk πŸ™‚

#

let's plan on doing a release of some sort this week

#

so it can soak in an unstable release

manic glacierBOT
#

Whatever the issue with my PyPortal serial connection is I don't think it's related to this. I replicated that with another recent build strait from the S3 site that did not include anything to do with this.

I tested this fix with PyGamer, EdgeBadge, and CLUE by accessing the points property of a Polygon. In all of my tests this issue seems to be resolved all are printing the points list as expected and none crashed.

onyx hinge
#

@slender iron if you want to 3-2-1 me for meeting recording that would be nice

modern wing
#

Good afternoon all you wonderful CircuitPythonistas -- happily lurking for today's meeting. The doc has been updated to reflect that.

lapis hemlock
#

I am also lurking today.

turbid radish
#

Lurking but here

onyx hinge
#

<@&356864093652516868> We're coming up on the meeting in just a few minutes. If you will be "lurking", please let us know. If you can add your info to the notes doc that's super helpful

idle owl
onyx hinge
#

brb

solar whale
#

Is there a known issue with using the SD card (or SDCardio) driver on the STM32f405 -- it's come ups a few times in discussion but I don't see an issue for it. SHould I recheck and open one?

onyx hinge
#

thanks kattni

#

@solar whale yeah it's not an SPI SD card

solar whale
#

no not the built in -- I mean a breakout

onyx hinge
#

a wild Mr. Certainly speaks

#

then no, there's no issue because it should just work πŸ™‚

solar whale
#

OK -- last I tried, it did not. will retry and open if reproducible.

onyx hinge
#

Thank you!

idle owl
#

@timber mango Are you lurking (listening in) today?

onyx hinge
#

I haven't tried it myself but I have some adaloggers so I should

solar whale
#

It was an adalogger I tried. And a breakout IIRC.

onyx hinge
errant grail
#

Just listening today.

onyx hinge
#

a separate computer for each USB device

stuck elbow
#

ze cloud

ivory yew
#

"screaming" button

onyx hinge
#

yes

#

mic's messed though πŸ™‚

ivory yew
#

πŸ˜‚ "beep, boop"

old smelt
#

Lurking

tidal kiln
#

lurking

thorny jay
#

Not even lurking... I don't get any sound from Discord... trying another computer. πŸ™‚

inland tusk
#

@thorny jay understood

solar whale
#

@onyx hinge yup -reproduced -- keeps reporting"no SD Card" -- I'll open an issue later today.

onyx hinge
#

With @adafruit's #CLUE, #CircuitPython and @eradionica's #WiFibit it's simple to fetch data from the Internet and show it on screen. Here's commented code for this example: https://t.co/cDwpFynang. It can easily be reused for other CLUE and @ESP8266 combinations.

#byPlusPlus...

#
gilded cradle
#

πŸ‘‹

onyx hinge
modern wing
#

That sign is so cool πŸ™‚

gilded cradle
#

Thanks

onyx hinge
manic glacierBOT
onyx hinge
#

circuitpythonday@adafruit.com

idle owl
#

You can host events locally, do projects, all kinds of things!

turbid radish
#

Send a tweet to @anne_engineer for Python/CircuitPython tips and projects or email anneb@adafruit.com

onyx hinge
prime flower
#

new mic, new issues

#

😦

uncut nexus
#

not lurkng today πŸ™‚

slender iron
#

kk

manic glacierBOT
#

related to
https://github.com/adafruit/Adafruit_CircuitPython_SD/issues/36

I know the "on-board" SDcard is not support on the feather STM32F405.
I tried attaching an Adalloger Featherwing using sdcardio and it is not able to detect the card
The also happens with the Adafruit_CircuitPython_SD library
see
https://github.com/adafruit/Adafruit_CircuitPython_SD/issues/36

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-111-g8f928340c on ...
thorny jay
#

Yes I do.

gilded cradle
#

Just a tiny bit

ionic elk
#

un petit peu

onyx hinge
#

I don't know the french for "meeting". rendez-vous is probably not right.

blissful pollen
#

I remember just a little from school, kinda funny what does come back at times

ionic elk
#

c'est la rencontre

inland tusk
#

lurking for updates

thorny jay
#

"rΓ©union"

prime flower
#

oo yeah - bonus hug report to @lone axle for tackling a progressbar issue

old smelt
#

πŸ’― <- for Scott, not for me...

onyx hinge
#

(and I know I'm forgetting another name who has helped with text for displayio .. curses)

lone axle
#

kmatch98

onyx hinge
#

belated hug to kmatch98

tidal kiln
#

@solar whale thank YOU for all your help in the various outlets. it is much appreciated.

inland tusk
#

@gilded cradle can you supply the URL for the guide on your large sign

ivory yew
#

oooo that sounds awesome

gilded cradle
#

@inland tusk, I don't have an Adafruit guide, but you can check the documentation at https://opensign.readthedocs.io/en/latest/ and view the video at https://youtu.be/WP-MhQo5OLw.

This video is Part 2 of My Custom Animated RGB LED Scrolling Message Sign Series and it covers the complete software setup of the sign including how to get your Python script running upon starting the sign.

Links


OpenSign Installation Instructions...

β–Ά Play video
prime flower
#

lets see if mic works

#

dang!

#

@ionic elk I now understand your frustration a few weeks ago

uncut nexus
#

here

slender iron
#

kk

onyx hinge
#

(sorry, I should have added Dave P to the notes:)

slender iron
#

np

onyx hinge
#

very nice

mental nexus
ivory yew
#

dat click lime

tidal kiln
#

i'm still "gitting" πŸ™‚ used to that new UI

onyx hinge
#

I need to step away so I'll miss In the Weeds. I'll lurk so the backup recording can complete.

slender iron
#

kk

thorny jay
#

I have seen a 7 color eInk display... but costing a lot!

errant grail
#

@ivory yew Excellent blog posting!

ivory yew
#

ty!

low sentinel
#

(done with my day job Monday meeting, lurking now in the chat)

ivory yew
#

that blog post is one of the longest and definitely involved more math and javascript than any other mood

low sentinel
#

oh cool thanks! β™₯️

tidal kiln
#

? πŸ‘‚

#

sry. turned away.

slender iron
tidal kiln
#

sounds like wanting to update that page?

slender iron
#

yup

tidal kiln
#

ok, what kattni said then. πŸ™‚

gilded cradle
tidal kiln
#

(and thanks for updating)

inland tusk
#

@gilded cradle thanks

thorny jay
#

that blog post is one of the longest and definitely involved more math and javascript than any other :mood:
@ivory yew Yes that was too much for me. But I found your other blog post "Lessons learned from building a custom CircuitPython board" and that was the kind of thing I like.

inland tusk
#

thats a package instead of a module

ivory yew
#

@thorny jay if you have any specific areas that were too much I'd love to know- I always want my posts to be pretty approachable.

gilded cradle
#

PulseIn?

tidal kiln
#

@lone axle you can ping me if you have a question about that displayio guide page, but in general, feel free to update it as you want. it hasn't been updated in a long time (if ever).

gilded cradle
#

I've used PulseIn on the Grand Central.

idle owl
#

@lone axle Do you know if kmatch98 is in the Learn system? e.g. have they written a guide?

gilded cradle
#

Ah, ok

lone axle
#

Thank you Cater.

thorny jay
#

@ivory yew Maybe it was the math, or ADC is not my thing, or it was not the right time to try to understand that (I had the link parked to read it since I saw that on Twitter). I may need to rewatch https://www.youtube.com/watch?v=UAJMLTzrM9Q to better understand ADC, and then read your thing.

I often get questions about how to measure voltage with microcontrollers. We will look at this topic, at the quality of built-in and external Analog-to-digital converters, and I will show you some β€œsecrets.”
In this video, we will:

  • See how ADCs work
  • Look at how we can dete...
β–Ά Play video
lone axle
#

@idle owl I don't think so, but I am not sure to be honest.

idle owl
#

@lone axle No worries. Include them in the email you send me, when you get around to it, and we'll find out.

lone axle
#

Will do.

ivory yew
#

@thorny jay cool, well, if you do come back to it all feedback is welcome. πŸ™‚

crimson ferry
#

Could we auto-generate more than one build per unique board? We'd probably want to keep this to a minimum (if at all) to avoid confusion, but it could help with distinctly different use cases for resource-limited hardware.

lone axle
#

Pie in the sky idea: maybe there could be a build server with a front end interface that gives you a nice clean way to select which modules you want to include and it will create a build on the fly.

#

that could lower the barrier to entry for customizing builds based on indivudual project needs.

crimson ferry
#

@lone axle that sounds awesome

ivory yew
#

that's an awesome pie in the sky idea

ionic elk
#

The default right now is basically just that we have a default but if you want more build options you have to clone and custom build, right?

thorny jay
#

Well, I wanted to see if I could put ps2io back into M0.

ionic elk
#

So this is basically an interface for adjusting build flags online?

lone axle
#

yep

ionic elk
#

That'd be pretty neat for STM32 boards, we have a lot of flags like that which impact flash size

lone axle
#

check boxes or side by side lists or something like that. Just choose which ones to include or exclude.

ivory yew
#

Not build flags as much as the board makefile, right?

ionic elk
#

Whether or not you want a bootloader, etc

ivory yew
#

or I guess you can pass those in through make arguments.

thorny jay
#

I can now compile CircuitPython on my Pi4 "server" so maybe I should just give it a try.

lone axle
#

(my terminology about flags vs. board make files etc. is probably off. I don't have much actual experience with custom builds yet)

ionic elk
#

I mean like setting environmental variables or whatever as you build that get processed in the makefile. My vocab might be bad

#

I'm not amazing at makefile terms

onyx hinge
#

(I'm back)

ivory yew
#

I know just enough make to be dangerous

ionic elk
#

I say things and people understand what I mean so I learn it's ok and then never change

#

😐

ivory yew
#

ninja builds when @slender iron πŸ˜›

ionic elk
#

πŸ‘€ βš”οΈ

onyx hinge
#

I have some code which helped generate uf2s that update just the filesystem area with new content. doesn't work on express boards of course.

ivory yew
#

oh that's cool

stuck elbow
#

@onyx hinge is it published anywhere?

low sentinel
#

@slender iron I can hop in voice if you want to talk async however I suspect we've already reached an understanding on what you expect; and I'm still unsure the upsides of the changes are worth furthering the divergence from micropython - so it's probably not something I'll try to do in the immediate future.
I tried to increase async compatibility with cpython and found mpy/py compilation differences that seem surprising so I aborted it for now.

onyx hinge
#

@stuck elbow I don't think so, if you're interested I'll try to dig it up.

stuck elbow
#

that would be great, thank you!

slender iron
#

@low sentinel sure!

#

happy to make sure we're on the same page

onyx hinge
#

ah I overestimated how far I got in the project πŸ™‚ It creates a FAT filesystem image but doesn't convert it to uf2. https://github.com/jepler/mkfatimg

stuck elbow
#

thanks, I think I can go from there

onyx hinge
#
        ./mkfatimg .o/img.bin IMAGE 512 --circuitpython=boot.py
``` it's a commandline program, works something like this.
#

@uncut nexus we have some examples of calculation speed in the ulab learn guide

uncut nexus
#

ok, thanks!

idle owl
#

@onyx hinge I have feedback on the addition of translations to the Contributing page. Actually.... I'll probably make a PR and tag you instead.

onyx hinge
#

@idle owl that is awesome of you, thanks

manic glacierBOT
#

@dahanzimin

typedef struct {
    uint8_t periph_index:4;     // Index of the peripheral instance
    uint8_t altfn_index:4;      // Index of the altfn for this pin (0 to 15)
    const mcu_pin_obj_t * pin;  // Pin Object
} mcu_periph_obj_t;

periph_ Index and alt_ What exactly does index mean? I didn't see the note at the end。

Periph index is the number of the peripheral. On the STM32F405, this is the number after the I2C Instance - I2C1 is index 1, I2C...

stuck elbow
#

there are versions of python 3 that would run that code

manic glacierBOT
#

You can see for the F405 this is the altfunction table:
<img width="879" alt="Screen Shot 2020-07-20 at 3 37 12 PM" src="https://user-images.githubusercontent.com/5904176/87978711-e3941e00-ca9e-11ea-9c71-ee725f0bfb33.png">

For F4 chips, each pin has many different functions so you select the one you want to use with this "altfunction index". But on the F1, the functionality of each pin is more limited, so I think the strategy is just to assume the other peripherals for that pin are not tu...

stuck elbow
#

the errors were added later on

thorny jay
#

Contrary to micropython... there is no "unix" version of CircuitPython? Or only for testing?

tulip sleet
#

right, there's no unix CircuitPython. It hasn't been worth doing.

onyx hinge
#

In a slightly alternate version of history we might have gotten that instead of blinka

#

I think we're in the better timeline

ionic elk
#

Will we get the dynamic C modules if we merge in Micropython?

onyx hinge
#

in that respect

ionic elk
#

because that would be spicy

thorny jay
#

Is this the longest meeting we have had?

ionic elk
#

Big in the weeds, 45m

thorny jay
#

I don't complain. I love when it goes over my head (like a joke you don't understand).

ivory yew
ionic elk
#

I think it's still probably worth thinking about breaking in the weeds into a separate meeting

thorny jay
#

Everybody is free to exit.

ionic elk
#

Sure, but it means the in the weeds comes at the end of a long meeting

#

good point

modern wing
#

Thanks for a good meeting everyone!

onyx hinge
#

circuitpythonday@adafruit.com

gilded cradle
#

Bye, thanks

tiny oriole
#

i suspect Discord tries to do a bit of its own echo suppression as well

modern wing
#

The more the merrier πŸ™‚

#

I was just paranoid, seeing the indicator light up -- thinking "oh no, am I causing a stadium effect?"

idle owl
#

@modern wing Understandable and worth checking.

solar whale
#

Have a good week --- dog walk time πŸ‘‹

idle owl
#

My mic goes through an audio interface and it picks up EVERYTHING, but not enough to be caught on the other end of the most part. But still I get concerned.

slender iron
#

@onyx hinge how much of the video work flow do you want to do?

idle owl
#

I can see the green light blinking along to the background noise πŸ˜„

tulip sleet
#

@low sentinel if you have time to talk more async stuff, i would be happy to now. I am interested in your use cases.

onyx hinge
#

I have a 1:46:09 mkv file that I'm uploading to youtube now (my personal account) .. I know it has some "mistakes" in it, accidentally switching discord servers via hotkey, and of course I was typing in it and such. URL will be https://www.youtube.com/watch?v=EgYYntCzSOc but I assume there's no reason to use it

slender iron
#

kk

modern wing
#

@idle owl If I'm using my USB mic (AT2020usb), it picks up the speakers so easily -- no choice but to use headphones.

If I use the built-in mic, the macbook does a fair amount of cancellation from what I've seen -- the laptop mic was about a foot away from my speakers a few moments ago.

And this new MBP has some stellar mic technology, almost as good as my external (from early tests I've been doing).

onyx hinge
#

so if you and/or kattni take a look at it and tell me what I did wrong that's great; if it's okay, I'd think doing one where I record and the emcee does the backup recording would be a good next step. Once I've also done a video then maybe I can do the whole thing

idle owl
#

@modern wing My AT4040 is carefully positioned, though I only have my MBP speakers or the speakers built into the display (ew), and I haven't tried them with the mic. I have tried the bluetooth speakers on my partner's desk which is 4 feet to the right, and it worked fine without feedback afaik, but it's not convenient (did it when we were both on show and tell - have a headphone splitter in the monitor now for future use in that scenario).

#

@onyx hinge Switching servers, maybe try to avoid that πŸ˜„ But typing into it, not a big deal. I'm sure the video is fine.

slender iron
#

ya, I'm sure it's fine too. the one thing that I'm unhappy with is when I only get my audio and not obs

onyx hinge
#

my audio & scott's (discord's) audio are both good in the recording. hooray

idle owl
#

Then you're 98% there.

onyx hinge
#

do you ever get used to that "hearing yourself" thing?!

mental nexus
#

@idle owl sorry I had to disappear halfway through the meeting today. I have never done anything with learn guides. I’ll listen to the call and then connect with foamyguy to define next steps for display_text.

idle owl
#

@onyx hinge I am told you do. I have not.

low sentinel
#

@low sentinel if you have time to talk more async stuff, i would be happy to now. I am interested in your use cases.
@tulip sleet sure, you want a DM or do you want to hop in a voice channel?

tulip sleet
#

how about Amelia Earhart?

modern wing
#

@onyx hinge I'm self-conscious of it. Folks say it's fine, but I go, "Wait, I sound like...that?"

onyx hinge
#

I mean, I sound fine but at the same time I sound like somebody else

idle owl
#

@mental nexus Perfect! I simply wanted to know whether you were in the system already. Depending on how involved you'd like to be with the update, we can get you added and show you the ropes of the system. Foamyguy has done a guide and such so he'll be of a lot of assistance there.

#

@onyx hinge Imagine doing the newsletter video. I have to listen to myself repeatedly.

mental nexus
#

Ok sounds cool. I’ll talk with him and figure how we divvy up the work. Will let you know if I need access there.

onyx hinge
#

@idle owl yeah ....

modern wing
#

@idle owl I was wondering, do you do that in one or several long-ish takes, or do you do cuts for each line item then splice them together in an audio editor?

idle owl
#

@modern wing Oh noes, you want to know my sekrets! πŸ˜„

modern wing
#

Hahaha, guilty as charged πŸ˜›

idle owl
#

@modern wing It's one long take, and then I cut out the borks, breaks and silences in Premiere while adding the image/video assets.

modern wing
#

That's impressive. Doing that much effort, week after week, especially with such a short turnaround time is pretty amazing.

idle owl
#

Still takes me all day Tuesday. It gets shipped around 8:30-9pm pretty consistently, no matter how hard I try.

onyx hinge
#

you can twitch-stream the next recording, your audience will love it. see the human side of the circuitpython weekly video.

#

the f-bombs and raspberries just bring you and your audience closer

idle owl
#

Except for the marking it as "for mature audiences" part, because the fourth time I screw something up... yeah that.

ivory yew
#

I'm frankly astonished that I haven't said bad words during the meeting yet

modern wing
#

And when a loud muffler car drives past your place, you jump out of your chair screaming: "Oh for cryin' out loud, do you need to do that four times in an HOUR?!"

idle owl
#

@ivory yew It'll happen. πŸ˜„

#

@modern wing Or the fire alarm goes off.... etc etc.

#

Apartment building, so it's one alarm system. Some idiot microwaves a potato in foil, and we're all subjected to it until the fire dept shows up to verify and shut it off.

#

(There may be a couple of layers of gaffers tape over the speaker. MAY BE.)

ivory yew
#

my building has independent alarm systems

modern wing
#

We know nothing, we hear nothing πŸ™‚