#circuitpython-dev

1 messages Β· Page 296 of 1

solar whale
#

@idle owl sorry - one more interruption -- I just merged a PR into the RFM69 library -- should I go ahead and release it or do you want to wait until you have merged the reformatting PR -- There is no rush as far as I am concerned.

idle owl
#

@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.

solar whale
#

OK - let me know when and how I can help.

gilded cradle
#

Sure @idle owl. Let me see if I can find my BNO055...

idle owl
#

@gilded cradle Thank you so much!

simple pulsar
#

I've just worked out what black is. https://github.com/psf/black

GitHub

The uncompromising Python code formatter. Contribute to psf/black development by creating an account on GitHub.

#

What's best thing to read on the adoption strategy/process that's being use for this Black thing at Adafruit?

umbral dagger
#

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.

solar whale
#

resistance is futile ...

umbral dagger
#

Futility will be resisted

gilded cradle
#

@idle owl, so far no luck locating it. I'll keep looking. I have a couple more places to check.

idle owl
#

@gilded cradle I was thinking you'd dealt with it recently. Thanks for putting in the effort.

gilded cradle
#

Oh, that was using the CLUe that I did something similar

idle owl
#

Ah fair enough

gilded cradle
#

Ok @idle owl, finally found it

idle owl
#

Huzzah!

manic glacierBOT
umbral dagger
#

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.

main meteor
#

The Rasa Stack people also use Black.

ionic elk
#

@slender iron is there somewhere I can actually order the 32blit?

#

or is it only KS

umbral dagger
#

@ionic elk I believe it's still just the beta level backers.

