#circuitpython-dev
1 messages Β· Page 296 of 1
@solar whale No apology needed. We're going to do a release sweep (which if you're up for it, we'd love help on) when this is done, so if there's no rush, you can hold off. Thank you for asking - I really appreciate you keeping up with releases on the things you're merging.
OK - let me know when and how I can help.
@gilded cradle Can you test the webgl demo in this PR? https://github.com/adafruit/Adafruit_CircuitPython_BNO055/pull/44/files
Sure @idle owl. Let me see if I can find my BNO055...
@gilded cradle Thank you so much!
I've just worked out what black is. https://github.com/psf/black
What's best thing to read on the adoption strategy/process that's being use for this Black thing at Adafruit?
A canonical code style is one of the best things about the Go language: no arguments... there's one way to do it. It saves so much hassle and arguing. Of course they had a formatter that encoded the format. Just put a call to that in your save hook and never think about code style again.
resistance is futile ...
Futility will be resisted
@idle owl, so far no luck locating it. I'll keep looking. I have a couple more places to check.
@gilded cradle I was thinking you'd dealt with it recently. Thanks for putting in the effort.
Oh, that was using the CLUe that I did something similar
Ah fair enough
Ok @idle owl, finally found it
Huzzah!
Why are so many translation entries deleted? One typo in docs.
See also ~ulab.extras.spectrum, which computes the magnitude of the fft,
For anyone using Emacs, there's support for black: install the 'python-black' package and you may have to set the 'python-black-command' variable. Then you can add (python-black-on-save-mode t) to your python-mode-hook to have it auto format the buffer when you save.
The Rasa Stack people also use Black.
@ionic elk I believe it's still just the beta level backers.
Interesting first comment on https://www.kickstarter.com/projects/pimoroni/32blit-retro-inspired-handheld-with-open-source-fi/posts/2786466 ```Keep safe.
I really don't mind the wait but I'd like to get my hands on an Adafruit CLUE while I endure several months of 'old folks self isolation'.
Perhaps we should encourage the over 70's to take up a new hobby in their isolated state - coding? It keeps the brain active.```
Hi. I'm trying to port CircuitPython to a custom STM32F12Cx board and everything seems to work, except USB. (doesn't mount drive or serial device). Does anyone have any troubleshooting suggestions. Here's a more thorough explanation of what I'm running into: https://forums.adafruit.com/viewtopic.php?f=60&t=163516&p=803857
@granite ingot Welcome! Hopefully @ionic elk can take a look.
@ionic elk I'm a beta backer on kickstarter
@solar whale @idle owl @onyx hinge My understanding is that the current black is pre-release in order to give themselves wiggle room in changing things. Their goal is to freeze the formatting once a stable release is made. The trade-off is this eternal confusion about what to use.
@slender iron want to lend me yours? π
Or you could probably port it pretty easily once all the Nucleo stuff is done
get it going on the nucleo and then we can reach out to pimoroni
go ahead and order any dev boards you may need
I'm not sure I've ever run into an H750 dev board is the thing
Oh hmm actually I got it mixed up, the H750 is the value line - the one with only 128kb of flash memory. Interesting.
may be too new
I was avoiding that one because I wasn't sure if we could even support it without some code shenanigans.
@slender iron I was thinking it may be worthwhile to change the black directive from black --check to black --diff
@slender iron Black --diff tells the user what it would change whereas black --check just says what files it would reformat.
noob here with a question
@slender iron And Black just saying it would reformat some files might be confusing to some people who haven't encountered black before
@brazen cedar do ahead and ask
@trim elm ya. I get that. the goal is that folks don't need to worry about the formatting though
Does this mean the LEDs are connected to pins 13,14 and 15
#define CP_RGB_STATUS_R (&pin_P0_13)
#define CP_RGB_STATUS_G (&pin_P0_14)
#define CP_RGB_STATUS_B (&pin_P0_15)
@slender iron Well, maybe we could keep black --check but have it output a link to the black learn guide?
not necessarily P0_13 is the die number which is then mapped to a package pin
@trim elm that sounds perfect
Is there an official Adafruit black config file?
@raven canopy Do you think you might be able to put in a patch that does this once I finish with the learn guide page for Black? thx
@umbral dagger black doesn't have a config. it's meant to support only one format
@brazen cedar the mapping for the xenon is here https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/particle_xenon/pins.c
@slender iron For the "one size fits all approach" it must have evolved a bit? Hasn't its standard varied a little by version? I have to admit I've not got hands on with this beast yet but I'm about to publish a guide...
@simple pulsar I don't know enough about the history of black. Seems like it will have varied a bit since it's pre-release for that reason
Doesn't Mu have its own thoughts on code? Are Black, pylint and Mu all aligned in their opinions?
@simple pulsar Black and pylint only disagree in terms of pylint's bad-continuation check, which is a bug on pylint's end that we've disabled in all the .pylintrcs
they are all based on PEP8 I believe so theoretically they should be the same. there is some room for interpretation though
I've never seen from foo import (baz,) before. Google isn't really giving me any info on it.
@idle owl Yeah, I wasn't super happy with the way black handles that either. I think it's got to do with the length of the line, but it really doesn't look great
Not in the case of 1 module. In the case of 10 modules, yeah I guess I can understand it, but one makes no sense to me.
Eh.
Is this for line continuation with long import lines?
It formats it that way regardless of line length, it seems.
Yeah, I mostly saw it doing that for non top-level imports after I added a disable for import-outside-toplevel
^^
Although I didn't really check if it was doing it for top-level imports come to think of it
I haven't seen it doing it for top level.
That's good
Except in the case of one that had something like 10 modules imported.
with multiple line breaks.
Β―_(γ)_/Β―
one of black's goals is to lead to more readable diffs as well
I think it's the motivation for the very vertical continuations
"Speaker: Εukasz Langa
What good is a code style if it's not internally consistent? What good is a linter when it slows you down? What if you could out-source your worries about code formatting, adopt a consistent style, and make your team faster all at the same time?
Come h...
You explained it differently in the meeting previously.
In talking about the keyword arguments or lists or whatever all being put on separate lines
@solar whale I see that, can you explain what the P0 thing is in the pin name? (i.e. &pin_P0_13 for RED)
I don't remember exactly, but something to do with who wrote it and their way of coding things
Involving comments or something?
You used a word I didn't recognise.
type hints
allows you to define what type an argument should be
it makes each argument longer
I just read that last "it makes each argument longer" sentence out of context and thought "I don't want that!"
@brazen cedar the pins are grouped on ports in the nrf52840 the P0/P1 refers to the "port"
@solar whale ok thanks for clearing that up. I have so many questions...
the ports are clearer in this diagram
this might help as well https://docs.particle.io/assets/images/xenon/xenon-pinout-v1.0.pdf
@solar whale it appears I need to learn to read schematics
just enough to "get by". The linked pdf of the pinouts may be more clear.
each pin on the chip has several "names" depending on why you are asking....
the "pins.c" file linked earlier is the best way to check how the pins are mapped to the names when you import board
@brazen cedar the "gory details" of the ports are described in the nrf52840 data sheet https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.0.pdf see section 6.9.2 if you want to delve further.
Now featuring over 500 riveting pages of datasheet thrills!
@cursive condor Do you still want to make your fractal code run faster?
@ionic elk Thanks for your input on my STM USB issue. Unfortunately, those were things I think I've already addressed. Any other thoughts or tests you would run?
I haven't started diving into the TinyUSB code yet and am trying to avoid that if I can help it.
Otherwise, based on the LEDs on the board, it appears that everything else in the startup process is working as expected (more or less). I feel like the safe mode issue might have just been caused by GDB and might be a red herring.
@granite ingot Unfortunately USB issues are some of the most annoying to debug even for me. I don't touch the TinyUSB code either
It is possible that GDB can interfere with the timing, but I'd be more suspicious of a clock timing issue
I've checked the clock and it seems to be correct. I've also tested connecting USB as a serial port with the pure STM32Cube HAL, and it works as expected.
FYI this breaks Trinket M0 and likely any other boards that use a DotStar as the status LED. The SPI constructor call needs to be updated to pass NULL instead of mp_const_none here: https://github.com/adafruit/circuitpython/blob/master/supervisor/shared/rgb_led_status.c#L128
Normally when USB doesn't work it's because something is messed up on the clock line. It's worth triple checking. The TIM has some idiosyncrasies with clock division, though it'll usually be off by a factor of 2 which is pretty noticeable since the common oscillators are 8 and 12
@trim elm should be doable. --check returns non-zero for changes (1) & failures (123), so some if [ $? != 0 ]; echo ... bash should work.
@lapis hemlock always π
@granite ingot do you have a schematic of the usb line?
@lapis hemlock always π
@cursive condor I think there are a couple of places, where you could shave off a bit of time. E.g., you could move a lot of stuff out of thefor ky in range(height)loop. You could also replacerow = ulab.array([i for i in range(width)])bylinspace.arctan2should now be in the latestcircuitpythonfirmware, so you can optimise that, too. I don't know how much you can gain in speed, but I think a factor of 2 is not out of reach. Actually, I would be interested to see your updated numbers, if you have a chance to measure them.
@ionic elk and the circuit diagram: https://github.com/jgillick/ThunderPack/blob/STM32F4/hardware/Standard_18650/schematic.pdf
The USB traces are far from perfect (from a USB spec perspective), but they've been working on other platforms. Maybe TinyUSB is more finicky?
Is there anything else you'd do to troubleshoot the clock?
As a last ditch try, I've also ordered a STM32F411C chip, as it is part number exact to the BlackPill version in the repo -- and the black pill is more similar to my board than the discovery boards. I doubt it'll work any better, but I'm happy to try just about anything.
@lapis hemlock : great ideas. I can't move anything out of the for ky in range(height)Β loop. every value depend of ky ultimately (y and y2 etc) I"ll let you know the gain numbers π
Trinket M0 crash loops now because the SPI construct tries to throw a Python exception outside the VM.
Bug introduced in #2666.
(and I can't use a matrix, not enough memory)
@granite ingot is there more than one USB peripheral in the chip?
@granite ingot I have this section in the port level usb c:
#ifdef STM32F412Zx
/* Configure POWER_SWITCH IO pin (F412 ONLY)*/
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
never_reset_pin_number(0, 8);
#endif
if you missed that macro somehow it could cause problems.
I doubt it's the hardware if it works with bare stm32cube
@raven canopy sounds good. I'll ping you when the learn guide page is published
Been a while since I wrote it though so I'm not 100% sure what your case is
@lapis hemlock : great ideas. I can't move anything out of the
for ky in range(height)Β loop. every value depend of ky ultimately (y and y2 etc) I"ll let you know the gain numbers π
@cursive condor Iny = ky * h4pi - 6.28 y2 = y**2 atan = ulab.vector.atan( row / y ) dist = ulab.vector.sqrt((row * row) + y2) * fpeverything can be computed beforehand, there is no need to have that in the loop. In fact, you could iterate over the array itself, like so ```row = linspace(...);
row = rowrow;
y2 = linspace(...);
y2 = y2y2;
dist = sqrt(...) + fp;
for d in dist:
z = ulab.zeros(width)
for i in range(n):
z = z + ulab.vector.cos(ulab.vector.sin(atan + (i * rot)) * dist)
@granite ingot what I would try in the meantime would be giving one of the tinyUSB examples a shot
@slender iron It only has one usb peripheral on the chip.
Yup, one set of USB pins
@cursive condor linspace is bound at the top level in ulab, i.e., you can call that as ulab.linspace: https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/__init__.html, or https://micropython-ulab.readthedocs.io/en/latest/ulab.html#linspace
@ionic elk I saw that macro, but wasn't sure why that was in usb.c.
As far as I recall it is a F412 specific item but I'll double check
I have it excluded from my build.
@lone axle If I merge that PN532 PR, are you up for updating the guide you mentioned?
The F412 was the first thing I implemented and is only used on the one discovery
Oh no you need the CMSIS MCU defined in mpconfigboard.mk FOR SURE
that's used all over the place, it is 100% not optional
@idle owl yep I can do that.
@lone axle I want to merge yours first and let us deal with the merge conflict on the Pylint/Black update PR instead of yours.
that's what I was referring to earlier
@lone axle Ok, I'm going to merge it. I think I need to add you as a contributor on that guide - remind me when you're not working.
@idle owl sounds good. Will do.
Yup, I have the MCU defined.
hmm, that's all it is drawing from. So if that matches the same wording as the F412 discovery it should be ok
@lapis hemlock I think I understand. linspace act like a generator, so it's like a memory-unexpensive matrix ? I must test further ! Thanks !
Are you looking to push this upstream? If you start a PR I can do a more direct review.
I haven't opened the PR on the circuitpython side yet, since it still doesn't work. I can move it if it's easier.
@lapis hemlock I think I understand. linspace act like a generator, so it's like a memory-unexpensive matrix ? I must test further ! Thanks !
@cursive condor No,linspacecreates an array, it is not a generator. With that itself you won't gain much (it is just more elegant, because you won't need the list comprehension), butdist = ulab.vector.sqrt((row * row) + y2) * fpis definitely expensive in the loop.
@solar whale You around and up for testing something for me?
sure
@granite ingot huh... why is it a fork of micropython?
Anyway you could try giving this a shot
the fork name just depends on which you fork first on github
micropython and circuitpython are the same git tree so you can have branches for both in a git repo
The above is the TinyUSB cdc_msc example. You can create your own by navigating to /lib/tinyusb/examples/device/cdc_msc/ and running make BOARD=stm32f412disco, or pick any of the other examples.
@idle owl what would you like me to test?
If you're on Mac OSX you'll need to install realpath with brew install coreutils
@slender iron thanks hadn't seen it show up like that before
yup yup. I renamed mine manually
@solar whale Register. We break this, we break a lot. I don't know if you have hardware though, basically any library that uses register can be used to test it, but I'm realising that might limit what you can do.
A lot of the recent libs use register.
ok -- let me check -- or do you have some libs in mind/
@idle owl do you have an example of a lib that uses it -- I am not finding any
@solar whale I never remember off the top of my head: π um.... hold on.
Is one
@slender iron I saw mention of a config file.
must have been the pylint one. each repo has a copy of it
@idle owl -- apds9960 uses it and I have that -- on clue and alone -- I can try it.
Perfect
I looked through all the mp_const_none uses, but clearly not for all values of "all". :)
@cursive condor The last line of the snippet that I posted above should read z = z + ulab.vector.cos(ulab.vector.sin(atan + (i * rot)) * d)
Thanks for debugging this!
@idle owl all the apds9960 simpletest run ok on my clue with pr_37
do you want me to comment in the PR?
π
Ooh I have another one for you. You have RPi setup right?
yes
Do you have NeoPixels in some form that you can hook up to it?
yes -- but I always have issues with neopixels and sudo on my Pi's -- I can try
Ahhh... hmm alright
You don't need to reinstall the library to test this one - it's the change in the RPi_simpletest that I want tested
@solar whale actually looks like you could test that change on anything with NeoPixels.
That change is in wheel
OK -- that would be easier
Yeah change is in the normal simpletest as well
I didn't keep scrolling once I saw it
run the neopixel_simpletest.py on anything with pixels.
I'll try it
it works fine with a jewel on my bluefruit sense -- no change to the lib, just the demo, correct
Correct
looks good!
Thank you!
you're welcome
@solar whale I'm on RFM69. Are you able to deal with the merge conflicts that are going to arise from me merging the Pylint/Black PR? As in technically are you capable. I don't have the hardware to test your PR unfortunately.
I think so -- it'll be a good test π i'm up for it.
yeah -- I broke it on him with todays merge...oops
BTW -- I ran black on my rfm9x library -- very similar to rfm69 and it "did no harm" still works.
Good to know, thanks!
I'll be AFK for the rest of the day -- I'll be ready to tackle the RFM69 tomorrow or whenever it gets merged -- no rush
Excellent, thank you. Have a good one!
You too! good luck!
@idle owl I am around now and should be for a while.
@granite ingot had to take off for a while, let me know if you ended up solving your issue! If not I'll probably pop back into boston and grab my F412 board, see if I can replicate any issues.
@kamtom480
The build errors with:
> make -j 17 BOARD=spresense 1m ξ³ Tue Mar 17 13:39:26 2020
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C mkspk
In file included from mkspk.c:48:
./mkspk.h:39:10: fatal error: 'elf.h' file not found
#include "elf.h"
^~~~~~~
1 error generated.
make[1]: ***...
I have not abandoned the project, but I have to hit the pause button until we resolve the issues pertaining the COVID19 DIY ventilator project here in Lebanon and on the Open Source COVID19 group.
Hope I can get back on track soon!
@lone axle I just finished.
160 PRs merged today.
Or at least that's how many tabs I just closed.
dang
Let me put together some boilerplate for the releases.
I am bad with tabs and I don't think I've ever gotten that many π
I've merged something like 350 PRs in the last 5 days or so.
I left them open on purpose π
So I could feel the satisfaction of closing them all at once.
nice
Taking a cursory look at the PN532 guide I'm coming up with two places to change it in text and one image that is a screenshot of the REPL. I'm working on getting that screenshot now.
I'm having problems getting MP_ROM_QSTR() to work in an .h file, is that impossible?
microcontroller/__init__.c has the STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] which I was trying to move out to selectable h files since it's different for every package. But I get a failure message when I try:
note: in expansion of macro 'MP_ROM_QSTR'
6 | { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) },
| ^~~~~~~~~~~
./packages/LQFP64.h:12:17: error: 'MP_QSTR_PC00' undeclared here (not in a function); did you mean 'MP_QSTR_SCL'?
Why are so many translation entries deleted?
The rename of ports/stm32f4, but TRANSLATE_SOURCES was not updated
I added a commit to address that, lmk if you want me to split it into its own PR.
@tulip sleet do you have any ideas about the above QSTR issue?
@ionic elk Compiling the example worked! (I had to change things in the TinyUSB port for my clock).
Ooooh, I'm at the edge of my seat.
oh, no nevermind I don't :/
Doh!
sorry I thought it was that I'd forgotten to add BOARD_OSC_DIV to the F412 port but it's there
I had to fiddle with the USB ID and VBUS lines a bit. I'm going to repeat those steps with the main circuitpython build to see if that does anything.
That said, the setup for the F412 is weird and I haven't gotten into the details of it that much, it's different from all the other SoCs we support for STM32
You can try checking out peripherals/stm32f4/stm32f412/clock.c and mess around in there, see if it does anything
I haven't done a ton of testing for the F412 since I only have one discovery board for it, and it has kind of old hardware. Haven't seen any other boards using it so far, the F411 and F405 are more common.
Good to know
I'm considering moving to the F411. I originally chose the F412 because it had twice the flash and still fits in a 7x7 chip.
It's not a bad chip for sure, it's just a little more rare from what I've seen. I think it's pricier in bulk too.
I think this SAI clock sourcing stuff is probably the heart of the issue, it's the Serial Audio Interface, which I haven't touched. It got set up that way by default with STM32Cube... let me see if it compiles if I just move it over to the conventional way...
@granite ingot ok, it compiles. Try commenting out this section:
/* Select PLLSAI output as USB clock source */
// PeriphClkInitStruct.PLLI2S.PLLI2SM = 8;
// PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4;
// PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
// PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48;
// PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ;
// HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
and the corresponding // RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; at the top of the stm32f4_peripherals_clocks_init function in clocks.c for the F412
Give that a build and see if it solves things for you. That PLLI2SQ might be your problem
I'm trying to use CircuitPython on a RPI4, following the instructions : https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi
@slender iron got a sec? I'm getting hung up on that QSTR issue above
The blinkatest.py test script told me: File "/home/dietpi/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pin.py", line 32, in init
GPIO.setup(self.id, GPIO.IN)
RuntimeError: Not running on a RPi!
Is the RPi4 supported?
@ionic elk back from a run now. did you clean and make?
Yes, this is all off a clean build
@timber mango I thought it was. do you have a new one? @gilded cradle would know for sure
This might just be a C misunderstanding for me - I'm using the .h file to try and bring in this QSTR table, but does that mess up how the preprocessor handles it?
@slender iron It's a new RPI4 running DietPi
@timber mango are you running it on Raspbian?
DietPi is likely not supported.
Correct, DietPi isn't currently supported.
DietPi is based on Raspian
@slender iron the essence of what I'm trying to do is import this table, which has like 5+ variants in stm32:
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
#if MCU_PACKAGE >= 100
{ MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) },
//etc
What's missing? I can maybe port the Rasbian version to DietPi?
It will likely need to have some adjustments made if it isn't just working.
(I hate Raspbian, I love DietPi)
Yeah, start with PlatformDetect. I just wrote a guide that might help: https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka
So I went and stuck all the different versions in .h files and tried including them conditionally, but that seems to confuse the compiler, since it now thinks MP_QSTR_PE02 is an undefined variable, rather than something that the preprocessor just picks up and spits out.
Or maybe that's me misunderstanding how MP_ROM_QSTR works?
If you want to try and get it working on DietPi, we'd love it if you submitted a PR.
@ionic elk did you clean and build again yet?
the QSTR mechanics in the build don't always pick up on changes
All the builds I've done have been clean
that's usually the first thing I try for anything QSTR related
ok, I can't think of other .h files that have qstrs in them
me neither which is why I was wondering if this is preprocessor weirdness?
Is there another way I could have it call the table in from another file? Or should I break it out of microcontroller/__init__.c somehow, like pins.c is in the board folder?
sounds like you should use the makefile mechanics to include a different file in the build
Right, so I tried just doing it like packages/$(MCU_PACKAGE).c\
in SRC_C. But then I get:
build-feather_stm32f405_express/shared-bindings/microcontroller/Pin.o: in function `get_pin_name':
/Users/hierophect/Firmware_Projects/circuitpython/ports/stm/../../shared-bindings/microcontroller/Pin.c:69: undefined reference to `mcu_pin_globals'
/usr/local/Caskroom/gcc-arm-embedded/9-2019-q4-major/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: build-feather_stm32f405_express/shared-bindings/microcontroller/__init__.o:(.rodata.mcu_pin_module+0x4): undefined reference to `mcu_pin_globals'
collect2: error: ld returned 1 exit status
can you push your changes somewhere so I can look?
Yeah let me go ahead and get a PR going for this
the piece you copied over had _table at the end of the variable name
They all end in MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);
kk
No problem @mesa177. Take care of yourself and your community. I will close both of the PRs but the branches will still be available and we can create a new PR when ready. Thanks!
I created an issue to finish this when we have time. Thanks again!
Looks great! Totally ok to have the translation fix here. Thanks!
@slender iron Looks like I just had to include #include "shared-bindings/microcontroller/__init__.h" and #include "common-hal/microcontroller/Pin.h". Seems to work so far, I'll give it a shot in python to make sure. Thanks for your help.
π
yeah I think the specific cleverness about "which files changed, and need qstrs regenerated" cannot handle the case where a .h file is the file that is changed. It is a Makefile limitation that might be liftable if necessary; or it might be hard
@ionic elk my day job is getting in the way π , but I'll try commenting out the SAI block later, like you recommended and let you know. Thanks again for all your recommendations.
sorry if you already determined that, I didn't read all the scroll carefully
@ionic elk Never mind, looks like it's working without commenting that block out!!!
@slender iron @tulip sleet will want to talk sometime soon about whether any changes in master since 5.0.0 are concerning for going into 5.1.0. post-that, I can get the 5.1.x branch created e.g., from the merge commit of #2711 or any later bug fixes we want to bring in, and then we can work on whatever else is in the 5.x.0 (I think it's called?) milestone.
It seems to be related to BOARD_NO_VBUS_SENSE. If I leave that unset and make sure that pin is connected to 3.3v, it works.
@onyx hinge the only thing on my radar was trinket being broken but we just merged a fix
Getting the TinyUSB example you recommended running is what led me to this. Now to figure out how to get it working without VBUS sense. My board is already packed and I'd prefer to avoid adding another couple resistors for a voltage divider.
not getting a worry-tingle from any PR merged since 5.0.0
slight one from the stm rename.
9453e10c5 Merge pull request #2712 from tannewt/fix_dotstar_status
c8d9edd93 Merge pull request #2705 from NightSkySK/UARTlogger2
3a5f79ace Merge pull request #2701 from hierophect/stm32-submodule-swap
85f44e20c Merge pull request #2695 from TG-Techie/master
0f64663c4 Merge pull request #2699 from hierophect/stm32-port-namechange
dd21ec048 Merge pull request #2697 from hierophect/stm32-pulsein
d988af02d Merge pull request #2690 from jepler/topic-pep-498-fstrings
6363b5ad0 Merge pull request #2693 from jepler/ulab-enable
df8893912 Merge pull request #2666 from dhalbert/assert_pin-and-mp_const_none-cleanup
eebe76997 Merge pull request #2692 from jepler/ulab-upstream
83d5da95b Merge pull request #2684 from caternuson/doc_add_sensors
4fa90261a Merge pull request #2657 from tannewt/builtin_package
e81930fb9 Merge pull request #2681 from theacodes/disable-hid-on-sol
b4e195552 Merge pull request #2583 from jepler/ulab
4aec5d1e8 Merge pull request #2680 from hierophect/stm32-clock-hotfix
e98991fd7 Merge pull request #2678 from adafruit/5.0.x
6468ca04a Merge pull request #2668 from hierophect/stm32-pulseout
2fea811c3 Merge pull request #2672 from jepler/fuzz
17458ad81 Merge pull request #2662 from jepler/issue2332
2e370008c Merge pull request #2670 from jepler/compile-assertion-errors
but that's got to be in the "if it builds, ship it" category of change
we'll do an rc anyway
@kevinjwalters yes, it seems to be an implementation detail of micropython/circuitpython that a 'with' statement creates an extra line in a traceback. I don't think anything about that repeated line in the traceback is important to the problem at hand.
@slender iron does this look right? ```$ git checkout -b 5.1.x 4603c6ddd
Switched to a new branch '5.1.x'
$ git push --dry-run --set-upstream origin 5.1.x
To github.com:adafruit/circuitpython.git
- [new branch] 5.1.x -> 5.1.x
Would set upstream of '5.1.x' to '5.1.x' of 'origin'
I think that is right
Thanks for helping me with baby steps in the release management process
I think I know how to tag 5.1.0-rc.1 but I don't know if we have any other items we prioritize getting in before that happens. I took a look at pull requests and a shorter look at issues and nothing jumped out at me @slender iron
Winterbloom Big Honking Button will be an open source (hardware and software) Eurorack sampler that honks at you π¦.
PR for board support coming in soon, could I have a USB PID for this? π
@gilded cradle I solved the problem by adding the dietpi user to groups gpio and spi (discussed here: https://github.com/adafruit/Adafruit_Blinka/issues/150) So DietPi is implicitely supported.
@onyx hinge I usually use GitHub to tag after doing the release notes. I always start with the previous copy and then look at commits.
Awesome news @timber mango
If I have a PR that is failing during the actions job with this error is there anything specifically I could be doing to fix it? Or is it more likely something in Github and I just need to wait a while?
Perhaps is related to Re-running the job which I did try after a few minutes: https://github.com/actions/checkout/issues/23
@lone axle i think pushing a new commit (empty or otherwise) might get you past the race condition from re-run. or did it do it on the first run, too?
It did not do it on the first run. On the first time it made it all the way to build docs, and failed with a 502 error on readthedocs.
ahh. π¦
Oh weird
I had actually tried making a relatively trivial commit a few minutes ago and I would have swore it showed that same error again
but I just switched back to that tab and it shows complete with green now π
π
we could look at moving the libraries to checkout@v2; the lack of submodule checkout, and shallow clone shouldn't affect the libs like it does the core: https://github.com/adafruit/circuitpython/issues/2683
lol. nevermind. forgot we already did. nope, that's the actions-ci checkout
Ah I see. Thank you for the suggestion and background info.
I think this is not correct: in ulab master, we re-named the function to spectrogram: https://github.com/v923z/micropython-ulab/blob/master/code/extras.c
Yeah a spectrum and a spectrogram are different things.
@idle owl thank you for updating the pylint guide!
Hi everyone, I'm not sure being in the right place....
I have developped a platform for education based on the feather m4 express.
Most of my users speaks french and i'd like to begin a translation of the "circuitpython essentials guide" in french.
Is there a proper way to do it ?
thanks.
@fallow umbra I don't know the answer (for l10n for learn.adafruit.com) but I assume you are referring to https://learn.adafruit.com/circuitpython-essentials/circuitpython-essentials ? BTW, why did you choose that particular board and what age group are you targetting?
that it !
I chose this because i need to generate good sound (DAC) and i needed also python programming.
I made an adaptation board...
I target students in the age 15-18 (French "lycΓ©e") for teaching physics and programming
Looks interesting. I was curious if you had supplemented it with I/O extras. Is that your own Grove/STEMMA 8 port board?
As you may know, there's a lycee (Charles de Gaulle de Londres) in London in South Kensington near Imperial College. I don't know how high tech they are but they might be interested too and there's the bi-lingual angle.
I designed the board.
Standard arduino like port near the breadboard
Grove ports for analog (2), digial(4), i2c and serial
A stereo jack
An oled featherwing is attached on top to provide screen and buttons
As you may know, there's a lycee (Charles de Gaulle de Londres) in London in South Kensington near Imperial College. I don't know how high tech they are but they might be interested too and there's the bi-lingual angle.
@simple pulsar thanks for the info. French lycee have now microcontrollers in the physics program so they need microcontrollers whatever they are..
@gilded cradle Is there "displayio" for blinka, or do you interact with LCD displays differently than CircuitPython?
@fallow umbra Might be worth a post to the Educators forum to spread the word on your board and the link with French Physics curriculum https://forums.adafruit.com/viewforum.php?f=48
@fallow umbra Might be worth a post to the Educators forum to spread the word on your board and the link with French Physics curriculum https://forums.adafruit.com/viewforum.php?f=48
@simple pulsar didn't thought about it. Great idea.
@onyx hinge first make a 5.1.x branch and then we can tag there as appropriate. But maybe you did that already
@tulip sleet yes, I did the creation of the 5.1.x branch
ok, great, i didn't read back that carefully
that's fine π
I do want to hear if you have concerns about any of the stuff we merged in since 5.0.0 or have any specific items you would want to add before 5.1.0rc
scott chimed in that there was an LED thing that was broken and then fixed(?)
Quick question, I'm about to buy an Adafruit Bluefruit from a UK reseller for an elderly friend who is at risk of getting bored over next few months. It sounds like the Gizmo LCD screen works with that. Is that combo usable in CircuitPython?
@simple pulsar Circuit Playground Bluefruit + TFT Gizmo is definitely possible to use with Circuit Python.
There are a few circuitpython examples in the Gizmo library repo: https://github.com/adafruit/Adafruit_CircuitPython_Gizmo/tree/master/examples
@tulip sleet : i'd like to a start a translation of circuitpython guides, is there a proper way to start this?
These are the product pages for them (just to make sure we are talking about same devices there are a couple others with "Bluefruit" in the name): https://www.adafruit.com/product/4367 and https://www.adafruit.com/product/4333
Extend and expand your Circuit Playground projects with a bolt on TFT Gizmo that lets you add a lovely color display in a sturdy and reliable fashion. This PCB looks just like a round TFT ...
Circuit Playground Bluefruit is our third board in the Circuit Playground series, another step towards a perfect introduction to electronics and programming. We've taken the popular ...
Ta
He's a retired electrical engineer with a specialism in video. Will be interesting to see where this goes...
@fallow umbra I'm checking on who to ask
@onyx hinge : hello. is there already a build of the 5.1.x branch ? with ulab ? thanks.
@fallow umbra grab the "absolute newest" from the download page. ulab will be in that one, as long as it's supported on the particular board. (everything but m0 boards should)
@tulip sleet : thanks.
@onyx hinge the LED thing is https://github.com/adafruit/circuitpython/pull/2712
that fixes a regression I introduced via #2666. Are you subscribed to all notifications on the repo?
on the main circuitpython repo, yes, but I archive a lot of those messages without reading them π
@granite ingot I'm glad you got it working but I'm curious about which fix was the one that ended up resolving it so I can pass that on in the future. If you happen to figure that out, please let me know!
allocated 0x6005 (GOOS) for you :D
HONK BUTTON VID 0x239A PID 0xE005 # bootloader
PID 0x6005 # circuitpython
PID 0x6006 # arduino
π stay home, do synths! π
@onyx hinge : thanks i'll try this.
@fallow umbra let us know your experience ! by the way, which circuitpython board will you be using?
@fallow umbra, I DM'd you with translation info
@slender iron @tulip sleet are any of the other boards in Circuitpython cortex m7?
nope
Is that going to be something that extends outside the port, potentially?
@onyx hinge : a feather m4 express with oled feather and a home made adapter board.
board upgraded, found ulab. i'll perform some tests when i 'll have to do... and buy a pdm mic...
project : make a tuner for instruments... (why not ?)
or should the compiler handle the swap ok?
@ionic elk I'm missing the context for this; could you give me a time for previous posts?
@tulip sleet no particular context I'm just working through my makefile for changes I need to make as I implement the STM32H743
and one of them is altering mcpu=cortex-m4
Micropython has M7 support, but since Circuitpython hasn't supported an M7 board in a while I was wondering if there could be something outside the port level that has lost M7 compatibility
ah, ok, I think that should be fine. I think the issues are going to be memory access, etc.
@ionic elk imx rt is a cortex m7
@slender iron did any unusual tweaks need to be made or should it run fine if I swap the macros over?
arturo182 did the core of it but I expect it's just a compiler argument
@onyx hinge, there isn't a displayio for Blinka just yet. For now, use the Adafruit_CircuitPython_RGB_Display library. I made sections in all the PiTFT display guides for more details.
@gilded cradle thanks for confirming!
You're welcome
@gilded cradle are there other libs that work with it to show text or bitmaps?
Yeah, you'll want to use it in conjunction with the Pillow library. there's lots of examples.
got it
@solar whale You're very welcome!
Previously, the 0th pixel's value was always returned
I'm not sure we necessarily want to take this code, I wrote it while prototyping protomatter, using pixelbuf to hold the framebuffer.
It was useful to be able to index the pixels with (row,column) pairs. However, this is probably not the direction we're going to go with protomatter as we'd like to run it with displayio instead.
is it correct that we think "re-run all jobs" would work if we switched to checkout@v2, but that requires explicit handling of submodules? @slender iron
To see whether we will be compatible with https://github.com/actions/checkout/issues/176
we don't want to take this in the current form. Rather, we should give feedback to actions/checkout based on the outcome. Later, they intend to add this functionality in checkout@v2, and that is the change we should take.
I am still getting TypeError: can't convert 'int' object to str implicitlyin the scripts that run my two RFM69 nodes, and still can not figure out what is really triggering the error. The same exact functions run fine in Python3 and Circuitpython when they are in a small script (pack-unpack.py), but not in the node script (RFM69_Node_Test_103.py). I get python Traceback (most recent call last): File "main.py", line 197, in <module> File "main.py", line 76, in unpack TypeError: can't convert 'int' object to str implicitlyin the node scripts. The scripts are in git at https://github.com/geekguy-wy/Circuitpython_Goodies.
can you print the argument that unpack receives in both cases? print(type(st), repr(st)) or so
circuitpython: >>> gg_pack_unpack.unpack(b'\1\2\3\4') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "gg_pack_unpack.py", line 29, in unpack TypeError: can't convert 'int' object to str implicitly python3: ```>>> gg_pack_unpack.unpack(b'\1\2\3\4')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jepler/gg_pack_unpack.py", line 29, in unpack
o = ord(s)
TypeError: ord() expected string of length 1, but int found
when you have byte-strings b'...', and you index them, the result is an int. Perhaps when manually testing you are sending unicode strings '...'
also your pack() routine should probably return byte strings instead of unicode strings
is it possible you could change your code up, so that it uses struct.pack / struct.unpack instead of "manually"?
@onyx hinge Why is there no failure in pack-unpack.py then? It works just fine and produces the proper output.
I do not know. I just know that the exact same functions work in pack-unpack.py and they trigger an error in the node scripts. I do not know why this happens.
@idle owl I'm creating a couple of new libraries. One was cookie-cuttered about a week ago, and one was about half an hour ago. Should I update the pylint version requirements on both, and should I run black on the code?
'abcd'
>>> struct.pack('>l', 1633837924)
b'abcd'
What is this showing me? I do not understand.
@tulip sleet Yes. I'm not sure what state cookiecutter was in a week ago compared to what the libs look like now, unfortunately. And the PR to update cookiecutter is still open I believe.
I'll try to incorporate the PR as it stands now - thanks.
@timber mango Do you know about the distinction between unicode ("strings") and bytes in Python? If not, do you mind if I find you a link about it?
@tulip sleet I patched BLE_Adafruit last night, if that's one of the ones you're concerned about.
@onyx hinge No, I do not know the difference.
@raven canopy, yes that was one, thanks! I just created BLE_iBBQ, I'll update that to the PR
BBQ should only need the pylint version updated in build.yml (that's the open pr)
@timber mango okay, learning time then.
is there a task in the .yml's that runs black every time on push?
@onyx hinge I will see you in #help-with-circuitpython then.
BLE_Adafruit probably doesn't have the Black check though, @tulip sleet
that lib is still just a skeleton in the adafruit repo. I'll change my local copy
like kattni I'm sure, it's all a little squishy in my mind π€ͺ
ok, I have the latest black. Why are we pinning to 19.10b0 for black?
it's squishy in my mind too π I work on libraries just not often enough to stay current
could this be useful for stuff like
https://www.adafruit.com/product/1487
?
I'm getting pretty close to the memory limit of the CLUE (running 5.0.0 with some CircuitPython. I've noticed sometimes when I copy an updated code.py onto it I get a MemoryError but then it's fine on reloads after that. Anyone else seen this?
@ladyada yeah it sure might be
The "565-format" part would not be relevant, that's purely for protomatter
@simple pulsar that is odd; there are few things that stay in RAM between soft reloads, but I don't know why a second soft reload would fix things. There is a 4k filesystem buffer that gets created on demand on filesystem writes, if I remember correctly. It certainly sounds like you are at the hairy edge.
I think on CPX i've had it when I've been really really close to running out of memory in CP but then the occurrences feel random. This case is more predictable.
if you get stuck at some point we could take a look at the code and see if we can offer some RAM-reduction suggestions
if this is failing on import then .mpy may be called for, but that's a nuisance
Thanks. I've got a regular repeating bitmap so I'm going to see what TileGrid magic I can do with that.
Changing subject, am I right in thinking that as soon as a programmer does t1 = time.monotonic_ns() / 1e9 they are back to square one? My understanding is the 30bit FP thing is only when variables are stored too so intermediate values are all 32bit? And would an array.array('f', [0.0]) be a hacky way to store them as 32bit FP? (I don't need to do any of that, I was just thinking of explaining it in a corner of my latest guide.)
@simple pulsar short answer, yes.
32 bit fp doesn't gain you much
what monotonic_ns helps with is dealing in intervals. t0 = time.monotonic_ns(); do something; t1 = time.monotonic.ns(); elapsed_time_seconds = (t1 - t0) * 1e-9
this is equally accurate no matter how long the device has been counting up its clock
you can also convert it to a string of seconds by converting the number to a string and then putting in a "." π
Thanks. Yeah, I've got subtractions like that in my program but then i wrote a divide and store and looked at it and thought that ain't useful!
Hooray! Pew Pew M4 has arrived
i notice dict is not available on classes in circuitpython ofr accessing the attributes stored in a class obj. can anyone think of another way to loop through all the attributes on a class object?
this firmware is a little old, but i wouldn't imagine much along these lines would have been changed in the stable release. what are you trying access?
Adafruit CircuitPython 5.0.0-alpha.0-292-g7f64af38c-dirty on 2019-08-25; Adafruit Feather M0 Express with samd21g18
>>> class foo():
... def __init__(self):
... self.bar = "bar"
... def _bar(self):
... return self.bar
...
...
>>> test = foo()
>>> dir(test)
['__class__', '__dict__', '__init__', '__module__', '__qualname__', 'bar', '_bar']
>>> test.__dict__
{'bar': 'bar'}
oh...do you mean directly from the class, and not an instance?
i;m trying to do foo.__dict__
yeah, i'm not seeing any way without an instance. and that isn't going to match the mappingproxy that CPython gives.
if you know the attributes though, getattr() seems to work:
Adafruit CircuitPython 5.0.0-alpha.0-292-g7f64af38c-dirty on 2019-08-25; Adafruit Feather M0 Express with samd21g18
>>> class foo():
... x = "x"
... def __init__(self):
... self.bar = "bar"
...
>>> foo().__dict__
{'bar': 'bar'}
>>> getattr(foo(),"__dict__")
{'bar': 'bar'}
>>> getattr(foo(), "x")
'x'
any idea about this error?
pdp7@x1:~/dev/ohs20/fw/circuitpython/ports/nrf$ make BOARD=ohs2020_badge
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target 'extmod/ulab/code/create.c', needed by 'build-ohs2020_badge/genhdr/qstr.i.last'. Stop.
I have built ohs2020_badge ok before
yay! π
git submodule update --init```
ok. so we just dropped the --recursive. noted
I "think" so....
lol
i Have
Yeah we dropped it.
it still seems to be here https://learn.adafruit.com/building-circuitpython/build-circuitpython but I have stopped using it
@tulip sleet should that guide be changed?
@lone axle if you have any feedback, I'm all ears!
I will get started playing with it later tonight.
Updates:
adabot/lib/common_funcs.py::list_repos()fix to include Adafruit libraries that are forks themselves.- Pylint version validator.
.github/workflows/adabot_cron.yml: addsADABOT_GITHUB_USERenv var for use with the new GitHub API Authentication scheme.
@solar whale, ok, i removed the --recursive from the guide, at least for now
Thanks
at least for now
with git, all bets must be hedged. π
I certainly have no idea if it is needed or not -- just going by what has been working and what I was told to do...
same. i'm definitely a follower in that arena.
@marble hornet you can use dir() to get attribute names
That was my first (and current attempt) but it sorts the attributes . I found a workaround using decorators that actually improves the api. Interesting itβs not available though...
dictionaries that are sorted by creation order are a recent innovation in Python (according to the internet, this became a behavior of CPython 3.6 that was not a part of the language definition until 3.7. No version of micro/circuitpython implement this behavior.
Thie CI shows failures, but actually it's a success: The one sub-task I changed to checkout@master succeeded, and then succeeded again on "re-run all tasks". Another sub-task using checkout@v1 encountered the failure to checkout on re-run that has been vexing us for some time.
Once checkout@v2 is tagged to include the current checkout@master, we should update all our checkout@v1 to checkout@v2. I'll leave this PR open and rebase it later.
(wow that was already a long time ago .. time flies)
The last time I looked checkout@v2 by default does a --depth 1 clone, which doesn't work for us, because we use the nearest tag for version information.
To do a full clone, we need to add:
with:
fetch-depth: 0
See https://github.com/adafruit/circuitpython/issues/2683#issuecomment-595811252 for some more discussion.
@dhalbert thanks, I'll include that when I update this PR. Any idea whether we can turn the missing information (tags?) into an overt error at build time?
I may grumble while doing it but I actually love working on compile infrastructure.
@stuck elbow are the holes for the pins offset slightly to make extra friction with header pins?
yes, so you can plug a male header in there without soldering
and then plug the whole thing into a breadboard
Neat! don't think I've seen that before.
it's not super-reliable, but it's enough for blinking LEDs
@stuck elbow is there a driver needed for windows 7 to get the serial connection?
@lone axle same as for any CP board
though I'm not sure if it doesn't need the vid/pid changed, as I'm not using Adafruit's
It's kind of weird. It seems like it knows what it is but still lists under other.
looking at the sources at https://github.com/adafruit/Adafruit_Windows_Drivers/releases/tag/2.4.0.0, I think I would need to add the vid/pid there
problem is, I don't have Windows to build it
Thank you. I can give it a try.
I made this pull request: https://github.com/adafruit/Adafruit_Windows_Drivers/pull/24
Hahaha what a perfect PID. Thank you so much!
Looks great! One suggestion and you can follow up with a PR if you'd like to change things. HONK!
If you have the space, then you can remove these two lines and maybe get a bit of speed back.
Looks like the test wants you to alphabetize the board in build.yml.
Looks great! One suggestion and you can follow up with a PR if you'd like to change things. HONK!
Thanks for the tips and review, @tannewt!
@onyx hinge They (dictionaries by insertion order) are very useful at times, as you may be aware Perl's had that for a long time with https://metacpan.org/pod/Tie::IxHash
ordered associative arrays for Perl
@slender iron I have a pygame version of the watch's gui working if you want to take a try. the docs are a touch light but I did my best to comment some examples / i'm here over text.
tested on mac
I've got more things to try than I have time for atm. Do you have a short video or screen cap of it?
I'll be on show and tell tomorrow demoing it. if theres a way to can lighten the load I have time to spare. or point me in the direction of an issue? best of luck either way, here to help
I think we're staying in our normal mode with circuitpython
I will soon need help with testing the low power PR
can you ping me when you're ready
yup!
wip code is here: https://github.com/tannewt/circuitpython/tree/lower_power
AWS credentialing is maddening. well, their docs are maddening i should say...
@ionic elk It was the VBUS line. The code to deactivate VBUS was missing a couple bits. Here's the fix: https://github.com/jgillick/micropython/commit/679314a22ed78ede26b7d01646e4fd82aeb30b68
I got that directly from the HAL LL library USB_DevInit function:
https://github.com/hathach/st_driver/blob/3fc2e0f3db155b33177bb0705e0dd65cadb58412/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L293-L298
Once I run a few more tests on my board, I'll officially submit the PR for review.
Which CP supported micro is lowest power?
@arctic violet The SAMD21 boards are lower than the SAMD51, though not tremendously But Scott is working on low-power modes right now, so that time.sleep() and similar functions will actually sleep the processor, and draw considerably less current. we are thinking about wake-on-signal and the like
@slender iron taking a look. and very nice live stream. i'm listening to it while i'm squashing bugs and it's very relaxing
(makes mental not to read before hitting enter (a bad habit developed from poor commandline-ing ))
@tulip sleet wake on signals i think would be the perfect balance between interrupts and python
but can't wait for time.sleep sleep either way!
@gilded cradle I think the link https://adafruit-webbt-playground.glitch.me/ does not work. I got there from the https://learn.adafruit.com/bluefruit-dashboard-web-bluetooth-chrome page, so perhaps it is just a typo in the tutorial.
New nRF52 chip but with 32KB of RAM seems unlikely to handle CPY and BLE and have any left https://www.nordicsemi.com/News/2020/03/Nordic-nRF52820-SoC-the-sixth-addition-to-the-nRF52-Series
nRF52833 has 128kb, ran across this (quite affordable) Laird Wireless module that contains one https://www.lairdconnect.com/wireless-modules/bluetooth-modules/bluetooth-5-modules/bl653-series-bluetooth-51-802154-nfc-module
@lapis hemlock could you elaborate? I just clicked the link you posted above and it looks correct. Are you getting an error message or something?
@granite ingot it's interesting that was causing an issue for you, but didn't impact the USB on the Feather F412.
am I missing something necessary to allow creation of attributes on a subclass of a built-in class? I am creating the class displayio.FramebufferDisplay and I get an error when setting the "framebuffer" property:
class Protomatter(displayio.FramebufferDisplay):
def __init__(self, width, depth, rgb_pins, addr_pins, clock_pin, latch_pin, oe_pin, *, doublebuffer=False, framebuffer=None, rotation=0, backlight_pin=None, brightness=1.0, auto_brightness=False, auto_refresh=True, native_frames_per_second=60):
height = len(rgb_pins) // 3 * 2 ** len(addr_pins)
if framebuffer is None:
framebuffer = bytearray(2*width*height)
super().__init__(framebuffer, width=width, height=height, rotation=rotation, backlight_pin=backlight_pin, brightness=brightness, auto_brightness=auto_brightness, auto_refresh=auto_refresh, native_frames_per_second=native_frames_per_second)
self.framebuffer = framebuffer # line 12
Traceback (most recent call last):
File "code.py", line 6, in <module>
File "pmd.py", line 26, in <module>
File "Protomatter.py", line 12, in __init__
AttributeError: 'Protomatter' object has no attribute 'framebuffer'
@tulip sleet any tips?
a similar example works with _pixelbuf, I'll investigate it more closely. I saw signs that displays were also prepared for python subclasses, but maybe something's missing
n/m, it's my fault π π
(I have a property also called framebuffer, and it has no setter)
@gentle bronze I'm trying to wrap my head around why the F412 has a different USB-OTG implementation from the F405 and other similar chips. Do you have a sense for why the F412/F413/F469 have these additional registers? It isn't advertised on their product pages https://github.com/hathach/st_driver/blob/3fc2e0f3db155b33177bb0705e0dd65cadb58412/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c#L293-L298
Split rail feature, maybe?
Went to verify yesterday's Adabot update for contributing/, and saw that results are a day behind. Turn out that adabot_cron.yml takes longer than before, so while it runs fine it doesn't finish before the Jekyll build starts.
Contributing script:
- Started at: 4:45CDT
- Runtime: 20m 45s
Jekyll site build:
- Started at: 5:02CDT
This changes the adabot_cron.yml scheduled time to occur 45 minutes before the Jekyll build.
@tulip sleet do you think it'd be worth it to standardize mpconfigboard.mk variables describing the chip for the docs? Atmel and iMX use CHIP_FAMILY and CHIP_VARIANT but the nrf and stm ports have different stuff.
not high priority but I'm cleaning up my defines so I figured I'd ask
@tulip sleet thank you
@ionic elk it would be fine to clean those up. But the original motivation was the #defines needed to distinguish the chips and families for use by the different manafacturer's HAL libraries, so it needs to cover those cases. For instance, the nrf libraries sometimes distinguish different revs of the chip (NRF52840_XXAA, etc.) to turn on and off errata corrections. So I don't think this is high priority at all.
@tulip sleet I generally agree, the only place they get shared at all is shared_bindings_matrix.py in the docs folder
@arctic violet I've seen a wider variance by board than chipset
the LDOs on metros are much more wasteful than the ones on feathers
@indigo wedge ya, that'll be tight. could maybe be ok with only advertising and scanning support
yeah, could use it as a beacon
@tulip sleet @slender iron what is LONGINT_IMPL = NONE/MPZ? Is MPZ related to GMP?
@ionic elk there are two longint implementations: MPZ and LONGLONG. I don't know if MPZ's API is like GMP. GMP's licensing is LGPL and GPL, and so a reimplementation would have been necessary for MicroPython, since it and we use the MIT license
What is MPZ exactly? I say GMP because it was the only thing that came to mind, and I couldn't find anything other than that on google
multi-precision <something>. There are probably comments in the mpz source files that explain the acronym
we've never had to mess with the implementation, except for the tiniest things
How do I determine whether it's supported per chip? It's turned off for the SAMD21s as far as I can see?
it's only turned off on the small builds, and only for space reasons. There's nothing about an architecture that precludes it
this is some kind of python library that isn't even related to GMP?
Ah, so it's only for small chips
it's just the name of the internal longint impl
it was written for micropython, it's not a third-party library
or maybe mp is micropython
ok it's micropython specific. I thought it was some kind of chip feature
So I should just probably blanket turn this off
no, because then you won't have longints
LONGINT_IMPL = MPZ should be the default except when it doesn't fit
it's set up to be MPZ except for boards that need NONE
LONGINT_IMPL = NONE means longints are turned off, which is a big restriction
Sorry, I meant blanket on, that was a pretty bad typo
I don't think I have any boards that push the flash size when optimized
Ok, last makefile question hopefully @tulip sleet - the H7 has double floating point support. Can that still be turned on? I don't grep micropython's SUPPORTS_HARDWARE_FP_DOUBLE anywhere
@ionic elk you can set MICROPY_FLOAT_IMPL = MICROPY_FLOAT_IMPL_DOUBLE. But there is the question of whether a double float would be "boxed" or not (allocated separately). If you look at py/mpconfig.h, you'll see the different possible object representations (OBJ_REPR_A, B, C, D. Boxed floats are a lot more expensive in time and space. Only OBJ_REPR_D has unboxed double floats, and it has 64-bit ints too. This is used only for the Unix port, though there seems to be some latent support for it in ports/stm32/Makefile (NANBOX)
I'd get it all working with single before you try double. 64-bit ints and objects will use more RAM, and some library code might make assumptions of 32-bit ints.
@tulip sleet Are you referring to C "library code" or something else?
both
both C and Python. I'm just saying there may be latent bugs that assume 32 bit only
ok last last question @tulip sleet does this line actually have a purpose? LDFLAGS += -mthumb -mcpu=cortex-m4 it doesn't make any difference on my compilation whether I include it and Micropython does not include it. I don't understand why the linker would care about instruction set selection and core optimization.
it's included in every port of CPy though
it might be needed for LTO to do proper link-time optimixzation
It doesn't seem to impact my flash or ram sizes - or would it be something speed related?
do you have -flto enabled?
it will slow the build down but shrink the image
it's highly necessary on the M0 boards
I have at least one question about the RFM69 library.
@timber mango could you ask in #help-with-circuitpython ? tnx
this is more a dev channel. it's true the devs hang out here, but we also are doing dev work, so there may be more eyes over in #help-with-circuitpython
@tulip sleet wow yeah it saved like 40kb
The presence of -mthumb and -mcpu=cortex-m4 still don't seem to do anything though
but I'll keep them anyway just in case
@slender iron hey! I have good progress on protomatter but there are some problems regarding having the new FramebufferDisplay object survive soft resets. Can we have an audio or video chat about it tomorrow or monday? I'm pretty open on times, with a skosh of planning
@onyx hinge totally! I'm free all day tomorrow
@slender iron excellent. you wanna do 2 - 2:30 your time again?
nah it's fine
I feel like my better coding time comes in the mornings, maybe, but talking in the afternoon gives me time to reflect before putting it into practice
smh etc
yeah you're right
I would like to thank this whole community for enabling me to create absolutely ridiculous things like this: https://twitter.com/theavalkyrie/status/1240737231469293569
It's a lovely day in the studio and you are a horrible goose. π¦’ https://t.co/ZUaxmRBAta
it's running roughly 40 lines of CircuitPython. π
and the module on the left is also running CircuitPython.
@ionic elk is there a config setting for whether each STM board has a low speed, 32.768khz, external crystal?
The big honking button, it actually honks!
@tulip sleet This channel seems to be more for the "core" developers. Anyway, I am going to take my wonky head and lay down or something. Not feeling well.
This helps to change the backlight!
Anyone around that could answer some questions about /supervisor/shared/rgb_led_status.c?
Michael reminded me that due to the design of the board this will have inverted logic for brightness, so full bright would be 0.0. I'll take a pass at adding the flag to the display constructor then re-visit this
with an error like this:
Traceback (most recent call last):
File "code.py", line 5, in <module>
File "/lib/adafruit_imageload/__init__.py", line 61, in load
File "/lib/adafruit_imageload/__init__.py", line 52, in load
File "/lib/adafruit_imageload/bmp/__init__.py", line 69, in load
OverflowError: long int not supported in this build
Is there possibly something I could change inside of imageload to get it to work? Or would it need to be done in the build of the system on this device? Haven't run across an error like this before.
I don't understand the stacktrace either. Line 69 is from . import indexed but line 71 has a call to load()
@brazen cedar please just ask the questions instead of asking to ask. That way we can get back to you later if you are no longer around
@slender iron ok will do.
Danh of the past taught me the root cause of the error here: https://github.com/adafruit/Adafruit_CircuitPython_SD/issues/27. I don't quite get how the stacktrace works still but I was able to work around it for now and get imageload working.
In /supervisor/shared/rgb_led_status.c on line 147 there's this block of code that repeats for each pin of the RGB LED
#if defined(CP_RGB_STATUS_LED)
if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_R)) {
pwmout_result_t red_result = common_hal_pulseio_pwmout_construct(&rgb_status_r, CP_RGB_STATUS_R, 0, 50000, false);
if (PWMOUT_OK == red_result) {
common_hal_pulseio_pwmout_never_reset(&rgb_status_r);
}
}```
I found that if I comment out the line with the _never_reset function I can gain control of the RGB LED in user code. But what is the purpose of the never reset function call?
I'm trying to wrap my head around what's going on in that file with regards to status on the RGB LED and the logic around that function.
never reset is used to prevent the supervisor from resetting the pin effectively disconnecting the PWM
But the thing I noticed is when that _never_reset line is commented out and I try to PWM the RGB pins they all turn on regardless of how many pins I PWM. One PWM pin turns on the other two
@slender iron don't we want to make the PWM available for those pins? Am I approaching this the wrong way?
I'm not sure if we need never reset actually. what you do need is for "reset" to actually connect the supervisor's PWM back up
https://github.com/adafruit/circuitpython/blob/master/ports/nrf/common-hal/microcontroller/Pin.c#L76
pin busy tracking is done with static bools
https://github.com/adafruit/circuitpython/blob/master/ports/nrf/common-hal/microcontroller/Pin.c#L97
basically copy how MICROPY_HW_APA102_MOSI is done
I'm trying to understand, I'll take a look at that section of the code.
@arctic violet It looks like the STM32F4s are more power hungry than SAMD or nRF because it doesn't have per-peripheral clock control
(when idling. in standby they are probably more comparable)
is the language syntax "->" a lambda similar to the C# notation "=>"?
I don't know the C# equivalent
it dereferences the pointer and then accesses the field
foo->bar is the same as (*foo).bar
Is the code considered C++ or just C? (so I know what references to read)
C
sorry for all the noob questions π
a pointer is a memory address. you can get a pointer by doing uint8_t* baz = &foo; and the *baz is the same as foo
I think get it. Pointers aren't used much in C# being a managed runtime where a lot of stuff is done for you (memory allocation, garbage collection, etc)
@slender iron I updated all the code in Pin.c to support the Xenon status LED but I'm not sure how to go about testing all the extended functions. What do you suggest?
@tulip sleet @slender iron i've got a working grasp on using boto3 to pull S3 metrics with CloudWatch. however, i think granularity might become an issue. in order to drill down to sub-object (folder/* vs the entire bucket), you have to setup filters attached to each prefix (the folder, basically). i can work all of that out on both the adabot and core sides; retrieve and update respectively. the issue is, you can only have a max of 1000 configs. which, we're over now with board*lang, correct?
yes, it's >1700 now
but we can get the raw log files, I thought. Justin is dropping them in a new bucket
still an option, definitely. i haven't looked at them yet...
not public accessible π¦
i think there might be a privacy issue with making them public if they have the fetcher's ip address
yeah, understandable. i was a tad melodramatic with my pouting. hehe
we could still do each board, with stable and dev up to 500 boards.
no, not complaining about your emoji π
oh wait... i forgot about the archival nature of the s3. π¬
even with the filters, that might be too much to ask of boto. let me see if i can get down to the file level on my s3.
i am getting access denied on the bucket too. I'll ask to get added and see what they look like. We could run a privileged job somewhere that processes them.
yeah, an access key with readonly should be fine.
i'll let you know when I have some samples
filtering to a file works with CloudWatch, so that's good to know.
did the aws mgmt console login change recently, my old login link is failing; now I need my IAM username instead of email
are you using MFA?
i had to resync Google Authenticator this morning, after having zero problems last night. π€·
hmm, I was having unrelated authenticator problems with slack today
but not yet, I'm not even past the login screen, because I don't have the very very very long user id for myself
hmm. email isn't working for root?
it says i am not a root user; maybe I was and am no longer? will have to ask about that
if its org account...i am of little help. π
right, i was just guessing you use it all the time yourself for your regular jbo
nope. and...i'm happy about that. haha
Azure's interface is sooo much nicer.
(but, i don't use that day-to-day either)
aws's console is the most complicated management console I have seen by like an order of magnitude
i think i found a serious bug
... def __int__(self): return 5
...
>>> g = x()
>>> int(g)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't convert x to int``` instances of classes can't be cast to ints
i feel both are strongly biased towards their CLIs, but that makes sense as most of the admins will be on servers anyway.
it is in both the beta and the current master
did it ever work
like in 4.x
that is the kind of obscure feature micropython would have ignored
ill check
it should wither way. i disagree: it's part of the definiton of how python works at the core isn;t it.
allowing you to redefine int()
there is overhead that comes with supporting all of the dunders...
but int?
micropython trades some flexibility for speed
but in practice why would you want to define your own int()?
some class representing data, or where you want to perform mathematical calculations with it, there's normally a way around it but i'll see if it was explicitly excluded
it was excluded, but then how can you cast to int?
you could write a method to do it and call it explicitly
def int(self): ...
g.int()
yes, it's hardwired to call that; it doesn't look for __int()__ for string.
thanks!
the way i am making my api i can write a workaround for users but i'm surprised. guess one would wan't math to be fast...
but then what defines what can and can;t be turned into an int?
on a diff topic, i got the idea this morning of some kind of simple gui builder for displayio that you could use to lay out buttons and labels, etc., set some properties, and then it would spit out the boilerplate. I used such tools years ago for other GUI toolkits, but they were all standalone executables. do you know of something like that that might be a starting point, but was web-based, or say something like a vscode plugin? I found a few but didn't research it thoroughly
ooh, nice idea. short answer: I don't know of a specific tool that would work off the bat.
long answer: qt has a builder and exports a file to define what it should be but I think it would be too much and features cp doesn;t have. I know anvil has a python to html version but it is closed source.
I choose to write python code to simplify the boilerplate at runtime, I can send you some code examples of what I think felt natural.
what ones did you look at?
i only just found that there are some web and vscode ones that exist, didn't have time to look at anything. i had stumbled on Nextion editor, which is proprietary, and it reminded me of the old motif, Java Swing, etc. builders I had used. i thought perhaps there were some web-based ones for some javascript ui framekworks that we might gut and reuse. it's just an idea, we may set someone loose on it at some point
do you know what features you'd want?
i don't know; i've barely used displayio, and buttons and labels myself. I'd guess placement, font, button shape, foreground background color, background images, gridded layout, outlines, etc. Just to ease creating the boilerplate. would work on a variety of display sizes. I believe you have a fancier GUI toolkit
doing some digging
and Β±...
i gotta π€, but thanks if you have any ideas. don't spend a lot of time on it; i just thought you might be familiar
got it, and sleep well. it is an interesting though tho...
@tulip sleet for when you wake up this project is opensource and web based. https://v1ack.github.io/watchfaceEditor/
i think the best bet would be to go either web based or python. i think if displayio was ported t blinka it would be a lot easier to navigate this problem as we would not need to emulate displayio to test out how it looks. I'd let someone loose on that.
or a runtime simplification...
@brazen cedar if you can PWM on the pins yourself, let the code.py finish and the status LED starts back up that'd be a good first test
@lapis hemlock could you elaborate? I just clicked the link you posted above and it looks correct. Are you getting an error message or something?
@gilded cradle Yesterday I got an "address not reachable" or something similar message, but it works now. It must have been a temporary glitch. Sorry for the noise!
@slender iron re: clock question: yes, you have to set up the RTC settings. I don't have any of that in clocks.c yet but I can do it real quick if you need it for low power
If you don't mind downloading big clumsy apps, CubeMX actually has a pretty nifty clock visualizer/solver
And even a power use simulator
No problem @lapis hemlock. Glad it's working for you now.
Google just announced/released an embedded 32 bit toolkit called Pigweed. Targeted at things like ARM Cortex-M that will execute out of flash.
It's still not ready for inclusion, but I've heavily reworked this PR. See the initial comment for much more information, including a checklist of known problems. The one I'm worried about is the problems with auto_refresh / surviving soft reset, because the design requires this Python Protomatter class to work. This design may simply not be workable, so hopefully @tannewt has some ideas about how to restructure it so it can work. Rotation is "probably a shallow bug" but I haven't looked ...
@slender iron re: clock question: yes, you have to set up the RTC settings. I don't have any of that in clocks.c yet but I can do it real quick if you need it for low power
@ionic elk I've got it setup
@slender iron anything else I can help with?
@idle owl I'm quite proud of myself. π₯³ I think I got my rfm69 PR updated properly and so it is compatible with the recent changes. It was not nearly as difficult as I had expected. BTW "black" and the updated pylint are also working well for me. Thanks for your help
@solar whale I'm happy to hear you're back on track!
and it looks like a simple pip3 install black now works on the Raspberry Pi
it installs v19.10b0
@solar whale yeah the people with piwheels were very responsive in removing that broken version once it was reported. I wonder how many other people had the problem too -- v. nice to have it resolved.
@slender iron when can we chat about display object lifetimes and the problems I may have created for myself?
I think the rotation thing is a bug with the settable rotation property, I don't reproduce the problem if I use the constructor's rotation=
so that's something
@onyx hinge just back from lunch now
@slender iron π I can dig on this rotation problem for a bit
I'm happy to chat now so that I can catch state of the fruit at 2:30
okay, that's fine too. hopefully we can keep it short.
for background: My design has a FramebufferDisplay, a subclass called ProtomatterDisplay. This has a buffer and a _protomatter.Protomatter object. After restart, the display goes down and it hardfaults soon after
want to video on discord or slack?
either one works for me. slack seemed to work good last time.
Just found my other Trinket M0, did some fun HID stuff on it.
Also I found the perfect protective case for the device: simply get some free USB stick, remove it's inside and glue in the Trinket M0. π
But glue only the bottom side so you can reach the button whenever required
I am hoping to find some microusb to usb a adapter
with no cable inbetween at all
>>> SPI.frequency
250000
>>> SPI.frequency = 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'SPI' object has no attribute 'frequency'
>>>
```Found yet another bug
@flat delta frequency is a read-only attribute. if you wish to change it, use configure(baudrate=nnn). The AttributeError is caused because there is no setter function defined. That could be rectified, as well as the documentation of the read-only nature of frequency. mind filing an issue?
mh too lazy lol
I have found 2 bugs already, probebly I should create a list and issue them all at once
@ionic elk That is odd that it wasn't a problem for the disco board. Not entirely sure why they'd be different. My next task is to see if I can get nvm setup. I've noticed that it doesn't look like it's enabled for the stm port, is there a reason or has it just not been done yet?
Where can I find the .py image file for the pybadge with tensorflow...?
@steady osprey The tensorflow demo isn't CircuitPython. It's Arduino
So, how would I run the demo on the pybadge...?
This looks like the closest guide: https://learn.adafruit.com/pybadge-case-with-flip-out-mic
@ionic elk I can just use TIM6 for a PulseIn reference clock right? Just like PulseOus uses TIM7?
Formerly, if you wroteSPI.frequency = 0 you would get the sightly erroneous error messageAttributeError: 'SPI' object has no attribute 'frequency'. In this case, a better message would read AttributeError: 'SPI' object cannot assign attribute 'frequency'.
This new message will both be used in the case where the attribute doesn't exist at all (and the object has no dynamic attributes; most instances of built in types behave this way), or if the attribute exists but is read-only.
Th...
@flat delta Thanks for bringing up that particular error message. It has caught me out in the past too. I've filed a pull request to improve it.
Hello, I have a problem, I am trying to connect my adafruit M4 board by tcp / IP connection, but the following errors appear in the serial communication console, could someone help me?Traceback (most recent call last):
File "code.py", line 38, in <module>
File "adafruit_esp32spi/adafruit_esp32spi_socket.py", line 83, in connect
File "adafruit_esp32spi/adafruit_esp32spi.py", line 713, in socket_connect
File "adafruit_esp32spi/adafruit_esp32spi.py", line 641, in socket_open
File "adafruit_esp32spi/adafruit_esp32spi.py", line 326, in send_command_get
response
File "adafruit_esp32spi/adafruit_esp32spi.py", line 288, in _wait_response_cmd
File "adafruit_esp32spi/adafruit_esp32spi.py", line 200, in _wait_for_ready
RuntimeError: ESP32 not responding
Will a displayio TileGrid be more memory efficient to draw a repeated pattern on screen? I've got a 200x200 bitmap which I can chop up into 4x4 of 50x50 ...
Say you want to create a memory efficient 1-value graph in a TileGrid. You need a grid of Wx1 tiles, and you need to be able to place a single "1" pixel among (H-1) "0" pixels.
Right now, to do this you need to have a WxH bitmap. In tile 0, the pixel at Y=0 is set. In tile 1, the pixel at Y=1 is set. Total bitmap usage increases according to W*H, so it can add up to a lot. To put the pixel at height Y, you just use tile #Y.
If you could specify tile_width=1, tile_height=1, then a m...
The non-quantitative answer so far appears to be yes!
I would think it is supposed to work. What did you find?
I put the following in boot.py
print("boot.py started")
x=1
while x<=10:
print(x)
x=x+1
print('boot.py finished')
sometimes it works correctly and the numbers end up in boot_out.txt, sometime boot.py gets corrupted and there's an error in boot_out.txt, and other times the GUID thing happens
Pressing the reset button shouldn't corrupt files right?
As long as they're not being written at the same time of course.
hmm, that does seem strange to me. But to be honest I've never personally used boot.py for anything except making the storage writable.
I shortened the code in boot.py to just a print(1) it does this with the two files on board reset:
@slender iron hmmm. I might need to double check but I think that should be ok? both of those clocks are tied to the DAC, so if we use both we won't be able to do DAC trigger stuff in the future without changing them.
Note that they have a different interface than the general purpose clocks as "basic clocks" and the HAL basically doesn't acknowledge it, so you'll probably want to just look at the reference manual and my existing implementation
Hmm, now I'm getting
Press any key to enter the REPL. Use CTRL-D to reload.
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
File "main.py", line 12, in <module>
File "/lib/neopixel.py", line 132, in __init__
TypeError: function missing required positional argument #2
Ah, nm. Realized I wasn't running 5.x circuitpython. Upgraded to 5.x and it works now. Boosted my frame rate from 4 to 30fps with 24 pixels. Thanks!
@ionic elk I feel like we should move it off the basic timers so that it can work on all the mcus
@spice crypt I don't know of anything between circuitpython and raw C. It depends what you want from each. I like that you can hook C into CircuitPython.
Much clearer, thanks!
Tested on a Trinket accessing read-only and non-existent attributes. Messages make sense.
@slender iron If we used DMA we might be able to avoid the use of secondary timers altogether, but it'd be a bit of a job
what would the DMA do?
I posted an appnote way back but you can batch timings from memory into the TIM module to achieve spaced carrier pulses without the need for a secondary interrupt timer
Thus it only takes a single timer
Does anyone know the proper settings for the 1.3inch minitft display (240x240) the demos use display = st7789.ST7789( board.SPI(), cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE, width=135, height=240, x_offset=53, y_offset=40, ) for the 240x135 -- just changing the 135 to 240 leaves the screen partially filled -- what are the correct offsets?
I'd try x offset 0 as a first guess
I treid that -- but it still does not fill the screen
https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/clue_nrf52840_express/board.c#L68 here's what clue uses
Hooray @solar whale
Hey guys, I have a question. Why isnβt the esp32 supported from circuitpython
? Iβd really like to usr some libraries like the ones for displays.
*use
@timber mango the esp32 does not support native USB so it cannot appear as a USB drive which is a core feature for CircuitPython. THere is hope that the new ESP32-S2 (?) chip will be able to be supported.
This PR makes the following STM port changes:
- Adds the Thunderpack board
- Adds NVM support.
- Fixes an issue with disabling VBUS sensing.
Got another case of something similar here, copied some update .py files onto a CLUE and it seemed to get stuck running the code, control-c shows this stack trace (tried it three times):
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 47, in <module>
...
if a library is missing the adafruit_ prefix does that mean it was originally developed by someone non-adafruit but it was still contributed? simplio is the one that I am looking at atm.
it may be so old that the convention was not employed yet
I think that you would be much better off just having a single tile, and painting the pixels on the underlying bitmap with something like that.
Ah hadn't thought of that. I spent longer than a care to admit looking in the adafruit_s section of the alpha-sorted library bundle before I figured out it was at the bottom. It made me curious though be cause the repo name matches many of the others with it's prefix like Adafruit_CircuitPython_SimpleIO
The repo name could have changed at some point though, and changing the library name would break imports in tons of places I assume, so I can see why it it may have stayed that way.
I'm graphing literally at the moment using this code in https://github.com/kevinjwalters/circuitpython-examples/blob/master/clue/plotter.py
My main issue is clearing the graph to redraw it, clearing every pixel in CircuitPython is too slow, see #2688 for potential improvements here. Store the drawing data and undraw each pixel/line approach for now.
Efficient scrolling of Bitmaps would be nice too. I'm also wondering if some simple compression underlying storage makes sense for certain ...
You don't have to clear every pixel. You can clear only the ones you drew (for example, draw the same graph, but in black), or simply make a new bitmap.
@lone axle Exactly. Same with NeoPixel - the overhead to change it would be astronomical.
Everything else we were willing to update.
I see. Thank you for confirming π
@idle owl Will Blinka get gamepad at some point?
@timber mango unlikely because Linux is higher level than CircuitPython itself
one could write one in python
Write what?
Making a replacement sounds useful but wasn't in my case for a Bitmap with 20100 bytes storage - I guess the heap was fragment ed and for some reason the previous object (same size) didn't GC to leave enough space.
a gamepad module
it won't do debouncing and buffering, like the original does, but it should be good enough in a cinch
If there was no allocation between releasing the old bitmap and creating the new, there should be no fragmentation. I suppose the displayio internals may be keeping the old buffer alive until a frame finishes drawing, though.
HackSpace Magazine had an article last month (March 2020) on getting the SNES gamepad working on a BeagleBone Black. Arguably, the article was mainly about highlighting its PRUs (programmable real-time units). Not something I had heard of before.
@slender iron That should not prevent adding gamepad to Blinka though, unless maybe gamepad needs to own a particular resource the system needs.
@slender iron It would just be very nice to have gamepad, or something similar to it, for Blinka. I might like to run a robot under Linux and it would be extremely nice to have that sort of switch processing with Blinka too.
@timber mango they way it is implemented currently, it does
What is up with these NotImplementedError: keyword argument(s) not yet implemented - use normal args instead errors popping up when there is no probem?
@timber mango it either needs a timer interrupt or a pin interrupt to work reliably
@timber mango it either needs a timer interrupt or a pin interrupt to work reliably
@stuck elbow Could a pin change be used? That could function as a switch just as good as a real switch.
that's what I mean by pin interrupt
Oh, OK. It still seems like something might be workable for Linux. I am no Linux guru, so maybe my thinking is wrong on this.
it depends on what the library that Blinka uses for handling pins allows, I don't even know what is used under the hood
a naive implementation that just gives you the current state at the moment of call should be possible without any special interrupts or such
a naive implementation that just gives you the current state at the moment of call should be possible without any special interrupts or such
@stuck elbow This would defeat the purpose of what I need though, and might mess with stuff by others too. People write native games for Linux which require a level of responsiveness, which makes me think that something like this should be possible with Blinka too.
afaik, most games on a RPi utilize a controller via USB/serial, so the kernel handles the interrupts. the GPIO are different, and their interrupts are not guaranteed and have a lower priority. however, it looks like RPI.GPIO (which Blinka uses for GPIO interaction) has some interrupt utilities: https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
i can't speak to their reliability, however.
Maybe a subprocess that would poll the GPIOs or switches and send info to the main process would work. I have not really worked with the subprocess library much so do not know if this would gain me anything.
@jepler Why use a single TileGrid and Bitmap? It sounds like you want W 1x1 tilegrids, one for each pixel. Then you only need a 1x1 Bitmap. A scroll will generate 2W 1x1 areas to update but we could have TileGrid detect it and produce 1 2x1 area instead.
Should this be inverted? Seems like you want to do this when BOARD_NO_VBUS_SENSE == 0.
What do you mean by "USB (Shouldn't be used)"?
Thanks for this! It looks like a really interesting form factor!
Did you actually run into memory issues? I'd expect there to be room in the 128k for 16k since not much code can be loaded from the small file system.
I'm not really sure. I copied this file from the stm32f411ce_blackpill board. I'll remove those comments since they're unclear (and make no sense to me).
No, I guess I was just being overly cautious. I was also assuming that if someone wanted to do logging, they'd do something like this.
I can give the full 16k a try and see if it causes any problems.
Hello.
I'm also struggling with this replacement. Have you planned to work on this?
Can we help?
Thanks.
I am getting this errorpython Traceback (most recent call last): File "main.py", line 240, in <module> File "main.py", line 117, in sendPacket NotImplementedError: keyword argument(s) not yet implemented - use normal args insteadin the attached file. I need to get this figured out and fixed before I can move ahead.
@timber mango this has to do with MicroPython's bytes() implementation. the kwargs trigger the NotImplementedError, and positional args in my test (Feather M0...so may differ) just get ignored.
https://github.com/micropython/micropython/issues/567
it also happens with str()
@raven canopy I consider that a bug.
@raven canopy Not using the kwargs gets me:python Traceback (most recent call last): File "main.py", line 238, in <module> File "main.py", line 122, in sendPacket TypeError: wrong number of arguments
New updated script. Line numbers changed.
Line numbers match the TypeError line numbers.
I consider that a bug.
I assume you mean a bug, as compared to CPython? I'm not a pro at reading CPython's source code, but supporting the kwargs looks like it would be difficult in a microcontroller capacity.
what is the purpose of outBytes? i don't see it being used (yet). would a try/except, followed by a .decode() serve the same goal?
@raven canopy It is a bug, as in it does not work. Kwargs work for other parts of Circuitpython. Why not this part??
outBytes is the encoded packet of bytes that will be sent over the RFM69 radio.
If there is an error in a function call, I have to assume the function did not finish and the output is unusable.
Why would I do a .decode()? I need to encode data to be sent over radio.
sorry. should've been str.encode(). Python docs only explain encoding and errors in the str implementation.
In this case, if object is a bytes (or bytearray) object, then str(bytes, encoding, errors) is equivalent to bytes.decode(encoding, errors).
Hmmm, interesting. I do not get that. Well, my brain can not get wrapped around that.
anyone know how to send data over wifi using esp8266?
nobody ever
Hi there,
I would like to know, if and how it is possible to mount the boot loader's filesystem on a board via the storage module?
The idea is to upload a new uf2-firmware programmatically and then to a soft reset by microcontroller.reset() to install the new firmware.
Thanks a lot.
Matthias
@golden sail you can use an esp32 with the nina firmware on it as a wifi co-processor
I think I have missed the announcement, is today's weekly meeting still on?
@lapis hemlock should be -- see the "pinned" message on this channel
@lapis hemlock Announcements are sent to everyone in the circuitpythonista role. You should get added to that role.
that is an interesting form factor (thunderpack) https://raw.githubusercontent.com/jgillick/ThunderPack/STM32F4/images/breadboard.jpg
The related bug is marked closed:
Thanks all for the feedback! I updated V2 to include the recent submodule/SSH changes from master.
I will update this PR soon to use checkout@v2 with submodules:true and fetch-depth:0 for all checkouts.
This switches us to the current version of checkout, which has recently added support for a feature we use (submodules). This feature was in v1 but was not initially in v2. It was recently added to v2.
For more background, see https://github.com/actions/checkout/issues/176 and #2718.
Things to check: that the checkout includes the needed tags that fetch-depth 0 is intended to add.
Besides just keeping modern, it appears to be the case that checkout@v2 works properly when re-running...
@lapis hemlock Announcements are sent to everyone in the circuitpythonista role. You should get added to that role.
@timber mango Well, this is certainly an answer, but even if I got the announcement, I might have missed itπ
@lapis hemlock should be -- see the "pinned" message on this channel
@solar whale Thanks! That clarified the issue.
@lapis hemlock I verified you are "in" circuitpythonistas. You may want to check your server notification settings. on desktop client, there's a "v" next to the adafruit robot, click it to get a menu. In notification settings you want to make sure that your notifications are set to any level but "nothing" and that 'suppress role mentions' is off. You can also right-click the circuitpython channel in the channel list and control some of these things on a per-channel basis
here's more documentation about notifications: https://support.discordapp.com/hc/en-us/articles/215253258-Notifications-Settings-101
that article is certainly written in an interesting style
This looks good to me in terms of style, but I'm wondering if we can wrap this into the usual flash write API to save some of this flash waste. @tannewt do you think it'd be feasible to put NVM at the end of an existing flash sector, like the last sector of the filesystem? The internal flash write already has RAM allocated for copying and editing sectors in the internal filesystem region.
I would suggest `#if !(BOARD_NO_VBUS_SENSE) as it is simply omitted for most boards and is better in line with existing flag style.
These pins are exposed on the STM32F411 Blackpill, despite also being tied to USB. Unless you manually disable the USB and intend to use Circuitpython using the serial REPL or some other method, they shouldn't be used on that board. I'll make a note to improve the documentation on this point.
Missed this on my first review - this section should only be used for pins that are exposed for user purposes on your physical board breakout - you don't need to list PB4 as anything other than "BUTTON" since it is not exposed to a breadboard, and you should not list pins PA11 and PA12 here since they are USB only and should refuse user access.
Additionally, please name the pins off of what is actually used in your silkscreen, IE PA1, PB5, etc - the A and B contractions here based on what...
<@&356864093652516868> Weekly meeting in ~2 hours. Everyone is encouraged to attend! Please add your hug reports and status updates to the notes, even if you'll be attending the meeting - it's super helpful! Looking forward to chatting with you all soon. Thanks! https://docs.google.com/document/d/1XThAvWXJ-9gQJQ9y4ME6Tz7oRQsSzMzG_aE_cGeWzt8/edit
@lapis hemlock I verified you are "in" circuitpythonistas. You may want to check your server notification settings. on desktop client, there's a "v" next to the adafruit robot, click it to get a menu. In notification settings you want to make sure that your notifications are set to any level but "nothing" and that 'suppress role mentions' is off. You can also right-click the circuitpython channel in the channel list and control some of these things on a per-channel basis
@onyx hinge Thanks, Jeff! It might very well be that I got the e-mail, but accidentally deleted it. In any case, it seems I can't make the meeting today. Because of COVID-19, we have now somewhat unusual working hours. π
@lapis hemlock The notification would show up exactly like the message I just sent. That's what you'll want to keep an eye out for in the future.
@lapis hemlock The notification would show up exactly like the message I just sent. That's what you'll want to keep an eye out for in the future.
@idle owl OK, thanks!
@onyx hinge Jeff, I had a linker problem in micropython, when I added around to my code. It turned out that roundf.c was not included in the makefile. I tested the SAMD port in circuitpython, and it worked all right. I haven't checked the other ports, so if you run into difficulties, roundf.c is the culprit.
Thanks! Then it should be good to go.
It appears that to implement the Python function round(), micropython actually calls something called nearbyint, including in the case of rounding a float to another float with N digits of precision
I will look into that. It might be better with nearbyint, I don't know.
You don't know by any chance, how a make variable can be appended to on the command line, do you?
I don't think it can but I'm not sure.
That's what I feared.
it seems nearbyint, rint, and round all differ on how they round certain borderline cases
Well, that means that I have to dig into the numpy implementation. The easiest way of ensuring compatibility is to call the same function.
I've got to go now. π
I prefer the old style rounding. < 0.5 down and >= 0.5 up.
Has anyone worked with the feather/wing doubler/tripler/quadupler thingamajiggers?
Yes.
i have, yep
Soldered a quadrupler yesterday, as it happens.
I'm wondering if there's an elegant way to connect pins to each other, like sda/scl.
Other than just soldering bodge wires.
Yes from one feather to another wing.
They should already be connected
The power and ground are ganged together, but not the rest
The rest are connected as well
You add headers to the doubler/etc, and then put a Feather and whatever Wing(s) on it and they work.
No bodge needed. It's not simply proto space.
Solder mask kind of hides them, but they're there
Hmm. The power and ground are obviously connected. But I didn't think the rest were.
They are π
Ah. I just looked very cloesly and now I see the traces.
π
I will not be at the meeting. I am not well and am going back to bed.
@timber mango Taking care of yourself is more important. Hope some rest helps.
I'll read your stuff during the meeting - thanks for adding it.
I would definitely like to be able to see this info on the board pages. I think the minimum or intermediate proposals would be a great start. Filtering sounds cool but I'm not certain if I'd use it personally. I tend to go looking if a certain device supports a certain thing more than which devices do support this certain thing. But who knows, if it were implemented maybe I'd use it more than I think.
We don't have plans to work on it. My priority would be to support a second CDC connection that is separate and doesn't do any munging.
Basic assembly complete, CP 5 installed.
I have a quad-feather with a new m4 express and a 3.5 inch screen to assemble yet.
Lurking today (as usual) π will note it in the doc.
I'm just lurking as well.
Happily lurking, and will need to bail early due to work π
Yep
π
@lone axle Your mic is on π
@lone axle can you mute ?
oh I have to remember to take notes today
I have set a server mute on @lone axle let me know when you are joining us and we'll take it off.
Sorry about that
It'll be a couple of minutes, finishing other meeting.
Yep
Yes
@idle owl we'll hold the fort
lurking (or not there) ... trying to edit the doc as fast as I can.
lurking today
@onyx hinge ....we have a fort now? Wicked awesome. π°
lurking today
LOUD and clear charles
lurking
lurking in place
starting to add names to the list, let me know if you're lurking. thanks to those who have.
@tidal kiln not socially lurking?
both maybe?
π
Yes
Lurking
ok @idle owl and @slender iron looks like i might be here for a couple mins yay
If anyone has good projects, news, interest items on Python, CircuitPython, MicroPython, and related materials, please email anneb@adafruit.com for the CircuitPython Newsletter
Is the audio cutting in and out for anyone else or is it just me?
pretty solid for me
ok here
It's pretty solid for me.
I think I got everyone who stated they were lurking
I just got flagged for seying hello
I'm lurking some of the time
@serene warren you were missing a letter from the word "hello" and so it hit the filter
Ahhh. Got it. typed without looking
LIMITED SHIPPING Adafruit Industries, Essential manufacturing business: NYC β Executive Order 202.6
https://blog.adafruit.com/2020/03/22/covid/
Adafruit Industries was deemed an essential manufacturing in New York, NY by Executive Order 202.6.
https://blog.adafruit.com/2020/03/22/covid/
https://esd.ny.gov/guidance-executive-order-2026
We are prioritizing-
Essential manufacturing including:
Microelectronics/semi-conductor
Medical equipment/instruments including:
Warehouse/distribution and fulfillment
Essential health care operations including:
Medical supplies and equipment manufacturers and providers
We will resume shipping all orders soon, we need to know if your current order is urgent and requires components and equipment used for COVID-19 (Coronavirus) related efforts and any other essential businesses and services. If this applies to you, please provide any documentation or details you have pertaining to your shipment that could help us to classify it as urgent and/or essential.
Additionally - please contact us for urgent and specific needs: covid19@adafruit.com
@river quest I ordered right before the shutdown and got it a day latter.
So I've been having a little bit of a hack (at HackWimbledon
[https://hackwimbledon.org/]) on the Adafruit Clue alpha and having some of
Elecfreaks Joystick:bits
[https://www.elecfreaks.com/store/elecfreaks-joystick-bit-for-micro-bit.html]
to hand I thought I'd get them work...
Im lurking
zPlease yes, thanks Kattni
I forgot I did that this week.
@half sedge a lot on our minds, my last week felt very long (and very short at the same time)
new lib: https://github.com/adafruit/Adafruit_CircuitPython_DS1841 CircuitPython library for the Maxim DS1841 I2C Logarithmic Resistor
