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
#circuitpython-dev
1 messages Β· Page 316 of 1
maybe the code to get the serial number is simply not functioning as expected, like @main meteor says
I don't want to try it on my Linux box because it usually kills it...
oh ... ```void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
}
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']
ruh roh...
''.join('%x' % x for x in microcontroller.cpu.uid) btw.
hey, found even shorter way: ('{:x}' * 15).format(*microcontroller.cpu.uid)
I like the first one, different CPUs have different lengths
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'
@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?
@silver tapir elecrow
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.
Oh that would be very nice, thank you.
do you want it flashed, with just bootloader, or empty?
I guess you can always erase the chip
Yes, whatever is simpler for you.
@slender iron You updated the bundles, but not circuitpython.org. I'll submit a PR today.
@solar whale @onyx hinge The serial number code is different for different chips. Maybe it is just wrong for ESP32S2 (wrong address or length).
@tulip sleet - do you have a couple of minutes to chat?
I just tried it myself, and I have the same issue β power cycling, with USB cable inserted or not, makes no difference.
@idle owl thanks! I looked on the downloads page but didnβt look elsewhere.
@slender iron Looks like this at the moment π
Oh yeah, py bundle. That is useful.
Oops! Now I know
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...
@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
@onyx hinge just means you are ready to help on it π
On the subject of radio networking, I've just stumbled across this very interesting book on the BBC micro:bit: https://microbit.nominetresearch.uk/networking-book-online/
@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.
I think this is ready for testing and review. I have tested SAM D51, nRF52840, esp32s2, stm32f405 all at various points during this process and I'm no longer aware of any regressions.
@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
True! I'll dig around and see if I have a junk cable I could use for that.
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 π§
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)
yeah that probably won't work, I'd start with one that is known good for data
They ought to have a mandatory marking for power only cables
so much irritation in my early debugging days
A tiny dunce cap attached with a zip tie
lunchtime! π
π
Note #2087, about backwards order of the UID.
I'll have to load it up again and see what the deal is, in that case. Haven't tried the Meowbit in a while, there may have been a regression.
@onyx hinge when you get back, if you have a sec, could you check out https://github.com/adafruit/Adafruit_Protomatter/pull/14 and see if it looks ready to you? When submitted it'll allow my timer PR to pass CI.
@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.
@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.
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:
@lone axle @silver tapir Actions is having issues right now
Welcome to GitHub's home for real-time and historical data on system performance.
@ionic elk done
Oh, thank you. That is encouraging. Earlier it seemed they were having issues but the status page was still green.
@slender iron https://circuitpython.org/libraries
@onyx hinge does only PaintYourDragon have merge permissions?
Thanks for taking a look
yup; or at any rate, I don't.
@onyx hinge @ionic elk I do... Is it good to go?
I didn't run the code but I read it and it looks fine. so assuming @ionic elk has run it π
Or does it make sense to leave it for Dragon?
I mean it'll only run once the timer code is in, and that hasn't been approved yet.
I don't know them well enough to anticipate if it will feel like stepping on toes or stepping up
I'm not sure what your preference is for this kind of thing
@ionic elk Hmm. Does the timer code rely on anything?
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
Typically we wait to merge things dependent on other things until the other thing is in.
this is the part that needs to go first
The timer code relies on this protomatter code to compile, because otherwise it has conflicts in the IRQ definitions
Ah!
but at the same time, this protomatter code won't work until the timer code is reviewed and merged
it's the submodule, and it needs this change before circuitpython can be improved
Then if you're both happy with it, I'll merge it.
thank you
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?
Jeff would know, I have no idea.
you mean for yourself locally or for the github CI?
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?
let me ask you a different question .. in your pull request https://github.com/adafruit/circuitpython/pull/3099/files did you actually add and push the submodule change?
I just don't want to break protomatter if the timer code runs into some other issue and needs further fixes
(is that the right pr?)
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
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 π
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
You will always have my sympathy when it is submodules or merge conflicts that confound you
ok awesome I'll just do that then
Submodules are jerks at times.
And we shouldn't submit it until both of them are ready
you just commit the submodule ref the same way you would if it was merged somewhere else already
nice, ok, learned a new thing today. That's handy
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.
Ok, I replied on those two. They got lost because this PR is huge. Please make many smaller PRs next time. Thanks!
@idle owl tell us how you really feel...;-)
@idle owl that's a pretty @vapid mango thing to say
I'm gonna step away for a bit thanks @idle owl @ionic elk and if it doesn't work out do @ me
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.
@tannewt if you open up all the hidden conversations, beyond the two screenshots, you'll see more that have to do with displayio types.
There doesn't seem to be a way to link to conversations.
@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.
Ok thanks.
reason is that all devices on the bus need to agree
Wasn't sure if I was missing something.
Fair enough.
GitHub
Despite being a kwarg within the constructor (https://circuitpython.readthedocs.io/en/4.x/shared-bindings/busio/I2C.html#busio.I2C), Frequency is not a set-able property. Would it be possible to se...
@tulip sleet Hah! Fair enough.
I feel like my life is sometimes "There's an issue for that!"
I'd be annoyed about that memory sector being dedicated to issues that could be being used for something else. π
"you've got issues" turned out to be a bad slogan for bug tracking software
Expected behavior: The line of code calculates the number 1
I think you meant calculates the number 0?
Thanks @dunkmann00 I updated the initial comment
@gilded cradle You have a BNO055, correct? There's an open PR on it that you might be able to test if you have the cycles. https://github.com/adafruit/Adafruit_CircuitPython_BNO055/pull/51 If not, no worries.
Yes @idle owl, I do have one. I might have the cycles tomorrow for that.
@gilded cradle That would be perfect. Thanks!
@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 ?
@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.
Breathe easy, knowing that you can track and sense the quality of the air around you with the PM2.5Β Air Quality Sensor with Breadboard Adapter particulate sensor. Mad Max & Furiosa ...
Yes, that's up next for updates. And what I plan to use to test your code.
I am perhaps wrong. I thought you submitted a PR to update the example code?
Yes, it was you π - I checked. Anyway, I'll be testing it in the next couple of days and merging it once done.
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.
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.
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.
Ah, fair enough.
So I think I need to embed some of the logic to find the next packet into the library.
Sounds like an ideal thing to add
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.
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.
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.
Sounds good! Have a lovely sleep!
@lone axle Do the checks on the pr look ok to you now? Githubstatus says it's all ok.
Will take a look in one minute.
@silver tapir I still am seeing 0 checks on my end:
I think if you push another small change to something it may do them correctly now though that the status is looking better.
That is were it used to show the error, I think.
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"
And toward the bottom of the PR page it should have this thing:
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.
Nice looks good now. I will test it out tonight
@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)
k, great!
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.
Adding a +1 request for a library since I just bought one of these the other day. I'd at least like to read IR values off it.
This PR is to add a new platform called Tinkeringtech ScoutMakes Azul, which is a nRF52840 based platform to CircuitPython.
Thanks for this careful work. The nrf changes make sense to me. @jepler and I went over them in some detail.
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit Feather M4 Express with samd51j19
The VL53L0X does not appear to return from shutdown mode. When SHDN has been brought low, and then high, the next read of the sensor will hang. See wiring here:

Code is:
Documentation at:
...
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.
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
I cross posted that on #help-with-wippersnapper-and-adafruitio channel
Should we also move the csr.h in fomu too?
In tinyusb the litex port references just #include "csh.h". So would adding an -I flag to CFLAGS be a good option? Or should we be editing all the source files with #include "generated/csh.h"
On the Fomu, there was a register that let you set the CPU reset address.
So that if you trigger a CPU reset, the PC is reset to 0x40000000, this way the bootloader wouldn't run again.
The standard C startup code should be copying a fresh .data section across before calling main().
Yes, I think we can be checking if register definitions in the csr.h exist instead, that makes sense.
Please make many smaller PRs next time.
Will do.
@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
did you want to make a change in a submodule and then PR that?
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
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.
fatal: reference is not a tree: 4c8bed230392573a7104ebb11d77d8e895a71943
did you pull down the latest commits for protomatter into the submodule
with git fetch? yeah
I also moved to the master branch and pulled, still can't check out PR commits
When someone sends you a pull request from a fork or branch of your repository, you can merge it locally to resolve a merge conflict or to test and verify the changes before merging on GitHub.
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
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
I'll just use gh pr checkout ###
i didn't know about gh; i've been using hub
@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);
@ionic elk filing an issue at the protomatter repo is my recommendation
Ok, no problem. Wanted to make sure it wasn't something I had messed up
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
Yeah, no problem
@indigo wedge Are you still moving ahead with the iMXRT 1011 and/or 1062 projects, or have they been set aside?
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
Is the HID definition for braille display public? All I can find is: https://blogs.microsoft.com/on-the-issues/2018/05/31/technology-sector-collaborates-to-develop-hid-standard-for-braille-displays/
I think that would help us understand what needs to be supported.
@tulip sleet how quickly should I expect you to get back on PR reviews? aka, when can I bug you about it. re: https://github.com/adafruit/circuitpython/pull/3143
@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.
I pushed to that branch last night. I forgot I made a PR for it already
and ya, those commits did fail
@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?
I haven't made one for the allocations yet
it's all esp32spi and requests. not core cp
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
[adafruit/circuitpython-org] Pull request review submitted: #504 Drop 4\.x bundle, add 6\.x bundle\.
Thank you! Sorry I missed this.
This looks good! I did a little head-scratching over the arg passing until I saw it was deferred. Sorry for the delay.
Ok, I've added more comments. @dherrada please mention me on anything else that you need me to clarify. Thanks!
layer is same as append.
Ok, so we need .data to be preserved. All good!
Yes please move the Fomu copy too. You can add the -I for TinyUSB but I prefer generated/csr.h in CircuitPython because it's clearer.
@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
I thought it did use bitbanging on the Pi. Isn't that why it was added to the library?
it can use bitbanging, but if pulseio can be imported, it uses pulseio, and since pulseio is in blinka, it always uses it
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 π
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
No objection from me but I still wonder if there is something with the pulseio implementation that needs to be looked into.
Looks great! Thank you!
Thanks for the quick merge. @kattni guide is excellently written with clear instructions on adding a new board. https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
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.
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.)
@trim elm in regards to your original question, I think there IS an advantage to to using Pulseio, but only if it works...
@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.
you call call __exit__ explicitly
Ok
you might need to catch any exceptions it throws, but I think that might work
This is an awesome cleanup! Thank you!
I believe there is one case you don't handle that is probably very rare and maybe not an issue. It is the case where you queue up background work like filling an mp3 buffer but delete the mp3 object before you do the background work. Think that is an issue?
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
good -- better to fix the root cause than to implement a workaround!
@onyx hinge Jeff, in case you want to comment: https://github.com/v923z/micropython-ulab/issues/137
Once the code itself is accepted, I will add the stubs, so you won't have to trouble yourself with the documentation.
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.
@tannewt Thanks. I just made all of those requested changes that you clarified and tagged you on a few more that I'm still unsure about.
@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?
@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
Oh nevermind, it's because TIM6 maxes out at 42MHz
different timers have different capabilities?
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
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
I might need some kind of minimum frequency parameter in my timer setting system
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
@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.
@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
@trim elm I should be able to try it tomorrow.
Awesome. Thanks
@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.
@lone axle You working on any library code at the moment?
No, not at the moment.
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.
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.
@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.
Ah, I see.
I don't know what that is but I like it when you speed things up ποΈ
This comment guard is out of date
Outdated macro guard comment
Outdated guard macro comment
LiteX currently has no defined GPIO CSR interface. Fomu created one with the "Touch" block, but it's far from standard.
Perhaps the common-hal/digitalio/ needs a subdirectory for each platform's GPIO implementation to avoid #ifdef for each implemented platform.
@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.
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...
Could you post the code that raises this error?
Thanks for this careful work. The nrf changes make sense to me. @jepler and I went over them in some detail.
@tannewt thanks for reminding me about that case. By making the callback list a GC root, this should not be possible. Please re-review.
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...
I could not find where the returned timer is reserve()d or later free()d. Is there something keeping other code from taking the same timer?
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_numberthat it claims the pin- if so, maybe there's an overall code size savings if
claim_pincalls can be folded intonever_resetcalls.
- if so, maybe there's an overall code size savings if
- 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...
I did not find a matching stm_peripherals_timer_free in this file. Is the timer going to be freed when appropriate?
I think this was just something I didn't pay close enough attention to in the cases you've pointed out, since we never freed the single use timers. You're right of course, I'll double check all instances to make sure there's a proper reserve/free pair per file.
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.
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.
@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.
@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.
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.
Hmm fair enough.
One thing Scott did that I wondered whether it was automated: fixing pull requests so that they were to the new "main" branch
That one I think I know how to do, I think it's part of the instructions I have. But I'm uncertain.
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
I'll have to ping Scott then. I thought I had everything he did, but it sound like I don't.
He may have done it manally, the number of PRs is relatively small
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.
@idle owl I'm around now
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?
change the default branch in github settings
Right.
update all pending PRs to be against main and not master
Ah ok
I copied the branch protections from master to main
and set master to requiring 5+ approvals after we accidentally merged to it π
also need to check any CI stuff that may have a branch restriction
@slender iron Hmm do we have a lot of that?
not sure, lemme grep
@idle owl looks like readme.rst has a link to the CoC in master
np, just grepped the bundle for master
That's good, didn't think there would be an issue, but good to check.
π
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...
@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
I don't keep my main branch of my fork updated
Jeff doesn't either. You're no help! π
Yeah that's what all my research said
Or rather, indicated. Nothing said it explicitly.
people do need to know to start from main rather than master
otherwise they may need to rebase
The guide is being updated. But that doesn't mean people will read it.
Oh and to type β, on a Windows computer, pressing ALT and 178 (177 for β and 176 for β) and releasing ALT should type it. Typing it in code.py with Mu shows the character correctly but in the serial console (on Mu), it shows up as Γ’ΒΒ
yup
we could delete the master branch which should cause an error if they try and update it
but I left it for core
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.
I'm fine trying it
only one way to find out how it'll work π
we can always add it back
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.
haha, ya π
Alert message will only show for chrome and includes a link to disabling protection in safe browsing.
@slender iron Did you run this? git symbolic-ref refs/remotes/adafruit/HEAD refs/remotes/adafruit/main
I didn't
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.
ah hrm
It's for updating your "local clones".
it must not be part of my workflow
I'll have Dylan run through things and see if he needs it.
kk
when I start a new branch I always checkout git checkout adafruit/main first and then create the branch
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! π
ya, I'm not sure what that means. does it mean updating your own github fork?
ya, I think I okayed it
Ok.
similar things happen when folks rebase
Ah fair enough.
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.
Thanks for updating this! We'll have to keep it on our radar once the project is completely moved over.
Typing ALT and 178 in PuTTY gets me " Β²" (in PuTTY, on the PyGamer screen, I see "2"), even though I set the encoding to UTF-8.
This looks like a stage library issue.
Should I close and create a new thread in the CircuitPython Stage repository mentioning this issue?
@jepler are all callbacks allocated on the heap or is it a mix? If it's a mix then the collect won't work because it'll stop at the first pointer off the heap I believe.
Looks like uchip is 4 bytes too big now unfortunately.
@slender iron did you get your json "readinto" to work?
i merged it yesterday
There was a problem where sockets didn't actually have "readinto"; that's what I'm wondering about
That I don't know, but sockets are being Pythonized, so it could be added? But Scott can answer authoritatively.
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
https://github.com/jepler/circuitpython/tree/mp3decoder-readinto I'll leave this as a branch without a PR since it's untestable
or make it a draft PR?
If I understood right, Scott prefers I don't do that, so that draft PRs don't clutter up the pull request tracker.
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.
@onyx hinge In the background PR, the intention is that the whole callback list be gc'd, right?
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
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?
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)
The gc will walk the next and prev pointers if they point into heap space, but are the objects not in heap space?
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
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
``` 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)) {
yes, we pass statically allocated ptrs to gc all the time, to gc the things those objects hold
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
that's right, you're right, I was thinking they were on the heap
``` is the example where the data pointer `dma` and the callback itself `dma->callback` are both static data
@jepler and I discussed some things in discord, new code looks good to me.
@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
@slender iron cool, I'll revisit that code when esp32spi.socket is upgraded.
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?
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
This is great! Thank you!
Looks good to me too! Excited to hear how it works for folks.
Thanks for the reviews and help @tulip sleet @slender iron
@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. π
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.
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!
okay sounds good to me. See ya! have a nice night.
@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...
find is used by my new version of requests.
Update the release notes converter for the 2.x alpha release of mistune.
AllocationSizetracks allocation counts by size.AllocationAlarmraises an exception when an allocation occurs within awithblock.
It is off by default. Enable it with CIRCUITPY_MEMORYMONITOR = 1 in mpconfigboard.mk.
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...
CPython also supports these on bytes, as well as bytearray. They are not supported on array.array. Worth adding to bytes also?
Is it possible for needle to not be bytes-like if mp_get_buffer_raise() already succeeded on it?
I think bytes already has it because it's tied to string.
We're moving towards a co-processor model and a Wiznet library is
already available.
New native APIs will replace these for chips with networking like the
ESP32S2 but they won't be these.
It only half works; it acts too much like string. In CPython:
>>> b'123'.find(ord('2'))
1
>>> b'123'.find(b'2')
1
But in CircuitPython:
>>> b'123'.find(ord('3'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert 'int' object to str implicitly
>>> b'123'.find(b'3')
2
Ya, I didn't implement the find a single value. I was ok with that since the subset we do support works in CPython. I'm worried about code size a bit.
Got it. Yes, I'm wondering about the tiny ports; hope it will fit.
not Bluetooth. also "Catchall".
I had an nice audio chat with @DavePutz a few days ago, and he has gotten even more anomalous timing results when monitoring the time externally by pin-toggling in C. He is investigating further.
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...
Hey this looks really good! I missed this json module improvement, but thanks for adding it!
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?vectoriois 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 theadafruit_display_shapeslibrary there is some tradeoff to consider betweenO(n*m)memory and computing pixel winding numbers (for polygons). Butvectoriois not available everywheredisplayiois 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.
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.
@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!)
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?
@lone axle yeah I think vectorio is new in main and not in 5.3.x.
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)...
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
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
I see, interesting. I will play with it some, maybe counting with ints and then dividing could be better
There is no loss of precision,, just some numbers cannot be represented exactly in Floating point
never test floats with ==
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.
Thank you matthijs
That's a very good suggestion @honest dust !
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)
approximately ??
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 π
as shown above
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.
Some specific fractions are exact in floating point math, but many are not.
and fractional powers of 2 (.5,.25...)
Fair enough π
The newest version for the Stage library for PewPewM4 no longer contains
embedded graphics, which frees enough space in flash to enabled back
AnalogIO and also add USB_HID. There is still ~192 bytes left free.
If new additions to CircuitPython make it grow further, we can disable
USB_HID again.
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.
Is there a particular folder inside of tests that would make the most sense for vectorio? or would creating a new one be the right thing to do? https://github.com/adafruit/circuitpython/tree/main/tests
I'd anticipate a vectorio Learn guide at some point
I look forward to it! having no luck figuring out how to use it and I couldn't find example code anywhere
https://learn.adafruit.com/circuitpython-essentials/circuitpython-essentials has many of the widely used core modules, but not all (e.g., not displayio)
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.
circle, polygon, and rectangle don't have (x, y), so I wonder if you have to have a vectorio.VectorShape to anchor them
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.
This code: https://gist.github.com/FoamyGuy/e80df20ec7d2061b9d8b8be5660351b0 results in this
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)
hm what if you
palette = displayio.Palette(2)
palette.make_transparent(0)
color_palette[1] = 0xFFFFFF
oh, Circle and Rectangle are polygons, some mathematicians might disagree π
What makes you think they are polygons?
@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?
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.
Ah.
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
so to speak π
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)
rect_palette.make_transparent(0)
rect_palette[0] = 0x0000FF
is surprising
but π€· if it works
Circle and Rectangle are accepted as polygons in class vectorio.VectorShape(shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int = 0, y: int = 0)
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?
@crimson ferry then I did a bad in the documentation. They're absolutely not vectorio.Polygons
This is cool. Need to grok the paradigm, just like starting with displayio, but then pretty powerful!
@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)
a lot faster too than the display-shapes library I'm guessing
Faster was a non-goal. I hoped to match the bitmap implementation's speed only.
Memory usage is where vectorio shines
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.
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.
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'
Looking at the docs here: https://circuitpython.readthedocs.io/en/latest/shared-bindings/vectorio/index.html it doesn't list width or height property under Rectangle
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.
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
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 π
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.
It is faster and better memory use... display_shapes circles in similar code only gets a few hundred and there's remaining memory but it's too fragmented to allocate; vectorio gets to 1600+ with 0 memory remaining https://gist.github.com/anecdata/767d29f287110828dbd33707ee85bb59
interestingly, hitting 0 free memory gets an exception, but no error text MemoryError:
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.
...
@crimson ferry that's intentional, there is no room to format the message
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, ...
@lone axle here's a complete animated example https://github.com/WarriorOfWire/circuitpython-utilities/blob/master/examples/vectorio_example.py
Thank you!
Specifically, can't get past the adafruit_bme280 import. Is this a known problem?
@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.
ok. Suspected this was the problem.
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.
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.
@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 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....
Iβd be happy to just give up the DHTβs many better choices.
I assume you already removed usb_midi, touchio, pixelbug, neopixel_write, apa102, audioio and samd?
I was hoping to preserve neopixel_write, but it may have to go and keep pulseio.
also audiomixer
I think that is gone already. Will check tomorrow.
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
Thanks @solar whale Will go with Arduino but keep an eye out for your frozen lib solution.
@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
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.
@onyx hinge its on 6.0.0 i believe. I will try a few other versions in the morning and create an issue
BHB needs better accuracy from the ADC readings. To avoid changing the ADC configuration for all boards or adding complexity to AnalogIn, I implemented a custom user module to allow the BHB to talk to the ADC in the way that it needs to. I'm open to other approaches here, but this seemed like the least invasive and complex option.
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 ...
Looks good to me, but I haven't tested it.
@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
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...
@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.
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...
I think it would be good to add optional parameters to AnalogIn, like oversampling and sampling speed, that would do what you want in a more general way. And if there are flaws in the current way AnalogIn is implemented which cause some backwards incompatibility, then they can be fixed in 6.0.0.
We have seen user requests both for faster and slower, more accurate ADC readings.
So the idea is, someone COULD reenable CIRCUITPY_NETWORK in a custom build for 6.x but we wouldn't accept it in a pull request?
Thanks for the report!
I'll see if I can repro with my feather m4 express.
@dhalbert can you rereview please?
Remember that I have issue of creating up to date set of file for specific board or learn guide. I want a quick way to update the library I use in a consistent way. Here is a python script I use on Windows to copy the file and folder I want from lib to PyPortal/lib : https://gist.github.com/dglaude/f5f3423288861bc44fe758212dbaac61
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.
Cool snippet!
Have you tried using pathlib before? It makes path handling much easier
Thanks, did not knew about pathlib. I'll have a look.
I find this article on RealPython really helpful: https://realpython.com/python-pathlib/
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:
CircuitPython Text Editor for PyGamer/PyBadge/EdgeBadge
(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!)
textuploader.com - CircuitPython Text Editor
from vectorio import Polygon
rect = Polygon(points=[(0,0), (100,0), (100, 30), (0,30)])
print(rect.points)
This shorter piece of code suffices to reproduce. The read property is misbehaving.
@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.
Okay thank you. I will see how far break down the other
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)
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.
After refining this example to try to isolate the issue. I think I have conflated a few different things together and this issue is obsolete as is.
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...
@low sentinel While playing with this a bit more I noticed the docs for VectorShape https://circuitpython.readthedocs.io/en/latest/shared-bindings/vectorio/#vectorio.VectorShape say that x/y position is center point of the shape within it's parent. But it behavior is top left point instead of center I think.
it depends on the shape actually.
a polygon's axis is at (0, 0), which lets you get really creative with positioning and orientation.
Ah, Circle is probably in the center then? I haven't played with that one as much yet.
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.
I noticed an unusual call to ble_drv_remove_event_handler a few days ago. The previous line assigns NULL to the second argument:
Since both arguments are used together to find the entry:
I've not executed this code, I jus...
I think you're right, those lines should be reversed.
The getter for vectorio.Polygon#points was not updated with the data type change of the stored points list.
This moves the implementation to shared_module and updates the data type to reflect the actual state.
#define c(f) compile_##f
π
I tried building the system for PyPortal with this branch. I got a successful build and flashed the uf2 to the PyPortal but when I connect to the serial console it freezes after a few seconds. Tried both Mu Serial Console and Putty both on Win7.
I'm going to try building for a different device.
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...
I tested the 2020-07-17 build for Edge Badge and I am not having a similar issue. This may be something PyPortal specific, or perhaps even a hardware issue on my device. If someone else has a chance to test out that same PyPortal build and is not having a problem we can probably close this.
I would be happy to implement those for the SAMD21/51 boards in a later pull request (once I'm settled in after my move), are there any objections to merging this for now?
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.
Before:
>>> def f():
... await ''
...
>>> f()
After:
>>> def f():
... await ''
...
Traceback (most recent call last):
File "", line 2, in f
SyntaxError: 'await', 'async for' or 'async with' outside async function
Generator context is not the same thing as async context. This separates the contexts so as to require async def in order to await.
Thanks for the additional testing @FoamyGuy!
This is a waste of time: mpy-cross is determined to oppose this change and it should be made upstream in micropython, not circuitpython.
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...
@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...
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...
@tannewt unfortunately, a minor merge conflict to repair
?serverinfo
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...
@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
! 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.
I believe that if you call mp_obj_new_list(self->len/2, NULL); then the list will be initially allocated with the correct size, avoiding excess allocations.
I think it could e.g., be an array.array('l')?
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?
@lone axle check out the cherry-pick command
Will do thank you!
@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 tested out this build on my PyPortal and it does seem to resolve the issue that I noticed on my PyPortal that was noted in #3173
Using this build I can now get into REPL and use it normally with no freezing or crashing of any sort.
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
AnalogInis 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?
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
5.4.0-beta.1 fixes it. Sorry to waste your time!
@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?
@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-onlyto generate the pin tables, a...
@slender iron It's used for bitmaps right? I think it might could be collapsed together?
vectoriois 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 theadafruit_display_shapeslibrary there is some tradeoff to consider betweenO(n*m)memory and computing pixel winding numbers (for polygons). Butvectoriois not available everywheredisplayiois 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
displayiodoes, I think it would be almost indistinguishable speed-wise from the bitmap and requireO(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
@hukuzatuna no problem, this one bug has come up a lot, but it's different for everybody!
@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
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 π
Β―_(γ)_/Β―
I don't usually take it too seriously
I'd say alpha if we think APIs will change
alpha usually means feature-incompelte
beta otherwise
what scott said
Fair enough, I'm convinced
(I could go straight to rc if you are confident about background stuff)
haha no
kk π
let's plan on doing a release of some sort this week
so it can soak in an unstable release
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.
@slender iron if you want to 3-2-1 me for meeting recording that would be nice
Good afternoon all you wonderful CircuitPythonistas -- happily lurking for today's meeting. The doc has been updated to reflect that.
I am also lurking today.
Lurking but here
<@&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
brb
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?
no not the built in -- I mean a breakout
a wild Mr. Certainly speaks
then no, there's no issue because it should just work π
OK -- last I tried, it did not. will retry and open if reproducible.
Thank you!
@timber mango Are you lurking (listening in) today?
I haven't tried it myself but I have some adaloggers so I should
It was an adalogger I tried. And a breakout IIRC.
https://www.adafruit.com/product/2922 I'll try with this one assuming you repro the problem
Just listening today.
a separate computer for each USB device
ze cloud
"screaming" button
π "beep, boop"
Lurking
lurking
Not even lurking... I don't get any sound from Discord... trying another computer. π
@thorny jay understood
@onyx hinge yup -reproduced -- keeps reporting"no SD Card" -- I'll open an issue later today.
https://blog.europython.eu/post/614102095419850752/europython-2020-online-conference-from-july-23-26
https://twitter.com/PlusPlusInt/status/1283004659913957376?s=09 https://drive.google.com/file/d/1sJsW3r12_vnLUIJXL_1vZ0xPcK2UlQ62/edit
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...
I have used two different RTCs in the Feather form factor. One has
the PCF8523, and the other
has the DS3231. The former has an SD card slot while the latter has higher precision including a tempeβ¦
The DS3231 and PCF8523 real time clocks (RTCs) can
both be calibrated by writing various register values. To follow the
calibration procedures you'll need a frequency counter you trust, with at leaβ¦
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...
π
https://careers.microsoft.com/us/en/job/788078/Senior-Program-Manager https://twitter.com/qubitron/status/1283791148687880192
I am hiring again! Looking a Senior Program Manager to help make Azure the best cloud for #Python developers! Come join us in Microsoft's Developer Division, it's a great place to work.
Apply here ππ
https://t.co/C7wMCVXFPN
Likes
139
That sign is so cool π
Thanks
Find maker jobs in 3D and CAD, Art, Design, Education, Embedded Development, Engineering, Fabrication, Marketing and Communications, and Web Development
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.
Yeah, a flag could be useful for that. In BHB I can be certain that the ADC isn't used for anything else.
circuitpythonday@adafruit.com
You can host events locally, do projects, all kinds of things!
Send a tweet to @anne_engineer for Python/CircuitPython tips and projects or email anneb@adafruit.com
not lurkng today π
kk
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 ...
Yes I do.
Just a tiny bit
un petit peu
I don't know the french for "meeting". rendez-vous is probably not right.
I remember just a little from school, kinda funny what does come back at times
c'est la rencontre
lurking for updates
"rΓ©union"
oo yeah - bonus hug report to @lone axle for tackling a progressbar issue
π― <- for Scott, not for me...
(and I know I'm forgetting another name who has helped with text for displayio .. curses)
kmatch98
belated hug to kmatch98
@solar whale thank YOU for all your help in the various outlets. it is much appreciated.
@gilded cradle can you supply the URL for the guide on your large sign
oooo that sounds awesome
@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...
Part 1 is available at: https://www.youtube.com/watch?v=iUOKnKkuhis
This video is Part 1 of My Custom Animated RGB LED Scrolling Message Sign Series and it covers the assembly of the sign and everything you need to do to build the hardware.
3D Printable Parts
https://www.thingiverse.com/thing:4539796
*************...
lets see if mic works
dang!
@ionic elk I now understand your frustration a few weeks ago
here
kk
(sorry, I should have added Dave P to the notes:)
np
very nice
Sorry I canβt join today. Hereβs my βnon CP work from last weekβ, video with audio if you like to hear the clickety-clackety bits.
3d printed Mechanical 7 segment display.
dat click 
i'm still "gitting" π used to that new UI
I need to step away so I'll miss In the Weeds. I'll lurk so the backup recording can complete.
kk
I have seen a 7 color eInk display... but costing a lot!
@ivory yew Excellent blog posting!
ty!
(done with my day job Monday meeting, lurking now in the chat)
that blog post is one of the longest and definitely involved more math and javascript than any other 
oh cool thanks! β₯οΈ
talking about updating https://learn.adafruit.com/circuitpython-display-support-using-displayio/text
sounds like wanting to update that page?
yup
ok, what kattni said then. π
Maybe this one too, which is mirrored from another guide: https://learn.adafruit.com/circuitpython-display-support-using-displayio/ui-quickstart
(and thanks for updating)
@gilded cradle thanks
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.
thats a package instead of a module
@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.
PulseIn?
@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).
I've used PulseIn on the Grand Central.
@lone axle Do you know if kmatch98 is in the Learn system? e.g. have they written a guide?
Ah, ok
Thank you Cater.
@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...
@idle owl I don't think so, but I am not sure to be honest.
@lone axle No worries. Include them in the email you send me, when you get around to it, and we'll find out.
Will do.
@thorny jay cool, well, if you do come back to it all feedback is welcome. π
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.
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.
@lone axle that sounds awesome
that's an awesome pie in the sky idea
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?
Well, I wanted to see if I could put ps2io back into M0.
So this is basically an interface for adjusting build flags online?
yep
That'd be pretty neat for STM32 boards, we have a lot of flags like that which impact flash size
check boxes or side by side lists or something like that. Just choose which ones to include or exclude.
Not build flags as much as the board makefile, right?
Whether or not you want a bootloader, etc
or I guess you can pass those in through make arguments.
I can now compile CircuitPython on my Pi4 "server" so maybe I should just give it a try.
(my terminology about flags vs. board make files etc. is probably off. I don't have much actual experience with custom builds yet)
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
(I'm back)
I know just enough make to be dangerous
I say things and people understand what I mean so I learn it's ok and then never change
π
ninja builds when @slender iron π
π€ βοΈ
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.
oh that's cool
@onyx hinge is it published anywhere?
@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.
@stuck elbow I don't think so, if you're interested I'll try to dig it up.
that would be great, thank you!
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
thanks, I think I can go from there
./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
ok, thanks!
@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.
@idle owl that is awesome of you, thanks
@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...
there are versions of python 3 that would run that code
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...
the errors were added later on
Contrary to micropython... there is no "unix" version of CircuitPython? Or only for testing?
right, there's no unix CircuitPython. It hasn't been worth doing.
In a slightly alternate version of history we might have gotten that instead of blinka
I think we're in the better timeline
Will we get the dynamic C modules if we merge in Micropython?
in that respect
because that would be spicy
Is this the longest meeting we have had?
Big in the weeds, 45m
I don't complain. I love when it goes over my head (like a joke you don't understand).
yeah we'd get a ton of new stuff if we merged with upstream: https://github.com/adafruit/circuitpython/issues/2999#issuecomment-653989721
I think it's still probably worth thinking about breaking in the weeds into a separate meeting
Everybody is free to exit.
Thanks for a good meeting everyone!
circuitpythonday@adafruit.com
Bye, thanks
i suspect Discord tries to do a bit of its own echo suppression as well
The more the merrier π
I was just paranoid, seeing the indicator light up -- thinking "oh no, am I causing a stadium effect?"
@modern wing Understandable and worth checking.
Have a good week --- dog walk time π
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.
@onyx hinge how much of the video work flow do you want to do?
I can see the green light blinking along to the background noise π
@low sentinel if you have time to talk more async stuff, i would be happy to now. I am interested in your use cases.
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
kk
@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).
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
@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.
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
my audio & scott's (discord's) audio are both good in the recording. hooray
Then you're 98% there.
do you ever get used to that "hearing yourself" thing?!
@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.
@onyx hinge I am told you do. I have not.
@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?
how about Amelia Earhart?
@onyx hinge I'm self-conscious of it. Folks say it's fine, but I go, "Wait, I sound like...that?"
I mean, I sound fine but at the same time I sound like somebody else
@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.
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.
@idle owl yeah ....
@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?
@modern wing Oh noes, you want to know my sekrets! π
Hahaha, guilty as charged π
@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.
That's impressive. Doing that much effort, week after week, especially with such a short turnaround time is pretty amazing.
Still takes me all day Tuesday. It gets shipped around 8:30-9pm pretty consistently, no matter how hard I try.
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
Except for the marking it as "for mature audiences" part, because the fourth time I screw something up... yeah that.
I'm frankly astonished that I haven't said bad words during the meeting yet
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?!"
@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.)
my building has independent alarm systems
We know nothing, we hear nothing π