simple pulsar
#

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.```

slender iron
#

@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.

ionic elk
#

@slender iron want to lend me yours? πŸ™‚

#

Or you could probably port it pretty easily once all the Nucleo stuff is done

slender iron
#

get it going on the nucleo and then we can reach out to pimoroni

ionic elk
#

Though I don't have another H750 board... Hmm

#

sounds good

slender iron
#

go ahead and order any dev boards you may need

ionic elk
#

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.

slender iron
#

may be too new

ionic elk
#

I was avoiding that one because I wasn't sure if we could even support it without some code shenanigans.

trim elm
#

@slender iron I was thinking it may be worthwhile to change the black directive from black --check to black --diff

slender iron
#

@ionic elk best to start with the ones we're seeing on devices

#

@trim elm why?

trim elm
#

@slender iron Black --diff tells the user what it would change whereas black --check just says what files it would reformat.

brazen cedar
#

noob here with a question

trim elm
#

@slender iron And Black just saying it would reformat some files might be confusing to some people who haven't encountered black before

slender iron
#

@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

brazen cedar
#

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)

trim elm
#

@slender iron Well, maybe we could keep black --check but have it output a link to the black learn guide?

slender iron
#

not necessarily P0_13 is the die number which is then mapped to a package pin

#

@trim elm that sounds perfect

umbral dagger
#

Is there an official Adafruit black config file?

trim elm
#

@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

slender iron
#

@umbral dagger black doesn't have a config. it's meant to support only one format

solar whale
simple pulsar
#

@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...

slender iron
#

@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

simple pulsar
#

Doesn't Mu have its own thoughts on code? Are Black, pylint and Mu all aligned in their opinions?

trim elm
#

@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

slender iron
#

they are all based on PEP8 I believe so theoretically they should be the same. there is some room for interpretation though

idle owl
#

I've never seen from foo import (baz,) before. Google isn't really giving me any info on it.

trim elm
#

@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

idle owl
#

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.

simple pulsar
#

Is this for line continuation with long import lines?

idle owl
#

It formats it that way regardless of line length, it seems.

trim elm
#

Yeah, I mostly saw it doing that for non top-level imports after I added a disable for import-outside-toplevel

idle owl
#

^^

trim elm
#

Although I didn't really check if it was doing it for top-level imports come to think of it

idle owl
#

I haven't seen it doing it for top level.

trim elm
#

That's good

idle owl
#

Except in the case of one that had something like 10 modules imported.

#

with multiple line breaks.

trim elm
#

hmm... yeah, that probably looks pretty bad

#

I mean, I guess it's more readable

idle owl
#

Β―_(ツ)_/Β―

slender iron
#

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

idle owl
#

You explained it differently in the meeting previously.

slender iron
#

did I?

#

what did I say before?

idle owl
#

In talking about the keyword arguments or lists or whatever all being put on separate lines

brazen cedar
#

@solar whale I see that, can you explain what the P0 thing is in the pin name? (i.e. &pin_P0_13 for RED)

idle owl
#

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.

slender iron
#

type hints

#

allows you to define what type an argument should be

#

it makes each argument longer

main meteor
#

I just read that last "it makes each argument longer" sentence out of context and thought "I don't want that!"

solar whale
#

@brazen cedar the pins are grouped on ports in the nrf52840 the P0/P1 refers to the "port"

brazen cedar
#

@solar whale ok thanks for clearing that up. I have so many questions...

solar whale
brazen cedar
#

@solar whale it appears I need to learn to read schematics

solar whale
#

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
#

Now featuring over 500 riveting pages of datasheet thrills!

lapis hemlock
#

@cursive condor Do you still want to make your fractal code run faster?

granite ingot
#

@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.

ionic elk
#

@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

granite ingot
#

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.

manic glacierBOT
ionic elk
#

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

raven canopy
#

@trim elm should be doable. --check returns non-zero for changes (1) & failures (123), so some if [ $? != 0 ]; echo ... bash should work.

cursive condor
#

@lapis hemlock always πŸ™‚

ionic elk
#

@granite ingot do you have a schematic of the usb line?

granite ingot
lapis hemlock
#

@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 the for ky in range(height) loop. You could also replace row = ulab.array([i for i in range(width)]) by linspace. arctan2 should now be in the latest circuitpython firmware, 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.

granite ingot
#

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.

cursive condor
#

@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 πŸ™‚

manic glacierBOT
cursive condor
#

(and I can't use a matrix, not enough memory)

slender iron
#

@granite ingot is there more than one USB peripheral in the chip?

ionic elk
#

@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.

slender iron
#

I doubt it's the hardware if it works with bare stm32cube

trim elm
#

@raven canopy sounds good. I'll ping you when the learn guide page is published

ionic elk
#

Been a while since I wrote it though so I'm not 100% sure what your case is

lapis hemlock
#

@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 In y = ky * h4pi - 6.28 y2 = y**2 atan = ulab.vector.atan( row / y ) dist = ulab.vector.sqrt((row * row) + y2) * fp everything 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 = y2
y2;
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)

ionic elk
#

@granite ingot what I would try in the meantime would be giving one of the tinyUSB examples a shot

granite ingot
#

@slender iron It only has one usb peripheral on the chip.

slender iron
#

kk and one set of pins?

#

the tinyusb example is a good idea

granite ingot
#

Yup, one set of USB pins

lapis hemlock
granite ingot
#

@ionic elk I saw that macro, but wasn't sure why that was in usb.c.

ionic elk
#

As far as I recall it is a F412 specific item but I'll double check

granite ingot
#

I have it excluded from my build.

idle owl
#

@lone axle If I merge that PN532 PR, are you up for updating the guide you mentioned?

ionic elk
#

The F412 was the first thing I implemented and is only used on the one discovery

#

that's used all over the place, it is 100% not optional

lone axle
#

@idle owl yep I can do that.

idle owl
#

@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.

ionic elk
#

that's what I was referring to earlier

idle owl
#

@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.

lone axle
#

@idle owl sounds good. Will do.

granite ingot
#

Yup, I have the MCU defined.

ionic elk
#

hmm, that's all it is drawing from. So if that matches the same wording as the F412 discovery it should be ok

cursive condor
#

@lapis hemlock I think I understand. linspace act like a generator, so it's like a memory-unexpensive matrix ? I must test further ! Thanks !

ionic elk
#

Are you looking to push this upstream? If you start a PR I can do a more direct review.

granite ingot
#

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
#

@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, linspace creates 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), but dist = ulab.vector.sqrt((row * row) + y2) * fp is definitely expensive in the loop.

idle owl
#

@solar whale You around and up for testing something for me?

solar whale
#

sure

ionic elk
#

@granite ingot huh... why is it a fork of micropython?

slender iron
#

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

ionic elk
#

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.

solar whale
#

@idle owl what would you like me to test?

ionic elk
#

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

slender iron
#

yup yup. I renamed mine manually

idle owl
#

@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.

solar whale
#

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

idle owl
#

@solar whale I never remember off the top of my head: πŸ˜• um.... hold on.

#

Is one

umbral dagger
#

@slender iron I saw mention of a config file.

slender iron
#

must have been the pylint one. each repo has a copy of it

solar whale
#

@idle owl -- apds9960 uses it and I have that -- on clue and alone -- I can try it.

idle owl
#

Perfect

manic glacierBOT
lapis hemlock
#

@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)

manic glacierBOT
solar whale
#

@idle owl all the apds9960 simpletest run ok on my clue with pr_37

idle owl
#

Excellent

#

Thank you so much!

solar whale
#

do you want me to comment in the PR?

idle owl
#

I already merged it πŸ˜„

#

Thanks for the offer though

solar whale
#

πŸ‘

idle owl
#

Ooh I have another one for you. You have RPi setup right?

solar whale
#

yes

idle owl
#

Do you have NeoPixels in some form that you can hook up to it?

solar whale
#

yes -- but I always have issues with neopixels and sudo on my Pi's -- I can try

idle owl
#

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

idle owl
#

@solar whale actually looks like you could test that change on anything with NeoPixels.

#

That change is in wheel

solar whale
#

OK -- that would be easier

idle owl
#

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.

solar whale
#

I'll try it

idle owl
#

Thank you

#

I know it's fine, but it's NeoPixel.... so...

#

yeah.

solar whale
#

it works fine with a jewel on my bluefruit sense -- no change to the lib, just the demo, correct

idle owl
#

Correct

solar whale
#

looks good!

idle owl
#

Thank you!

solar whale
#

you're welcome

idle owl
#

@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.

solar whale
#

I think so -- it'll be a good test πŸ˜‰ i'm up for it.

idle owl
#

Right on πŸ™‚

#

Turns out Dylan's got some to deal with first πŸ˜„

solar whale
#

yeah -- I broke it on him with todays merge...oops

idle owl
#

No worries. Good for him too.

#

There is a faint light at the end of this tunnel! πŸ˜…

solar whale
#

BTW -- I ran black on my rfm9x library -- very similar to rfm69 and it "did no harm" still works.

idle owl
#

Good to know, thanks!

solar whale
#

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

idle owl
#

Excellent, thank you. Have a good one!

solar whale
#

You too! good luck!

lone axle
#

@idle owl I am around now and should be for a while.

ionic elk
#

@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.

manic glacierBOT
#

@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]: ***...
idle owl
#

@lone axle I just finished.

#

160 PRs merged today.

#

Or at least that's how many tabs I just closed.

lone axle
#

dang

idle owl
#

Let me put together some boilerplate for the releases.

lone axle
#

I am bad with tabs and I don't think I've ever gotten that many πŸ˜„

idle owl
#

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.

lone axle
#

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.

idle owl
#

Oh, yeah let me add you

#

can you link me

lone axle
ionic elk
#

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'?
manic glacierBOT
ionic elk
#

@tulip sleet do you have any ideas about the above QSTR issue?

granite ingot
#

@ionic elk Compiling the example worked! (I had to change things in the TinyUSB port for my clock).

ionic elk
#

But your main sketch isn't working, still?

#

Oh cripes I know what it is

granite ingot
#

Ooooh, I'm at the edge of my seat.

ionic elk
#

oh, no nevermind I don't :/

granite ingot
#

Doh!

ionic elk
#

sorry I thought it was that I'd forgotten to add BOARD_OSC_DIV to the F412 port but it's there

granite ingot
#

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.

ionic elk
#

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.

granite ingot
#

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.

ionic elk
#

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

timber mango
ionic elk
#

@slender iron got a sec? I'm getting hung up on that QSTR issue above

timber mango
#

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?

slender iron
#

@ionic elk back from a run now. did you clean and make?

ionic elk
#

Yes, this is all off a clean build

slender iron
#

@timber mango I thought it was. do you have a new one? @gilded cradle would know for sure

ionic elk
#

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?

timber mango
#

@slender iron It's a new RPI4 running DietPi

gilded cradle
#

@timber mango are you running it on Raspbian?

raven canopy
#

DietPi is likely not supported.

gilded cradle
#

Correct, DietPi isn't currently supported.

timber mango
#

DietPi is based on Raspian

ionic elk
#

@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
timber mango
#

What's missing? I can maybe port the Rasbian version to DietPi?

gilded cradle
#

It will likely need to have some adjustments made if it isn't just working.

timber mango
#

(I hate Raspbian, I love DietPi)

gilded cradle
ionic elk
#

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?

gilded cradle
#

If you want to try and get it working on DietPi, we'd love it if you submitted a PR.

slender iron
#

@ionic elk did you clean and build again yet?

#

the QSTR mechanics in the build don't always pick up on changes

ionic elk
#

All the builds I've done have been clean

#

that's usually the first thing I try for anything QSTR related

slender iron
#

ok, I can't think of other .h files that have qstrs in them

ionic elk
#

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?

slender iron
#

sounds like you should use the makefile mechanics to include a different file in the build

ionic elk
#

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
slender iron
#

can you push your changes somewhere so I can look?

ionic elk
#

Yeah let me go ahead and get a PR going for this

slender iron
#

the piece you copied over had _table at the end of the variable name

ionic elk
#

They all end in MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);

slender iron
#

kk

ionic elk
#

@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.

slender iron
#

πŸ‘

onyx hinge
#

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

granite ingot
#

@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.

onyx hinge
#

sorry if you already determined that, I didn't read all the scroll carefully

granite ingot
#

@ionic elk Never mind, looks like it's working without commenting that block out!!!

onyx hinge
#

@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.

granite ingot
#

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.

slender iron
#

@onyx hinge the only thing on my radar was trinket being broken but we just merged a fix

onyx hinge
#

@slender iron excellent!

#

f-strings will be a strong #2 feature to promote

granite ingot
#

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.

onyx hinge
#

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

slender iron
#

we'll do an rc anyway

manic glacierBOT
onyx hinge
#

@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'
slender iron
#

I think that is right

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 5\.1\.x
onyx hinge
#

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

manic glacierBOT
timber mango
slender iron
#

@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.

gilded cradle
#

Awesome news @timber mango

lone axle
#

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?

raven canopy
#

@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?

lone axle
#

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.

raven canopy
#

ahh. 😦

lone axle
#

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 πŸ˜„

raven canopy
#

πŸŽ‰

#

lol. nevermind. forgot we already did. nope, that's the actions-ci checkout

lone axle
#

Ah I see. Thank you for the suggestion and background info.

manic glacierBOT
timber mango
#

Yeah a spectrum and a spectrogram are different things.

solar whale
#

@idle owl thank you for updating the pylint guide!

fallow umbra
#

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.

simple pulsar
fallow umbra
#

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

simple pulsar
#

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.

fallow umbra
#

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..

onyx hinge
#

@gilded cradle Is there "displayio" for blinka, or do you interact with LCD displays differently than CircuitPython?

simple pulsar
fallow umbra
tulip sleet
#

@onyx hinge first make a 5.1.x branch and then we can tag there as appropriate. But maybe you did that already

onyx hinge
#

@tulip sleet yes, I did the creation of the 5.1.x branch

tulip sleet
#

ok, great, i didn't read back that carefully

onyx hinge
#

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(?)

simple pulsar
#

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?

lone axle
#

@simple pulsar Circuit Playground Bluefruit + TFT Gizmo is definitely possible to use with Circuit Python.

fallow umbra
#

@tulip sleet : i'd like to a start a translation of circuitpython guides, is there a proper way to start this?

lone axle
#

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

simple pulsar
#

Ta

#

He's a retired electrical engineer with a specialism in video. Will be interesting to see where this goes...

tulip sleet
#

@fallow umbra I'm checking on who to ask

fallow umbra
#

@onyx hinge : hello. is there already a build of the 5.1.x branch ? with ulab ? thanks.

onyx hinge
#

@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)

fallow umbra
#

@tulip sleet : thanks.

tulip sleet
#

that fixes a regression I introduced via #2666. Are you subscribed to all notifications on the repo?

onyx hinge
#

on the main circuitpython repo, yes, but I archive a lot of those messages without reading them πŸ˜•

ionic elk
#

@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!

manic glacierBOT
fallow umbra
#

@onyx hinge : thanks i'll try this.

onyx hinge
#

@fallow umbra let us know your experience ! by the way, which circuitpython board will you be using?

tulip sleet
#

@fallow umbra, I DM'd you with translation info

ionic elk
#

@slender iron @tulip sleet are any of the other boards in Circuitpython cortex m7?

tulip sleet
#

nope

ionic elk
#

Is that going to be something that extends outside the port, potentially?

fallow umbra
#

@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 ?)

ionic elk
#

or should the compiler handle the swap ok?

tulip sleet
#

@ionic elk I'm missing the context for this; could you give me a time for previous posts?

ionic elk
#

@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

tulip sleet
#

ah, ok, I think that should be fine. I think the issues are going to be memory access, etc.

slender iron
#

@ionic elk imx rt is a cortex m7

ionic elk
#

@slender iron did any unusual tweaks need to be made or should it run fine if I swap the macros over?

slender iron
#

arturo182 did the core of it but I expect it's just a compiler argument

gilded cradle
#

@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.

onyx hinge
#

@gilded cradle thanks for confirming!

gilded cradle
#

You're welcome

onyx hinge
#

@gilded cradle are there other libs that work with it to show text or bitmaps?

gilded cradle
#

Yeah, you'll want to use it in conjunction with the Pillow library. there's lots of examples.

onyx hinge
#

got it

idle owl
#

@solar whale You're very welcome!

manic glacierBOT
onyx hinge
#

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

slender iron
#

Β―_(ツ)_/Β―

#

I'm ok doing checkout stuff ourselves

manic glacierBOT
timber mango
#

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.

onyx hinge
#

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"?

timber mango
#

@onyx hinge Why is there no failure in pack-unpack.py then? It works just fine and produces the proper output.

onyx hinge
#

because pack() returns a unicode string '...' ?

#
1633837924
timber mango
#

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.

tulip sleet
#

@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?

onyx hinge
#
'abcd'
>>> struct.pack('>l', 1633837924)
b'abcd'
timber mango
#

What is this showing me? I do not understand.

idle owl
#

@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.

tulip sleet
#

I'll try to incorporate the PR as it stands now - thanks.

onyx hinge
#

@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?

raven canopy
#

@tulip sleet I patched BLE_Adafruit last night, if that's one of the ones you're concerned about.

timber mango
#

@onyx hinge No, I do not know the difference.

tulip sleet
#

@raven canopy, yes that was one, thanks! I just created BLE_iBBQ, I'll update that to the PR

raven canopy
#

BBQ should only need the pylint version updated in build.yml (that's the open pr)

onyx hinge
#

@timber mango okay, learning time then.

tulip sleet
#

is there a task in the .yml's that runs black every time on push?

raven canopy
#

Not yet.

#

Oh wait. It is in the current cookie

timber mango
raven canopy
#

BLE_Adafruit probably doesn't have the Black check though, @tulip sleet

tulip sleet
#

that lib is still just a skeleton in the adafruit repo. I'll change my local copy

raven canopy
#

like kattni I'm sure, it's all a little squishy in my mind πŸ€ͺ

tulip sleet
#

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

simple pulsar
#

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?

manic glacierBOT
tulip sleet
#

@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.

simple pulsar
#

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.

tulip sleet
#

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

simple pulsar
#

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.)

onyx hinge
#

@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 "." 😜

simple pulsar
#

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!

lone axle
marble hornet
#

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?

raven canopy
#

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?

marble hornet
#

i;m trying to do foo.__dict__

raven canopy
#

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'
fierce girder
#

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

raven canopy
#

sync/update submodules?

#

i'm not entirely sure of the current git incantations

fierce girder
#

oh

#

doing that now

#

yup

#

thanks @raven canopy

#

now it is running ok

raven canopy
#

yay! πŸŽ‰

solar whale
#
git submodule update --init```
raven canopy
#

ok. so we just dropped the --recursive. noted

solar whale
#

I "think" so....

raven canopy
#

lol

solar whale
#

i Have

idle owl
#

Yeah we dropped it.

solar whale
#

@tulip sleet should that guide be changed?

stuck elbow
#

@lone axle if you have any feedback, I'm all ears!

lone axle
#

I will get started playing with it later tonight.

orchid basinBOT
tulip sleet
#

@solar whale, ok, i removed the --recursive from the guide, at least for now

solar whale
#

Thanks

raven canopy
#

at least for now

with git, all bets must be hedged. 😜

solar whale
#

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...

raven canopy
#

same. i'm definitely a follower in that arena.

slender iron
#

@marble hornet you can use dir() to get attribute names

marble hornet
#

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...

onyx hinge
#

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.

manic glacierBOT
#

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.

onyx hinge
#

(wow that was already a long time ago .. time flies)

manic glacierBOT
manic glacierBOT
onyx hinge
#

I may grumble while doing it but I actually love working on compile infrastructure.

lone axle
#

@stuck elbow are the holes for the pins offset slightly to make extra friction with header pins?

stuck elbow
#

yes, so you can plug a male header in there without soldering

#

and then plug the whole thing into a breadboard

lone axle
#

Neat! don't think I've seen that before.

stuck elbow
#

it's not super-reliable, but it's enough for blinking LEDs

lone axle
#

@stuck elbow is there a driver needed for windows 7 to get the serial connection?

stuck elbow
#

@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

lone axle
#

It's kind of weird. It seems like it knows what it is but still lists under other.

stuck elbow
#

problem is, I don't have Windows to build it

lone axle
#

Thank you. I can give it a try.

stuck elbow
lone axle
#

Thank you πŸ™‚

#

Works perfectly blinkacomputer

manic glacierBOT
simple pulsar
marble hornet
#

@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

slender iron
#

I've got more things to try than I have time for atm. Do you have a short video or screen cap of it?

marble hornet
#

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

slender iron
#

I think we're staying in our normal mode with circuitpython

#

I will soon need help with testing the low power PR

marble hornet
#

can you ping me when you're ready

slender iron
#

yup!

raven canopy
#

AWS credentialing is maddening. well, their docs are maddening i should say...

granite ingot
#

@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.

arctic violet
#

Which CP supported micro is lowest power?

tulip sleet
#

@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

marble hornet
#

@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!

lapis hemlock
indigo wedge
#

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

vague slate
gilded cradle
#

@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?

ionic elk
#

@granite ingot it's interesting that was causing an issue for you, but didn't impact the USB on the Feather F412.

onyx hinge
#

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)

ionic elk
#

@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?

orchid basinBOT
#

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.

ionic elk
#

@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

arctic violet
#

@tulip sleet thank you

tulip sleet
#

@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.

ionic elk
#

@tulip sleet I generally agree, the only place they get shared at all is shared_bindings_matrix.py in the docs folder

slender iron
#

@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

slender iron
#

@indigo wedge ya, that'll be tight. could maybe be ok with only advertising and scanning support

indigo wedge
#

yeah, could use it as a beacon

ionic elk
#

@tulip sleet @slender iron what is LONGINT_IMPL = NONE/MPZ? Is MPZ related to GMP?

tulip sleet
#

@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

ionic elk
#

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

tulip sleet
#

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

ionic elk
#

How do I determine whether it's supported per chip? It's turned off for the SAMD21s as far as I can see?

tulip sleet
#

it's only turned off on the small builds, and only for space reasons. There's nothing about an architecture that precludes it

ionic elk
#

this is some kind of python library that isn't even related to GMP?

#

Ah, so it's only for small chips

tulip sleet
#

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

ionic elk
#

ok it's micropython specific. I thought it was some kind of chip feature

#

So I should just probably blanket turn this off

tulip sleet
#

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

ionic elk
#

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

tulip sleet
#

@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.

simple pulsar
#

@tulip sleet Are you referring to C "library code" or something else?

tulip sleet
#

both

#

both C and Python. I'm just saying there may be latent bugs that assume 32 bit only

ionic elk
#

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

tulip sleet
#

it might be needed for LTO to do proper link-time optimixzation

ionic elk
#

It doesn't seem to impact my flash or ram sizes - or would it be something speed related?

tulip sleet
#

do you have -flto enabled?

ionic elk
#

no, not right now

#

should I

#

ok looked it up I'll try it

tulip sleet
#

it will slow the build down but shrink the image

#

it's highly necessary on the M0 boards

timber mango
#

I have at least one question about the RFM69 library.

tulip sleet
timber mango
#

I do not think anyone who can help me is there.

#

Oh, wait, maybe, I do not know.

tulip sleet
#

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

ionic elk
#

@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

onyx hinge
#

@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

slender iron
#

@onyx hinge totally! I'm free all day tomorrow

onyx hinge
#

@slender iron excellent. you wanna do 2 - 2:30 your time again?

slender iron
#

sure that works

#

can do earlier too if that helps

onyx hinge
#

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

ivory yew
#

it's running roughly 40 lines of CircuitPython. πŸ™‚

#

and the module on the left is also running CircuitPython.

slender iron
#

@ionic elk is there a config setting for whether each STM board has a low speed, 32.768khz, external crystal?

main meteor
#

The big honking button, it actually honks!

timber mango
#

@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.

manic glacierBOT
brazen cedar
#

Anyone around that could answer some questions about /supervisor/shared/rgb_led_status.c?

manic glacierBOT
lone axle
#

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()

slender iron
#

@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

brazen cedar
#

@slender iron ok will do.

lone axle
brazen cedar
#

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.

slender iron
#

never reset is used to prevent the supervisor from resetting the pin effectively disconnecting the PWM

brazen cedar
#

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?

slender iron
#

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

#

pin busy tracking is done with static bools

#

basically copy how MICROPY_HW_APA102_MOSI is done

brazen cedar
#

I'm trying to understand, I'll take a look at that section of the code.

slender iron
#

@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)

brazen cedar
#

is the language syntax "->" a lambda similar to the C# notation "=>"?

slender iron
#

I don't know the C# equivalent

#

it dereferences the pointer and then accesses the field

#

foo->bar is the same as (*foo).bar

brazen cedar
#

Is the code considered C++ or just C? (so I know what references to read)

slender iron
#

C

brazen cedar
#

sorry for all the noob questions πŸ˜›

slender iron
#

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

brazen cedar
#

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)

brazen cedar
#

@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?

raven canopy
#

@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?

tulip sleet
#

yes, it's >1700 now

#

but we can get the raw log files, I thought. Justin is dropping them in a new bucket

raven canopy
#

still an option, definitely. i haven't looked at them yet...

#

not public accessible 😦

tulip sleet
#

i think there might be a privacy issue with making them public if they have the fetcher's ip address

raven canopy
#

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.

tulip sleet
#

no, not complaining about your emoji πŸ™‚

raven canopy
#

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.

tulip sleet
#

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.

raven canopy
#

yeah, an access key with readonly should be fine.

tulip sleet
#

i'll let you know when I have some samples

raven canopy
#

filtering to a file works with CloudWatch, so that's good to know.

tulip sleet
#

did the aws mgmt console login change recently, my old login link is failing; now I need my IAM username instead of email

raven canopy
#

are you using MFA?

#

i had to resync Google Authenticator this morning, after having zero problems last night. 🀷

tulip sleet
#

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

raven canopy
#

hmm. email isn't working for root?

tulip sleet
#

it says i am not a root user; maybe I was and am no longer? will have to ask about that

raven canopy
#

if its org account...i am of little help. πŸ˜„

tulip sleet
#

right, i was just guessing you use it all the time yourself for your regular jbo

raven canopy
#

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)

tulip sleet
#

aws's console is the most complicated management console I have seen by like an order of magnitude

marble hornet
#

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
raven canopy
#

i feel both are strongly biased towards their CLIs, but that makes sense as most of the admins will be on servers anyway.

marble hornet
#

it is in both the beta and the current master

tulip sleet
#

did it ever work

#

like in 4.x

#

that is the kind of obscure feature micropython would have ignored

marble hornet
#

ill check
it should wither way. i disagree: it's part of the definiton of how python works at the core isn;t it.

tulip sleet
#

allowing you to redefine int()

raven canopy
#

there is overhead that comes with supporting all of the dunders...

marble hornet
#

but int?

tulip sleet
#

micropython trades some flexibility for speed

#

but in practice why would you want to define your own int()?

marble hornet
#

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?

tulip sleet
#

you could write a method to do it and call it explicitly

#

def int(self): ...

#

g.int()

marble hornet
#

but it's supported for str?

#

also nice demo in show and tell yesterday

tulip sleet
#

yes, it's hardwired to call that; it doesn't look for __int()__ for string.
thanks!

marble hornet
#

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?

tulip sleet
#

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

marble hornet
#

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?

tulip sleet
#

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

marble hornet
#

do you know what features you'd want?

tulip sleet
#

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

marble hornet
#

doing some digging
and Β±...

tulip sleet
#

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

marble hornet
#

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...

slender iron
#

@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
#

@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!

ionic elk
#

@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

gilded cradle
#

No problem @lapis hemlock. Glad it's working for you now.

lunar crown
#

Google just announced/released an embedded 32 bit toolkit called Pigweed. Targeted at things like ARM Cortex-M that will execute out of flash.

manic glacierBOT
#

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
#

@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

ionic elk
#

@slender iron anything else I can help with?

slender iron
#

I'm thinking I'll factor out the hal_conf.h files

#

I'm seeing 60 mA when running

solar whale
#

@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

onyx hinge
#

@solar whale I'm happy to hear you're back on track!

solar whale
#

and it looks like a simple pip3 install black now works on the Raspberry Pi

#

it installs v19.10b0

idle owl
#

@solar whale You're welcome!

#

Well done!

onyx hinge
#

@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

slender iron
#

@onyx hinge just back from lunch now

onyx hinge
#

@slender iron πŸ‘ I can dig on this rotation problem for a bit

slender iron
#

I'm happy to chat now so that I can catch state of the fruit at 2:30

onyx hinge
#

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

slender iron
#

want to video on discord or slack?

onyx hinge
#

either one works for me. slack seemed to work good last time.

flat delta
#

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

flat delta
#
>>> 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
raven canopy
#

@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?

flat delta
#

mh too lazy lol
I have found 2 bugs already, probebly I should create a list and issue them all at once

granite ingot
#

@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?

steady osprey
#

Where can I find the .py image file for the pybadge with tensorflow...?

slender iron
#

@steady osprey The tensorflow demo isn't CircuitPython. It's Arduino

steady osprey
#

So, how would I run the demo on the pybadge...?

slender iron
#

@ionic elk I can just use TIM6 for a PulseIn reference clock right? Just like PulseOus uses TIM7?

manic glacierBOT
#

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...

onyx hinge
#

@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.

vital tulip
#

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

simple pulsar
#

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 ...

manic glacierBOT
#

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...

simple pulsar
#

The non-quantitative answer so far appears to be yes!

brazen cedar
#

Does the Feather Sense support a boot.py file?

#

If it does I think I found a bug

lone axle
#

I would think it is supposed to work. What did you find?

brazen cedar
#

Well I can't reproduce it consistently but I've managed to break the boot.py. The boot.py file is a loop that prints some number but sometimes when I reset the board the file is overwritten and contains a GUID and the boot_out.txt file will have the same GUID in it.

#

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.

lone axle
#

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.

brazen cedar
#

running with an empty boot.py still generates a GUID in boot_out but boot.py remains blank. The code in code.py doesn't loop and terminates leaving the board with a pulsing green status LED if that matters at all

ionic elk
#

@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

manic glacierBOT
manic glacierBOT
slender iron
#

@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.

ionic elk
#

@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

slender iron
#

what would the DMA do?

ionic elk
#

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

solar whale
#

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?

onyx hinge
#

I'd try x offset 0 as a first guess

solar whale
#

I treid that -- but it still does not fill the screen

onyx hinge
solar whale
#

oohhh --- seems to be working -- thanks @onyx hinge

#

x_offset 0 y_offset 80

onyx hinge
#

Hooray @solar whale

timber mango
#

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

solar whale
#

@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.

manic glacierBOT
manic glacierBOT
#

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>
  ...
lone axle
#

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.

onyx hinge
#

it may be so old that the convention was not employed yet

manic glacierBOT
lone axle
#

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.

manic glacierBOT
#

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 ...

manic glacierBOT
idle owl
#

@lone axle Exactly. Same with NeoPixel - the overhead to change it would be astronomical.

#

Everything else we were willing to update.

lone axle
#

I see. Thank you for confirming πŸ™‚

timber mango
#

@idle owl Will Blinka get gamepad at some point?

slender iron
#

@timber mango unlikely because Linux is higher level than CircuitPython itself

stuck elbow
#

one could write one in python

simple pulsar
#

Write what?

manic glacierBOT
stuck elbow
#

a gamepad module

#

it won't do debouncing and buffering, like the original does, but it should be good enough in a cinch

manic glacierBOT
simple pulsar
#

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.

lone sandalBOT
timber mango
#

@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.

stuck elbow
#

@timber mango they way it is implemented currently, it does

timber mango
#

What is up with these NotImplementedError: keyword argument(s) not yet implemented - use normal args instead errors popping up when there is no probem?

stuck elbow
#

@timber mango it either needs a timer interrupt or a pin interrupt to work reliably

timber mango
#

@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.

stuck elbow
#

that's what I mean by pin interrupt

timber mango
#

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.

stuck elbow
#

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

timber mango
#

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.

raven canopy
#

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.

timber mango
#

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.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
timber mango
#

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.

raven canopy
#

@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()

timber mango
#

@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

#

Line numbers match the TypeError line numbers.

raven canopy
#

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?

timber mango
#

@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.

raven canopy
#

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).
timber mango
#

Hmmm, interesting. I do not get that. Well, my brain can not get wrapped around that.

golden sail
#

anyone know how to send data over wifi using esp8266?

stuck elbow
#

nobody ever

manic glacierBOT
stuck elbow
#

@golden sail you can use an esp32 with the nina firmware on it as a wifi co-processor

lapis hemlock
#

I think I have missed the announcement, is today's weekly meeting still on?

solar whale
#

@lapis hemlock should be -- see the "pinned" message on this channel

timber mango
#

@lapis hemlock Announcements are sent to everyone in the circuitpythonista role. You should get added to that role.

onyx hinge
manic glacierBOT
#

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
#

@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.

onyx hinge
#

@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

#

that article is certainly written in an interesting style

manic glacierBOT
#

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...

idle owl
#

<@&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
#

@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. 😞

idle owl
#

@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
#

@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.

onyx hinge
#

py/circuitpy_defns.mk: libm/roundf.c \

#

it looks like we are including it

lapis hemlock
#

Thanks! Then it should be good to go.

onyx hinge
#

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

lapis hemlock
#

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?

onyx hinge
#

I don't think it can but I'm not sure.

lapis hemlock
#

That's what I feared.

onyx hinge
#

it seems nearbyint, rint, and round all differ on how they round certain borderline cases

lapis hemlock
#

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. πŸ‘‹

timber mango
#

I prefer the old style rounding. < 0.5 down and >= 0.5 up.

wraith tiger
#

Has anyone worked with the feather/wing doubler/tripler/quadupler thingamajiggers?

idle owl
#

Yes.

tiny oriole
#

i have, yep

idle owl
#

Soldered a quadrupler yesterday, as it happens.

wraith tiger
#

I'm wondering if there's an elegant way to connect pins to each other, like sda/scl.

#

Other than just soldering bodge wires.

idle owl
#

I don't follow.

#

Oh you mean bridging pins

wraith tiger
#

Yes from one feather to another wing.

gilded cradle
#

They should already be connected

idle owl
#

I think I'm confused.

#

From a Feather to a Wing would just work.

wraith tiger
#

The power and ground are ganged together, but not the rest

idle owl
#

That's how the doubler etc work.

#

They're connected.

gilded cradle
#

The rest are connected as well

idle owl
#

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.

gilded cradle
#

Solder mask kind of hides them, but they're there

wraith tiger
#

Hmm. The power and ground are obviously connected. But I didn't think the rest were.

idle owl
#

They are πŸ™‚

wraith tiger
#

Ah. I just looked very cloesly and now I see the traces.

gilded cradle
#

πŸ™‚

timber mango
#

I will not be at the meeting. I am not well and am going back to bed.

idle owl
#

@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.

orchid basinBOT
#

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.

manic glacierBOT
wraith tiger
#

I have a quad-feather with a new m4 express and a 3.5 inch screen to assemble yet.

serene warren
#

Lurking today (as usual) πŸ™‚ will note it in the doc.

wraith tiger
#

I'm just lurking as well.

modern wing
#

Happily lurking, and will need to bail early due to work πŸ™‚

wraith tiger
#

Yep

serene warren
#

Yes

#

Hello

wraith tiger
#

πŸ‘‹

modern wing
#

@lone axle Your mic is on πŸ™‚

onyx hinge
#

@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.

lone axle
#

Sorry about that

onyx hinge
#

np

#

thanks for fixing it. we weren't starting the meeting yet anyway

idle owl
#

It'll be a couple of minutes, finishing other meeting.

modern wing
#

Yep

serene warren
#

Yes

onyx hinge
#

@idle owl we'll hold the fort

half sedge
#

lurking (or not there) ... trying to edit the doc as fast as I can.

errant grail
#

lurking today

modern wing
#

@onyx hinge ....we have a fort now? Wicked awesome. 🏰

timber mango
#

lurking today

serene warren
#

LOUD and clear charles

sterile bronze
#

lurking

tidal kiln
#

lurking in place

onyx hinge
#

starting to add names to the list, let me know if you're lurking. thanks to those who have.

modern wing
#

@tidal kiln not socially lurking?

tidal kiln
#

both maybe?

modern wing
#

πŸ‘‹

serene warren
#

Yes

turbid radish
#

Lurking

river quest
#

ok @idle owl and @slender iron looks like i might be here for a couple mins yay

turbid radish
#

If anyone has good projects, news, interest items on Python, CircuitPython, MicroPython, and related materials, please email anneb@adafruit.com for the CircuitPython Newsletter

wraith tiger
#

Is the audio cutting in and out for anyone else or is it just me?

lone axle
#

pretty solid for me

slender iron
#

ok here

modern wing
#

It's pretty solid for me.

onyx hinge
#

I think I got everyone who stated they were lurking

river quest
serene warren
#

I just got flagged for seying hello

simple pulsar
#

I'm lurking some of the time

onyx hinge
#

@serene warren you were missing a letter from the word "hello" and so it hit the filter

serene warren
#

Ahhh. Got it. typed without looking

river quest
#

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

Adafruit Industries - Makers, hackers, artists, designers and engineers!

Please note: We are back! Sorta … We are Shipping a limited number of orders for health care professionals / urgent needs only. All other orders are being held for now. Adafruit is a 100% wom…

inland tusk
#

@river quest I ordered right before the shutdown and got it a day latter.

onyx hinge
turbid radish
#

Im lurking

onyx hinge
turbid radish
#

zPlease yes, thanks Kattni

half sedge
#

I forgot I did that this week.

onyx hinge
#

@half sedge a lot on our minds, my last week felt very long (and very short at the same time)