#circuitpython-dev

1 messages ยท Page 254 of 1

slender iron
#

vid is vendor id

#

pid is product id

#

we may have one for vid but generally someone should provide both

idle owl
#

ok

tidal kiln
slender iron
#

the first bullet sounds like what you are talking about

tulip sleet
#

yes, not necessarily that they are good, just that they are the shortest path to a new state.

#

The term that was common ~30-40 years ago is "syntax-directed editing". A websearch on that will net you a lot

#

(I remembered the jargon just now.)

slender iron
#

kk

stuck elbow
#

I hate it when there is an online form wanting a number without spaces, and it's limited to the number of characters that that number has -- but I'm copy-pasting a number with spaces, and want to remove the spaces afterwards, but then the number is truncated

#

I guess it's an example of a path to the correct input leading through incorrect

tulip sleet
#

^this is an early work -- lots more after this

#

A structure editor, also structured editor or projectional editor, is any document editor that is cognizant of the documentโ€™s underlying structure. Structure editors can be used to edit hierarchical or marked up text, computer programs, diagrams, chemical formulas, and any ...

slender iron
#

haha, have that pdf open now

manic glacierBOT
slender iron
#

my theory is the balance between text and structure editing shifts when a keyboard is replaced by a touch screen

stuck elbow
#

I would say that the preferred way of expressing the structure changes then

#

it's pretty difficult to express advanced ideas like structure with point-and-grunt communication

tulip sleet
#

I did some of this, trying to make a free-form spreadsheet where you could drag cells around, on a stylus-sensitive screen. (cap touch with fingers didn't work all that well).

#

touch was actually kind of a step back from gestures. The GO UI had a whole bunch of gestures (circles, x's, etc.) to indicate various operations

#

"pen-based" was the name for stylus-based

slender iron
#

right

stuck elbow
#

there was even a whole "alphabet" optimized for "typing" using a stylus

tulip sleet
#

i was on a panel

stuck elbow
#

you would draw one simplified letter at a time on the whole screen, and it would be treated as a keypress

tulip sleet
#

Palm Pilot input alphabet

#

@stuck elbow this discussion was provoked by an internal team meeting about tablet/phone workflow for CircuitPython

slender iron
#

do you think the current text based editors for phones are the best option?

stuck elbow
#

almost for sure not the best, but it heavily depends on what the goals are

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.1\.0\-rc\.0
#
[adafruit/circuitpython] New branch created: 4\.1\.x
stuck elbow
#

if the goal is to get to the blinking LED as easily as possible, then a button labeled "make the LED blink" is "the best"

#

if the goal is to teach a text-based programming language, then probably entering text becomes inevitable at some point

tulip sleet
#

@stuck elbow did you try TouchDevelop ever? We're not setting it up as a shining example, but it was an attempt to make program creation/editing easier on a touchscreen

stuck elbow
#

@tulip sleet I did not. I had a brief encounter with Click And Play back when it was all new and shiny, and that's pretty much all.

slender iron
#

looks up click and play

idle owl
#

@slender iron The initial thing you told me about simply getting a REPL on the board, that's enough to submit a board? (with the .travis.yml file)

slender iron
#

no, they should update the pins too

stuck elbow
idle owl
#

ok. I'm struggling with guide structure.

slender iron
#

repl is just the minimum for testing

meager fog
tidal kiln
#

yep

#

@meager fog responded. product page updated?

meager fog
#

ill do that nw

#

done

manic glacierBOT
orchid basinBOT
manic glacierBOT
onyx hinge
#

.. I'm not exactly impressed by the math function on this rigol

raven canopy
#

yay! means i might be able to test my PDMIn struggle on-board... before i invariably hand it off to someone else. DSP is... :brain_hurts:

pastel panther
#

keep the faith @raven canopy ! I BEELEEEB

onyx hinge
#

I thnk PWM out is the easy part!

slender iron
#

@raven canopy I was thinking we should do the mixer changes in 5 as well

onyx hinge
#

ugh I don't want to think about mixer

raven canopy
#

yep. when i read your in-the-weeds "release 5.x" earlier, i internally let out a little scream. ๐Ÿ˜†

slender iron
#

meh, we can always do it as 6

onyx hinge
#

will all samples have to be at the same sample rate and depth for the mixer, or will it do everything such as audio resampling? actually .. if that were not in my hands, it might be better

slender iron
#

we have more numbers available ๐Ÿ˜ƒ

raven canopy
#

well, i mean from what i remember, what dean had was working at minimum. just needed to be freshened/de-conflicted.

slender iron
#

@onyx hinge I don't remember but I'd expect your output to only get one thing to worry about

#

ya, I can pick it up before 5 stable too

#

it'll be a couple months at least before we think about stable I think

onyx hinge
#

OK, I think I'm to the point of needing to tackle playing real in-memory samples, not a hard coded sine wave.

slender iron
#

hopefully it shouldn't matter to you where you are playing from

#

@gilded cradle can we just wait for the 4.0.0-rc.0 merge instead of an empty commit

#

I'm just waiting on the last travis job

gilded cradle
#

Ok, Ill close.

slender iron
#

I can poke the site if needed. you don't need to worry about it

slender iron
#

783 assets

raven canopy
#

woohoo! and also. ouch! ๐Ÿ˜„

gilded cradle
#

Lotsa boards

onyx hinge
#

I think there's a piece I'm missing when it comes to how the actual audio driver treats in-memory and from-sd samples "the same"

#

continues reading the source

slender iron
raven canopy
onyx hinge
#

@slender iron ah that's one way to do polymorphism! (very expedient)

slender iron
#

ya, and the compiler can tell what is happening whereas it can't with function pointers

onyx hinge
#

you mean in terms of lto

#

?

slender iron
#

ya, optimization in general

onyx hinge
#

I do too much C++ by day, the old ways are forgotten

slender iron
#

ya.... that would be more ideal

#

we should skip straight to rust ๐Ÿ˜ƒ

onyx hinge
#

I hear the kids love it

slender iron
#

I like the idea of being more explicit with memory

#

micropython's internals make use of heavy casting though

onyx hinge
#

see above: expedient

#

might as well wait 5 years and you'll be able to run full python 3.8 on a mote of dust

slender iron
#

๐Ÿ˜ƒ

#

will linux still take a while to boot?

onyx hinge
#

I mean, not quite, but .. the argument for things less than a full linux keep dwindling. (except boot time, perhaps -- but if pid1 is python...)

slender iron
#

I'm in the camp of no linux for simplicity

#

my tune may change when folks want security though

raven canopy
#

agrees as he struggles with RosiePi on the RPi ๐Ÿ˜„

onyx hinge
#

back on the topic of audio, is it the case that the audiosample dictates how big one "chunk" of the sample is? Is there a maximum?

#

I see that "buffer_length" is acting like an out parameter of audiosample_get_buffer

slender iron
#

ya, I believe so

onyx hinge
#

so if I need to consume a different number of samples at a time, that's up to me to track

slender iron
#

as it is now

#

k, I'm off. night all

onyx hinge
#

see you

craggy galleon
#

Hi All,

I noticed on my ItsyBitsy M4 (SAMD21G19A) that CircuitPython seems to allow a huge number of non-compliant combinations for I2C and UART configurations for SAMD51.

I was just wondering if the datasheet for the SAMD51 is wrong or CircuitPython.

EG: D3 (PB23) and MOSI (PB22) is said to be supported uart but really you cannot use the TX pin. (not on PAD[0])

EG: MOSI (PA00) and SCK (PA01) is said to be a valid I2C connection but doesn't work at all. (Not supported by SAMD51 - see datasheet).

Thanks!

manic glacierBOT
stuck elbow
#

@craggy galleon do you think you could file a bug on github for this?

craggy galleon
#

Sure!

manic glacierBOT
#

As per Discord Chat.

Hi,

I noticed on my ItsyBitsy M4 (SAMD21G19A) that CircuitPython seems to allow a huge number of non-compliant combinations for I2C and UART configurations for SAMD51.

I was just wondering if the datasheet for the SAMD51 is wrong or CircuitPython.

EG: D3 (PB23) and MOSI (PB22) is said to be supported uart but really you cannot use the TX pin. (not on PAD[0])

EG: MOSI (PA00) and SCK (PA01) is said to be a valid I2C connection but doesn't work at all. (No...

lone sandalBOT
manic glacierBOT
manic glacierBOT
idle owl
#

@slender iron The .travis.yml file that needs to be updated with the board name to auto-build is in the circuitpython root directory, correct? (Basically verifying that I'm not wrong on this one.)

slender iron
#

yup!

idle owl
#

thanks

#

@slender iron Another q, sorry. The info in .travis.yml is used to tell Travis to build the firmware files. What else? Something to do with circuitpython.org?

slender iron
#

it's what to build and everything built gets released and pushed to s3

idle owl
#

oh ok

meager fog
#

@umbral dagger excellent twitter guide!

#

ready for the next thing?

umbral dagger
#

Oh! Thanks!

#

Yes, was just wondering about that.

meager fog
#

@umbral dagger ok why dont you try to make a bitmap -creator- library

#

we have one that parses and loads BMP files

#

please make one that will save a displayio bitmap to disk as a 24-bit BMP

umbral dagger
#

OK.

manic glacierBOT
manic glacierBOT
#

It's plausible you would reconnect to a device whose address was already known due to a previous scan.

In the Apple API, when a scanner gets an advertisement, it calls a callback and passes a CBPeripheral object, (along with rssi and the raw advertisement data). I might call that a RemotePeripheral based on my naming standards. Discovery is done by calling functions on the CBPeripheral. Then you connect to it. I hide all that and just do discovery during the connection attempt. I mi...

meager fog
#

@umbral dagger ok back - yeah do you know where to find the BMP format

umbral dagger
#

I see some stuff on wikipedia

#

and there's the displayio code that reads them

meager fog
#

yeah also we have arduino code

idle owl
#

@slender iron So if a new board is submitted, the assets will be generated and put on S3, but until we do a release, it's not released on GitHub?

idle owl
#

@tulip sleet You can probably answer this ^^

tulip sleet
#

that's right

#

Scott is afk right now, I happen to know.

idle owl
#

I figured. Thanks.

#

@tulip sleet the assets are built for S3 every time we.... ok I don't know. When are the assets built for S3?

#

on merging PRs?

tulip sleet
#

Right, whenever there's a commit to the adafruit/circuitpython repo, which basically happens only on PR merges.

idle owl
#

ok

tulip sleet
idle owl
#

@gilded cradle I'm including a final line on my guide about "look for a guide coming soon on adding your board to circuitpython.org/downloads". If you could make a note to update my guide with a link to your guide, or to remind me to do that, that would be great, since I have no idea when you'll get to that guide.

gilded cradle
#

Sure thing @idle owl

manic glacierBOT
idle owl
#

@tulip sleet Do you have a minute to explain something?

tulip sleet
#

sure

idle owl
#

Ok, so this part of this file ensures that different types of firmware are built for boards that don't have a UF2 bootloader. https://github.com/adafruit/circuitpython/blob/master/tools/build_board_info.py#L28 but some say BIN and some say BIN_UF2. For the guide should I assume people know how to fill that in for their non-UF2 board, or can you explain the options and what they mean so I can explain it?

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

Some say HEX but the guide is assuming SAMD boards, so eh

tulip sleet
#

BIN means build only a BIN, BIN_UF2 means build both (some boards were originally sold without UF2 bootloader, but now are shipped with UF2), and HEX means build only a HEX

idle owl
#

are there any other options than those three?

tulip sleet
#

no, it was done ad hoc, because those were the choices we needed to support the boards

idle owl
#

Ok thanks

prime flower
idle owl
#

I'm not discussing that.

#

This is how to add your board, not what to do once you've done it

prime flower
#

Ok

idle owl
#

It's already complicated enough without adding more tangents to it.

#

Presumably if they designed the board, they know how to flash it.

manic glacierBOT
#

There's nothing available that just validates something as an iterable, as far as I can tell. You have to use mp_getiter(), which sets up an iterator, and which might allocate storage. No matter what, somebody needs to call mp_getiter(), and that will throw the right exception if it's not an iterable. It was just a comment to remind the reader.

Interestingly there's a similar comment in the VM:
https://github.com/adafruit/circuitpython/blob/d12e1a8d74ebb8d5d32ab0de47d3097e80c5d4fd/py/...

manic glacierBOT
tough flax
#

So I'm trying to understand the PyGamer design... it looks like 7416 shift register replaces 4 input pins (with pullup/downs) with two output pins and an input pin. Was there originally a thought that this would handle more buttons? Or are we really out of input pins on the SAMD51 at this point?

#

Also, it looks like @meager fog intentionally exposed the PCC lines through the Featherwing interface.... are we planning on a camera/video input? (cool!)

manic glacierBOT
#

I changed this and other print routines to print something like <Descriptor with unregistered UUID> when the UUID is not registered. The <TypeName with maybe other stuff> syntax is how repr() looks for routines without a descriptor call (no constructor print available).

https://docs.python.org/3/library/functions.html#repr says:

... For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
cerulean pawn
#

Hi, I'm seeing a weird issue I'm not able to debug. I am initializting my LCD in a module ugame.py, which works fine if it is is the lib/ folder as a .py, but if I compile it in circuitpython with FROZEN_MPY_DIRS, it seems to be running fine (seeing print()s etc.) but it doesn't initialize the display. I tried adding delays in various places too, but nothing seems to work. It's using busio.SPI

stuck elbow
#

did you do a make clean after modifying it? the frozen libs are not update automatically

cerulean pawn
#

I did, checked the build directory contents also

#

I'll try again just in case I missed it earlier

stuck elbow
#

do you have a logic analyzer to look at the spi traffic?

#

I assume it's a custom board?

#

by the way, you probably want to use a gamepad module for that button handling

cerulean pawn
#

oh okay, thanks, I'll take a look at that module

stuck elbow
#

you can see how the ugame.py for the actual ugame10 does it

cerulean pawn
#

I didn't try connecting a logic analyzer yet, don't have it with me, but I can get it

#

okay, I'll take a look.

stuck elbow
#

also, if it's a custom board, you might want to do the initialization in board.c instead, and just use board.DISPLAY

#

also how ugame10 does it

cerulean pawn
#

it's like a shield for a base board, so the display is optional if I want to keep a single 'board' in circuitpython

#

unless there is a way to have it optinally initialize it from board.c

stuck elbow
#
cerulean pawn
#

yeah this is what I was doing, and it works if just put the two python files in lib/, just not when they are frozen

stuck elbow
#

maybe something is resetting the display afterwards?

cerulean pawn
#

I'm connecting saleae to the display pins, thanks for the help. also thanks for the library ๐Ÿ‘

empty hazel
#

Hey! Is there any way to set larger font size and display it on SSD1306 OLED ?? SSD1306 library don't support other fonts and sizes. Is there another easy way to do this?

stuck elbow
#

you can draw the letters yourself

empty hazel
#

@stuck elbow So I guess there is no easy way just to set larger font size ๐Ÿ˜›

stuck elbow
#

"easy" is relative

manic glacierBOT
cerulean pawn
#

I give up for now, not seeing any difference, but there must be

tulip sleet
#

@cerulean pawn could you point to the main program?

cerulean pawn
tulip sleet
#

@cerulean pawn might be something being gc'd when it's not supposed to. I'd strip this down to an import that just creates the display, and a code.py that just displays something on it (like an increasing count).. Remove the Stage stuff. Then start adding things back.

indigo wedge
cerulean pawn
#

@tulip sleet yeah, I'll try that tomorrow, time to head out, thanks

graceful heart
#

thanks for the testing it @indigo wedge , I'm excited to get it in there for everyone to start using ๐Ÿ˜„

meager fog
#

@empty hazel we'll have font support for the OLED displays in the next couple weeks

#

@umbral dagger p0ng - checkn in

umbral dagger
#

@meager fog Working away... no blockers

slender iron
#

@tulip sleet did the new compiler make the code size smaller? I'm out of space on m0 express with pinyin

#

kinda crazy it's 4k extra bytes

#

vs english

tulip sleet
#

When I tried gcc8 earlier, it only saved a few hundred bytes, but maybe that's enough. I can try it now.

#

@slender iron Metro M0 pinyin: latest arm release has 1624 bytes free vs 1172 bytes free with 7.3.1 release

#

build seemed noticeably slower: I will time it

slender iron
#

I'm 900 or so over...

#
 .text.common_hal_pulseio_pwmout_construct
                0x00000000000088bc      0x300
#

that always gets me

tulip sleet
#

gcc7.3.1 build:

real    0m37.314s
user    1m3.694s
sys    0m7.902s

gcc 8 build:

real    1m43.808s
user    3m0.779s
sys    0m8.552s
#

ugh

slender iron
#

yikes

#
 .text.common_hal_busio_spi_construct
                0x000000000000fc6c      0x294 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
#
 .text.common_hal_busio_i2c_construct.constprop.184
                0x000000000001003c      0x2d8 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
#

is it just the pin finding that is so big?

tulip sleet
#
    gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT);
    gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF);
    gpio_set_pin_function(clock->number, clock_pinmux);
    claim_pin(clock);
    self->clock_pin = clock->number;

    if (mosi_none) {
        self->MOSI_pin = NO_PIN;
    } else {
        gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT);
        gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF);
        gpio_set_pin_function(mosi->number, mosi_pinmux);
        self->MOSI_pin = mosi->number;
        claim_pin(mosi);
    }

    if (miso_none) {
        self->MISO_pin = NO_PIN;
    } else {
        gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN);
        gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF);
        gpio_set_pin_function(miso->number, miso_pinmux);
        self->MISO_pin = miso->number;
        claim_pin(miso);
    }

    spi_m_sync_enable(&self->spi_desc);
}
#

could refactor that somewhat

#

migt not save very much

slender iron
#

My display code isn't exactly slim:

#
 .text.displayio_group_fill_area
                0x0000000000013e60      0x6a8 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
tulip sleet
#

could turn off samd module on M0 boards

slender iron
#

pixelbuf isn't in use now

#

though it'd be nice to have

#

could turn off bitbangio

tulip sleet
#

that has a lot more uses than samd

slender iron
#

true

tulip sleet
#

we could turn off certain modules only on large languages, but that's not really great

slender iron
#

could turn frequencyio off in m0

tulip sleet
#

pixelbuf is an optimization, not basic functionality, so it could be off for large languages

idle owl
#

@slender iron are crystals separate from the chip? So would I say "if your board has a crystal" or "if the chip on your board has a crystal"?

tulip sleet
#

separate

idle owl
#

thank you

tulip sleet
#

samd and/or frequencyio

meager fog
#

@umbral dagger would having an email reminder for the nitely review behelpful

#

@umbral dagger they were super helpful

umbral dagger
#

I keep forgetting ๐Ÿ˜ฆ I'll set an alarm.

#

done.

meager fog
#

lol ok thankx

idle owl
#

Ok in mpconfigboard.h you update the HW_MCU_NAME to match the chip, but in this case it's "samd21e18" and then the CHIP_VARIANT in mpconfigboard.mk is the full SAMD21E18A so is the MCU_NAME the chip name lower-case without the extra bit on the end every time and the VARIANT is it including the last letter?

tulip sleet
#

@idle owl I think one might just be for printing (the lower case one), so it might not matter. I'll look it up.

idle owl
#

Ok thank you

tulip sleet
#

@idle owl yes HW_MCU_NAME is just used in various version strings. whereas CHIP_VARIANT affects the compilation. probably the missing suffix could be considered a minor naming bug

idle owl
#

Ok

tulip sleet
#

we never buy the B variant - no use for it

idle owl
#

Ah ok, thanks

tulip sleet
#

@slender iron FrequencyIO is 2420 bytes

#

samd was 16 bytes (!) obviously there's some compilation weirdness there, but it appears quite small

slender iron
#

that seems suspect

tulip sleet
#

I think maybe the module is still being compiled or something, so the dictionaries may still be there

slender iron
#
271                tcc->PER.bit.PER = top;
   0x00008b0e <+594>:    ldr    r0, [r3, #64]    ; 0x40
   0x00008b10 <+596>:    lsls    r4, r4, #8
   0x00008b12 <+598>:    lsrs    r0, r0, #24
   0x00008b14 <+600>:    lsrs    r4, r4, #8
   0x00008b16 <+602>:    lsls    r0, r0, #24
   0x00008b18 <+604>:    orrs    r4, r0
   0x00008b1a <+606>:    str    r4, [r3, #64]    ; 0x40
#

interesting how this expands out

tulip sleet
#

@slender iron they're just two-byte instructions

idle owl
#

@tulip sleet When you have a few minutes, can you assist me with some structure decisions for this guide? I'm at a point where it's one giant page and I think I know where to split it, but having done this once already and thinking I did it wrong and reverting, I'd rather have someone else who knows the process take a look first and tell me if I'm totally off on that idea.

slender iron
#

ya, I think I'll just turn of frequencyio

#

do we have a build setting for m4 only?

tulip sleet
#

something is weird here: CIRCUITPY_FREQUENCYIO is supposed to be off, but seems to be on: see ports/atmel-samd/mpconfigport.mk

#

I would like to make BUILD_192KB, BUILD_256KB, and BUILD_FULL, but hadn't gone around to that yet

slender iron
#

I want a barebones one as well for porting

tulip sleet
#

that's fine, just something more than SMALL and LARGE, which were not great choices

slender iron
#

frequencyio could be an include order issue

tulip sleet
#

BUILD_MINIMAL

slender iron
#

ports/atmel-samd/mpconfigport.mk has a typo

tulip sleet
#

'FRQ'

slender iron
#

yup ๐Ÿ˜ƒ perfect

#

1528 bytes free in flash out of 253696 bytes ( 247.75 kb ). for pinyin now

#

๐ŸŽ‰

tulip sleet
#

:forehead_slap:

slender iron
#

๐Ÿ˜ƒ

#

love finding stuff like that

tulip sleet
#

yup ๐Ÿ˜ƒ

slender iron
#

makes grabby hands towards free code space

raven canopy
#

That all also highlights something I need to address in the dynamic support matrix for RTD. I don't handle port-wide settings.

indigo wedge
#

Nice work guys ๐Ÿ˜„

manic glacierBOT
granite crow
#

Hi @raven canopy , I was wondering if you could give me a hand or ideas on how to solve the issue 1886, I left some comments on there on how I was getting started to try to solve it gus

raven canopy
#

@granite crow I'll peek closer at it tonight. I've seen the comments flow through, and a few ideas come to mind. I think you're on a good path so far!

granite crow
#

Sounds nice to me, I will be also thinking about it

onyx hinge
#

nrf audio mini progress report: since my last landmark (playing a hard coded sine wave) I have completed most of the structure to use sample objects, loop, and double buffer (so to speak). However, no sound comes out. Entering debugging mode. What would I even do without j-link!

#

surprise: by turning OFF optimization, I get a diagnostic and my build stops. ugh. ```../../shared-module/displayio/TileGrid.c: In function 'displayio_tilegrid_get_refresh_areas':
../../shared-module/displayio/TileGrid.c:452:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (displayio_area_size(&self->dirty_area) <= 2 * self->pixel_width * self->pixel_height) {
^~
cc1: all warnings being treated as errors

#

by writing "2u" that error goes away. curious.

#
87            audiosample_get_buffer(self->sample, false, 0,
88                                   &buffer, &buffer_length);
``` get_buffer_result is GET_BUFFER_DONE which seems right, but buffer is NULL and buffer_length is 0, so playback stops
prime flower
#

@solar whale just released an updated Adafruit IO CircuitPython...with a MQTT class ๐Ÿ˜ƒ

onyx hinge
#

I have been learning a little bit about MQTT because of Sonoff-Tasmota. Do you have an application in mind for it @prime flower ?

#

OK, a missing audiosample_reset_buffer call explains that, now I get buffer_length 256

prime flower
#

@onyx hinge Plenty of examples (for now). I'm moving over a buncha Adafruit IO Arduino MQTT examples to CircuitPython's MiniMQTT

#

Checking out Sonoff-Tasmota

onyx hinge
#

Sonoff are wifi relays and tasmota is an open source firmware for them

#

Many of the sonoff models are pretty easy to flash with pogo headers

prime flower
#

maaaybe possible with the new work being performed on the ESP32SPI Server PRs

tulip sleet
#

@onyx hinge I made that exact same fix 2 -> 2U when doing some BLE stuff. It's in my PR that is in review state.

#

it's some odd optimization thing that only shows up on the nrf builds

#

2u is correct, the compiler should have caught this in all cases

manic glacierBOT
#

After some mental walking through the problem, I don't think tools/build_release_files.py is a good home for this.

Since the Travis jobs run as a matrix, and build_release_files only gets a limited set of board names, it would be difficult (but not impossible) to keep track of what matches the condition of board not built, but exists. (Further explanation if you don't understand the .travis.yml. Each line under env: is an environment variable, and forces a separate matrix job. Th...

onyx hinge
#

@tulip sleet do you think it's likely to be merged soon, or would a pull request with just that change be useful?

tulip sleet
#

should be merged in the next day or two

onyx hinge
#

Great, I won't sweat it then

manic glacierBOT
gaunt bay
#

Does anyone know if I can run CircuitPython on a Particle Argon, and access the Particle Cloud and related functions like publishing variables and events?

marble hornet
#

from my understanding: no. this is because installing cp can (depending) wipe out not only the particle software but some of their burned in info, etc. and you might get better answers in #help-with-circuitpython

#

@gaunt bay

gaunt bay
#

Got it, thanks!

marble hornet
#

i would use a particle and another board together and write a lib on the particle to turn it into an spi or serial peripheral fora cp device.

#

if it is really necessary

onyx hinge
#

yay it's not right yet but I'm getting sound that I can tell is intended to be the .wav file I'm using for testing

#

@cerulean pawn https://github.com/jepler/circuitpython/tree/nrf-pwm-audio If you are interested, you can check out the current state of this. Basically, it can play a single sample, with what sound like clipping artifacts, and then you need to reset the board because it never realizes it has reached the "stopped" state.

#

I am playing on a particle xenon using pin D4 for audio output. if you want to experiment with unfinished code, I would be happy to hear whether you can also play a sound once. besides changing the pin to use, my code is pretty much the basic CP audioio code.

#

.. I'm out for the evening, more updates tomorrow afternoon/evening US central time

manic glacierBOT
#

Hi @sommersoft, thanks for the explanation, now the problem to solve and the solution you're proposing are clear to me, i just have one question. Does the result of the search pattern TRAVIS\_BOARDS\=\"(.+)\" the same as if i get the boards using os.environ["TRAVIS_BOARDS"]`?
I'm not very familiar with regex, but if it's necessary i can take a look at it.

Meanwhile, what do you think it should be a good name for the new script? I think check_all_boards_are_being_built.py is a long one...

solar whale
#

@gaunt bay please donโ€™t post the same question in multiple channels. I replied in #general-tech

cerulean pawn
manic glacierBOT
craggy galleon
#

Open question to anyone who can answer it above. I am interested why I2C on 'non-i2c' pins works

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have seen before on the SAMD21 that some pins were excluded from I2C even though they worked. In that case it was because of under-spec current sinking on those pins. The I2C pins had higher current capability than most of the other pins In practice the under-spec work fine. The might be flaky on very long runs, but we have never seen that.

However, on the SAMD51, PA08 and PA09 are supposed to have higher sink ability: Quoting from the datasheet: _3. These pins are High Sink pins and hav...

#

So based on your above comment @dhalbert it is likely that in most cases they will work (as they appear to be working for me both in CircuitPython and Arduino) but could experience issues.

I understand what you are saying about how much power they can sink and the different supplies. I just found it strange that they (1) worked and (2) datasheet said otherwise.

I have the same case on PA00 / PA01 --> working I2C even though they are not in datasheet.

The only reason I even trie...

manic glacierBOT
steep mantle
#

@cerulean pawn either you work with Mahesh or you are more fortunate than me. I've been waiting for the Blip to come out. Crowd Supply still has it pre-order.

manic glacierBOT
slender iron
#

<@&356864093652516868> master is now 5.0.0 WIP with โฌ†

tulip sleet
#

yabba dabba do!

umbral dagger
#

Woot!

stuck elbow
#

how the time flies

marble hornet
#

๐Ÿ‘

tulip sleet
#

time flies with time.monotonic()

pastel panther
#

Why it seems like just yesterday we were putting the polish on 3.0.

They grow up so fast! ๐Ÿ˜ญ

orchid basinBOT
tidal kiln
#

and i 'member when people made kombucha brewers with a trinket and CP 1.x beta

cerulean pawn
#

@steep mantle haha, yeah I work at electronut labs

lone sandalBOT
solar whale
#

@tulip sleet I just tried the ble_demo_cental taht I used af ew days ago with 5.0 alpha and I get ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0 on 2019-07-18; PCA10059 nRF52840 Dongle with nRF52840

import ble_demo_central
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ble_demo_central.py", line 35, in <module>
File "adafruit_ble/uart_client.py", line 73, in connect
TypeError: extra keyword arguments given

tulip sleet
#

yes, the PR for the BLE library isn't done yet, so it will not match. You can get the latest dhalbert/Adafruit_CircuitPython_BLE and I think it will be OK.

solar whale
#

ok -- thanks -- no rush -- juat wanted to be sure I had not done something wrong.

tulip sleet
#

oops, but not on master, on the branch python-advertisement-data

#

you can wait too, should be done soon

#

service_uuids is now service_uuids_whitelist

solar whale
#

I can wait for you you to finsish -- I have lots of other things to do ๐Ÿ˜‰

tulip sleet
#

that's fine - thanks for testing!

solar whale
#

np !

onyx hinge
#

OK, back to pwm audio. The current sub-task: when playing a non-looping sample, correctly return the AudioOut object to non-playing status at completion.

#

(hi all)

simple pulsar
#

@onyx hinge Is the code you are adding applicable to any board with pwm capabilities?

onyx hinge
#

@simple pulsar It is pretty specific to the nrf52840

simple pulsar
#

I was just curious. I've done a bit of audio work (from an application point of view) in past. I had put in https://github.com/adafruit/circuitpython/issues/1623 but I suspect that's more core functionality and might mean things need a bit of rearranging although I've not looked closely at that code

GitHub

It would be useful to allow audio samples that are playing with the looping feature to be optionally terminated after a complete sample, e.g. to an integer number of samples will be repeated. I&amp...

onyx hinge
#

That would be a nice addition

#

hmmm, looping works except 50% of the time when it doesn't.

#

or, rather, .stop() doesn't work 50% of the time, .. maybe

simple pulsar
#

That could be useful

#

It will only be usable by lucky users. It could be used to determine how lucky people are.

onyx hinge
#

OK, looping and stopping work now!

#

I need to figure out if the clipping problem is my code, or it's feeding an inappropriate (digital) signal to the audio amplifier.

#

hmm but RawSamples don't loop(?)

manic glacierBOT
onyx hinge
#

pause and resume. hm. I don't think you can interrupt a PWM sequence in the middle, unless you just want to disable the PWM instance entirely

#

no, I can send STOP whenever I want, but I can only START from the top of a sequence

#

and there's no way to see where in the sequence you are

#

@slender iron @meager fog Is this nrf pwm audio targeted at 4.1 or at 5.0 ?

raven canopy
#

i would guess 5.x

#

though, i guess SemVer rules would allow for 4.2... backs away from keyboard

onyx hinge
#

whee, branch updated. WIP history cleaned up. Realized I didn't test with any 8-bit samples. Will fire off a pull request yet this evening, I hope, though I expect to have changes requested.

manic glacierBOT
#

This implements AudioOut, with known caveats:

  • pause/resume are not implemented
  • at best, the sample fidelity is 8 bits
  • on my test system, certain "loud" samples sound like they are clipping
  • on my test system, samples not "centered" at mid-scale sound distorted (so the "sine wave RawSample" example doesn't work properly)
  • Scott requested that this be called "pwmaudioio", but it's still living at "audioio".

Testing performed:

My test system is a Particle Xenon with a PAM...

onyx hinge
#

TWO THOUSAND

#

ahem

#

'night all

stuck elbow
#

stupid idea: how hard would it be to log errors to a file?

#

(for all those people who can't use the serial)

manic glacierBOT
tulip sleet
#

@stuck elbow we already do that for boot_out.txt; the mechanism is there; so we'd just need a call to enable it

stuck elbow
#

that could be a nice workaround for when the serial is not working

#

just the lat exception, so that it doesn't grow indefinitely

tulip sleet
#

We could just give a max size for the file, and maybe wrap around if we overflow.

#

need to have a fence marker in the file, or use two files

manic glacierBOT
stuck elbow
#

that gets complicated fast, and then you would have to parse it too

#

I think just writing the version line (like now) and then the last traceback would work very well and be relatively simple

cerulean pawn
#

in nrfx_config.h, there are two #ifdefs, #ifdef NRFX_TIMER3 and ifdef NRFX_TIMER4, shouldn't they be #ifdef NRF_TIMER3 and #ifdef NRF_TIMER4, which will come from nrf52840.h?

manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-5
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-4
#
[adafruit/circuitpython] branch deleted: jerryneedell\-patch\-1
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-1
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-2
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-3
manic glacierBOT
#

Still a draft and my python isn't perfect so let me know if i'm doing something silly.

Here's what i print on the console so far (so the script is opening the travis.yml file and finding all the lines with TRAVIS_BOARDS in it, it's skipping 2 lines :-1: ):

TRAVIS_BOARDS found
  - TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express maker...
tulip sleet
#

@cerulean pawn OOPS, yes, I will fix this in my next BLE PR, or you could submit a separate PR.

#

Thanks for spotting that!

manic glacierBOT
granite crow
#

Hi, what version of python runs on Travis? I'm trying to unpack a dict_keys into a list and i think i require python >= 3.5

tulip sleet
raven canopy
#

@granite crow for the core repo's Travis, it runs version 3.5.

granite crow
#

Thanks @tulip sleet and @raven canopy ๐Ÿ˜ƒ

#

@raven canopy I got the script almost done, i'm now trying to figure out how to know if all the boards listed in TRAVIS_BOARDS are in the boards listed by build_board-info.get_board_mapping()

#

So if a board isn't in TRAVIS_BOARDS but is in the board_mapping travis will fail (i guess)

raven canopy
#

You'll probably have to raise an exception, or use a non-zero sys.exit(). Either way works for forcing Travis to fail. But I would be sure to have print out a list of the missing boards.

granite crow
#

Sounds nice

granite crow
#

Any recomendation on how to compare both board lists? Do i need to get fancy searching?

manic glacierBOT
prime flower
#

Why does SPI Device not have a deinit() property? Is it because it's meant to be used with a context manager?

manic glacierBOT
umbral dagger
#

@meager fog I need an empty repo: Adafruit_CircuitPython_BitmapSaver is my name suggestion.

tidal kiln
#

@prime flower yep

manic glacierBOT
slender iron
#

@umbral dagger still need the repo?

umbral dagger
#

@slender iron No, @meager fog hooked me up

slender iron
#

kk

manic glacierBOT
graceful heart
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.1\.0\-rc\.1
slender iron
#

@graceful heart no plans that I know of. string formatting routines can be pretty large so I'd hesitate to add it

graceful heart
#

yeah, I figured that was the case.

#

it also wouldn't be a ton of effort to convert the time struct to the format required by the header.

#

wait a second..... my itsy bitsy is reporting the current time is January 1, 2000.

#

ok, I guess that just means i don't have an RTC. does that mean the time is relative to boot up? @slender iron

slender iron
#

ya, it is boot relative. you should be able to set it though

graceful heart
#

I guess if you made an API call to an RTC service you could set it that way lol.

tulip sleet
#

@raven canopy I did make an alpha release of Adafruit_CircuitPython_BLE a few hours ago, but after the cron job time. Its tag is of the form that should be ignored by the bundle releaser.

manic glacierBOT
orchid basinBOT
raven canopy
#

@tulip sleet roger dodger. i'll run a test tonight or in the morning.

#

i'm wading through systemd. i'll need to search for oxygen soon... ๐ŸŠ

onyx hinge
#

Hm, as @slender iron requests, I am trying to move the nrf's audio to a new audiopwmio module (to track with the exising audiobusio package). What's the appropriate way to let the Sample classes that live in audioio on boards with DACs appear in audiopwmio for nrf?

manic glacierBOT
onyx hinge
#

I did figure out one thing, though -- running the amplifier from +3.3V is bad, running from VUSB is good. Must not be enough current available from the regularot.

#

it sounds much better after that switch

#

something else is the problem with RawSamples though

exotic pumice
#

another great episode of embeddedfm this week https://embedded.fm/episodes/295

manic glacierBOT
crimson ferry
#

@graceful heart I've been using server headers to keep clock time on my CircuitPython devices, along with seconds-tracking using time.monotonic_ns(). Good enough for TOD until some kind of async comes along.

graceful heart
#

@crimson ferry oh that's clever! Unfortunately for me, the CircuitPython device is acting as the server handling incoming requests, and It doesn't look like Date is a header that is typically sent with Requests

tough flax
#

Hey all, looking to read a binary file that has both fixed structure and null-terminated strings. The struct module is (frikkin) magic, but doesn't have a way to read a string. Any ideas? Should I just read bytes one at a time into a buffer that I pre-allocate and then convert the bytearray to a String? That has a problem that the buffer needs to be big enough to hold the whole string... or I can use String concatenation which I'm sure will waste memory and time

alpine shore
#

@tough flax How big can the string be at most, in the binary format?

raven canopy
#

@tulip sleet "stable libraries ONLY" bundle update seems to work as expected:

commit 83241291ac8fa257320dc88927fa1fc266d44528 (HEAD -> master)
Author: sommersoft <sommersoft@github.com>
Date:   Sat Jul 20 08:10:58 2019 -0500

    Automated update by Adabot (adafruit/adabot@1939062)
    
    Updating https://github.com/adafruit/Adafruit_CircuitPython_TinyLoRa to 2.0.0 from 1.0.8:
      > Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#22 from brentru/add-rst-on-init

we'll see if prod agrees.

umbral dagger
#

Question/advice: I have a slight, non-breaking, tweak to displayio.Palette that I need out asap. What should I PR against?

stuck elbow
#

against?

umbral dagger
#

what branch I guess. I don't want to have to wait for 5.0.

manic glacierBOT
#

I'm late in catching this. There are a few aliased boards returned by get_board_mapping(), which are not actual buildable boards:

gemma_m0_pycon2018
circuitplayground_express_4h
circuitplayground_express_digikey_pycon2019

I drummed up a list comprehension that takes care of not including any aliases:

info_boards = [board for board in boards_info_json.keys() if not boards_info_json[board].get("alias", False)]
manic glacierBOT
tough flax
#

@alpine shore probably 100 bytes or so

tulip sleet
#

100 bytes should not be an issue even on M0

#

@umbral dagger you could submit against 4.1.x. We are trying to get the release candidate out soon. 5.0 will have an alpha release also very soon, and itโ€™s quite close to 4.1, do it should be quite stable. That would be against master

tough flax
#

@tulip sleet no I meant each string

#

The whole file is like 4K. But Iโ€™m just looking for an efficient way to read a null terminated string from a binary file

#

I have it working but itโ€™s joining each char together

#

Seems messy

tough flax
#

So, I have a memory/processing time choice (on a Trinket M0 no less). I have a 24x24 cell membrane that I need to read press/releases from and them map them to keystrokes. I think I have two options but am looking for more or recommendations. I can pre-calculate each cell's action (w/references into a table) and then easily lookup each press/release and figure out which HID messages to send. OR I can walk through the list of cells and check for intersections (all of the cells are rectangular) and then process the changes.

On an M4, I'd just eat the memory and go with the faster lookups, but it doesn't seem like there's an efficient structure in Python for a 2D grid. I'm using nested lists and they seem slow and wasteful.

Any ideas?

stuck elbow
#

if the size is fixed, you can use tuples instead

#

they are less wasteful

#

not sure what you mean by "cell's action" โ€” how would such a calculation look like?

tough flax
#

When a cell is pressed, it might trigger a keypress or mouse movement. So, when the config file (overlay) is loaded, I can either keep track of all the regions that are assigned different keys, or I can build the grid that has each cell assigned an action ("Letter A" or "Mouse Left"). Then Press/Release of that cell triggers that event

#

It's a big keyboard

#

with programmable areas for the keys

stuck elbow
#

I'm not sure I understand the difference then

#

in both cases you have to somehow store what each key does, no?

tough flax
#

They're not keys... under that piece of paper (which has an 8x12 layout) is a 24x24 grid of cells under a membrane

#

So I have a choice: store what each CELL does, and lookup quickly

#

Or store what each defined AREA does and do an x/y lookup on each on for each press

#

One will use more memory, one is slower

#

I'm looking for guidance on choosing or another option in Python I don't know of (I'm not a Python guy, right @turbid radish ?)

raven canopy
#

@tough flax i think to @stuck elbow's point, the memory footprint is going to be similar. right? if the LUT won't fit on the internal flash, i think a FRAM chip is a good candidate. SPI version in the store is 8K, and I2C is 32K, iirc.

#

i get that doing it by AREA is smaller chunks, which helps when the stack is fragmented. unless AREA also allows to do some slick bit-shifting type stuff that can't be done with CELL?

#

downside to FRAM LUT: updating would not be as easy as putting on a new UF2.

quasi fjord
#

so each of those "keys" is actually 6 cells? Left/Right x Top/Center/Bottom?

tough flax
#

On this overlays thatโ€™s about right. But each will be different. But yes, top left, width, height

#

Perhaps a bytearray where I do the row/column math myself?

stuck elbow
#

I think you would be best off by having a bytearray (or a byte string) of 576 bytes, each telling the function of the 24 * y + x cell

#

because if you try to store it by areas, it's 4 bytes per area, at the least, and you can have like 100 areas easily

quasi fjord
#

hmm, defining by region sounds easier for defining maps but it's a bit more computationally intensive.

stuck elbow
#

the difference is negligible

quasi fjord
#

hmm, if bitstruct works in CP it might save you some RAM

tough flax
#

Ok, it sounds like the bytearray's the same thing I posted above (unless I'm misreading you). I think I'll go that way for now.

stuck elbow
#

a single byterarray is going to have much smaller overhead than a list of lists of arbitrary python objects

lone sandalBOT
slender iron
#

Hi all. We have our regular community CircuitPython meeting on Monday at 11am Pacific / 2pm Eastern here on discord in the CircuitPython voice channel. All are welcome to attend. We have a notes doc you can put notes into ahead of time here: https://docs.google.com/document/d/1IITBngDCVEm7zNwnyD_nIUzhZPXSMc4pqRJzFyf0zDs/edit?usp=sharing Hope to see you there! <@&356864093652516868>

manic glacierBOT
charred forge
#

Good morning! I've got a little problem... I'm trying to work with the AdaFruit FancyLED package. After copying the adafruit_fancyled dir into place (in CIRCUITPY/lib), I'm getting an error when running simple examples: ```Traceback (most recent call last):
File "code.py", line 195, in <module>
File "code.py", line 140, in main
File "adafruit_fancyled/fastled_helpers.py", line 111, in loadDynamicGradientPalette
AttributeError: 'module' object has no attribute 'CRGB'

#

Based on the PY code, I can't see anything obvious. The CRGB class is clearly defined in adafruit_fancyled.py.

scarlet maple
#

CircuitPython 3? 4.0? 4.1?

charred forge
#

4.0.

#

4.x.x is the bundle I downloaded and installed. Don't know how to check 4.0 vs 4.1

scarlet maple
#

The bundle is the libraries. Probably the same for 4.0 and 4.1. There was a .uf2 file that's the actual CircuitPython interpreter and firmware. That's different between 4.0 and 4.1

solar whale
#

@charred forge to check your CircuitPython Version you can either look at the contents of the boot_out.txt file on the CIRCUITPY drive or easier, just connect to the REPL and the Version is printed every time the REPL starts (if you have a code.py or main.py running halt it with Control C then press enter to go to the REPL)

charred forge
#

Adafruit CircuitPython 4.0.2 on 2019-06-27; Adafruit CircuitPlayground Express with samd21g18

swift arrow
#

any plans on CP support for ESP32 Huzzahz feather? Silly me just "assumed" that CP was on it since adafruit sold it ๐Ÿ˜ƒ

#

I'd imagine it is challanging because it is dualcore.. but what if one core was dedicated to the BLE/wireless processing and one core was dedicated to everhting else.. kind of like having a built in airlift.

solar whale
#

@swift arrow the esp32 lacks native USB so it cannot use the .uf2 bootloader or have it File sustem mounts as a USB drive (CIRCUITPY). The same was true of the ESP9266 and the nrf52832 so support was dropped for them. There are rumors of a new ESP32 chip with native USB so if it materializes, it may be supported.... BTW MicroPython does support the ESP32.

swift arrow
#

but my computer connects to my Huzzahz ESP32 with USB.. and loaded usb drivers for it

#

or is that not "native"

#

if micropython supports it and our CP is a fork/built off of micropython, shouldn't we support it ๐Ÿ˜ƒ

#

not trying to be a PITA.. I fear it just comes naturally..

#

It's interesting because the product page on adafruit makes it sound like the ESP32is the up coming chip and is going places.. but it really hasn't. Whch is a shame given it's speed and RAM.. 520KB.. that would be so sweeeeet for CP.

solar whale
#

The USB connection to the ESP32 uses a CP2104 USB to UART bridge. the ESP32 does not support USB itself.

#

The Micropython support does not have a USB mounted filesystem. You have to use a special tool (ampy) to load files to the ESP32 -- not bad, just different.

#

I'm not going to try to convince you it should not be supported, I'm just letting you know why it is not. This has been discussed several times in the past.

swift arrow
#

thanks @solar whale . It helps to understand the why of things

upbeat plover
#

hmm latest version broke my UART SD logger
File "adafruit_sdcard.py", line 113, in __init__ File "adafruit_sdcard.py", line 145, in _init_card File "adafruit_sdcard.py", line 236, in _cmd OverflowError: value must fit in 1 byte(s)

#

never mind.... I needed to update Libs

#

i updated "adafruit_sdcard.py" and it is working like before

graceful heart
#

Hi everyone. Did some more work on the ESP32 Server PR. Did some re-working so the main piece of functionality we're adding is a WSGI compatible server implementation for the ESP32 over SPI. https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/59

This allows us in the future to write a separate CP library that is a WSGI web application framework. This way, as more wifi boards comes out that support server functionality, we can write a WSGI server for it and re-use the WSGI web app framework lib.

If anyone has some free time, would appreciate some feedback ๐Ÿ˜ƒ

tough flax
#

Just a short whine.... I'm slowly dying trying to use CP on the Trinket M0 :-(
Future projects will use the Itsy M4 or Arduino... its just SOO tight on Mem.

solar whale
#

@tough flax Even the M0 express boards are tough to use. It's nice that the M4s are available.

tough flax
#

More than anything, I wish it was more predictable. More and more, I get through testing and its fine and then with zero change to code, it runs out of memory when connected to another machine (or even mine). When you get close, it seems very strange. And I don't understand why gc.collect() should stop it from running out of memory. Certainly when it runs out it tries to collect, right?

solar whale
#

I have not been able to make sense of it either. Perhaps someone more Python proficient can comment.

drowsy geyser
#

Making a guess, but I'd say the GC is removing references to the memory locations, but not compressing used memory back into contiguous blocks. That's wild speculation; I'd have to go prowl through the interpreter code to know for sure.

solar whale
#

I think of the M0 as a stepping stone in the development of CircuitPython..

drowsy geyser
#

Sidebar: I built a high-power rocket controller out of a Feather M4 and I still couldn't get all the code to fit. I haven't revisited, but I suspect I'll have to write C++ and cross-compile.

solar whale
#

That's a lot of code ๐Ÿ˜‰

#

I suspect a lot of sensors and libraties

drowsy geyser
#

Yeah, it's a lot. Status lights (NeoPixels), barometric pressure, accelerometers, etc.

#

I'm looking at gc.c and I think what's happening is that it goes through the allocation table and if memory can be freed it's added to the finalizer table (FTB). I'm still digging through it, but it seems like if you're driving right to the edge the GC will actually run out of memory populating the FTB. In the Unix world, this would cause a kernel panic.

simple pulsar
#

@drowsy geyser The other question is how memory allocated by CircuitPython works during execution of the CircuitPython program. That's unlikely to be relocatable. There was a way of looking at memory layout but it (micropython.mem_info(1)) was removed from CP to - wait for it - save memory!

drowsy geyser
#

Hmmm. I'll have to keep digging....

simple pulsar
#

BTW, I've been building up a list of factors that affect memory in fourth post on: https://forums.adafruit.com/viewtopic.php?f=60&t=148334 - the biggest surprise for me was import order is very important. I just edited it a little to highlight the two examples of libraries where style of usage can affect memory use, audio and neopixels

stuck elbow
#

CP's gc doesn't do relocation, because it uses a conservative algorithm for detecting pointers, so it's never sure if something really is a pointer

#

but it does keep the "long lived" and "short lived" objects separately, which is an improvement compared to MicroPython

simple pulsar
#

@slender iron @tulip sleet I've got a CircuitPython hang that I've seen on 4.1.0 rc0 and rc1 if I leave some code running. Takes about ten minutes on a PyGamer to hang, it's not predictable but will do it on about one in four executions. The serial connection becomes disconnected but probably with no close and the CIRCUITPY becomes inaccessible. I left the PyGamer screen illuminated and that's almost same printed line as I see on serial out. I say almost because I get one extra line on the USB serial rather than screen which surprises me a little. If I reset it doesn't do that safe mode thing. I tried 4.0.2 and it didn't seem to do it but because this occurs infrequently I can't say for sure whether 4.0.2 is ok or not. I think this needs some debugging stuff I don't have to catch what it's doing...?

manic glacierBOT
tulip sleet
#

@simple pulsar Could you file an issue with the code in question? Also say what the host system is. Thanks!

raven canopy
#

finally slayed this Ansible dragon!!

rosie@rosiepi:~ $ sudo journalctl --since="16:03:00"
-- Logs begin at Thu 2016-11-03 12:16:42 CDT, end at Sun 2019-07-21 16:04:14 CDT. --
Jul 21 16:03:39 rosiepi systemd[5338]: Reloading.
Jul 21 16:03:43 rosiepi systemd[5338]: Started RosieApp as systemd Service.
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO  WEBrick 1.3.1
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO  ruby 2.3.3 (2016-11-21) [arm-linux-gnu
Jul 21 16:03:46 rosiepi rerun[23366]: == Sinatra (v2.0.4) has taken the stage on 3000 for development wi
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO  WEBrick::HTTPServer#start: pid=23368 p
Jul 21 16:04:07 rosiepi rerun[23366]: 2019-07-21 16:04:07 - RuntimeError - Invalid JSON (A JSON text mus
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 CDT] "GET /event_handler HT
Jul 21 16:04:07 rosiepi rerun[23366]: - -> /event_handler
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 -0500] "GET /__sinatra__/50
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 CDT] "GET /__sinatra__/500.
Jul 21 16:04:07 rosiepi rerun[23366]: http://192.168.0.20:3000/event_handler -> /__sinatra__/500.png
exotic pumice
#

I've experimented with ansible. I think it's pretty cool

raven canopy
#

it is. glad i already understood YAML (thanks Travis!). but the docs are...difficult at times. like all docs. why is documentation so challenging? ๐Ÿ˜„

#

oh, and this may be the better terminal result to outline the Ansible result:

PLAY RECAP ***********************************************************************************************************
localhost                  : ok=32   changed=6    unreachable=0    failed=0    skipped=4    rescued=1    ignored=0  
scarlet maple
#

Ansible is good for orchestration, less so for configuration management. Ansible can do something like configuration management with extra pieces, but Iโ€™m probably heading back to puppet for the long term.

raven canopy
#

i wanted a pull system, and Puppet turned me off a little with the whole agent-master piece. ansible-pull allowed me to just have a github repo, install ansible on the target (an RPi), and run it. Puppet does look pretty useful though. and i imagine the linting/dry-runs are better since they wrote their own syntax. my yaml linter experience has been...saddening (ansible & travis).

manic glacierBOT
swift arrow
#

@tough flax The ItsyBitsy M4 is really pretty nice.. and so tiny

#

It's cool to me because it has one 5v logic pin... which is great for Neopixels.

tough flax
#

Yes, all good, but on some of these Iโ€™m making 100 or so. So the trinket was cost effective

swift arrow
#

that adds up quick when you use 100 or so

scarlet maple
#

Yeah, YAML isn't doing much for some of my coworkers. I've done more Ansible role development than anyone in the group, but for what we need, knowing that systems are in "compliance" is more valuable than being able to fire off one-off playbooks.

somber helm
#

YAML is a bit too "forgiving" been using that with Salt, and it's been an issue a few times.

#

Wr're moving to Puppet for configruation management.

tough flax
fathom patio
#

hi, just wondering ... for custom REST or websocket or mqtt connections ... is there any way to have an encrypted connection? all links I could find for circuitpython don't talk about it at all.

#

micropython does in theory support it, but not on esp32 or something

#

(but I could use esp8266 with circuitpython maybe, if it would support secure connections)

somber helm
#

Websocket should support TLS?

manic glacierBOT
slender iron
#

@tough flax running collect before running out of space changes where the things after it are located and it cascades through the rest of the program's lifetime. running out of memory is a fragmentation game rather than actually a byte issue.

manic glacierBOT
manic glacierBOT
#

Not really! It was the first thing I found to look at memory but it raised more questions than it answered.

There was a discussion on discord (@ATMakersBill @deshipu @jerryneedell @hukuzatuna) recently about memory woes and how the programmer has little idea they are near the limit and very small changes or even deployments can cause the fatal MemoryError.

For posterity, here's what was coming out when I was looking at how memory was used as I ran bits of a program (on 3.0.2 on CPX):...

#

I've got a CircuitPython hang that I've seen on 4.1.0 rc0 and rc1 if I leave some code running. Takes about ten minutes on a PyGamer to hang, it's not predictable but will do it on about one in four executions. The serial connection (Windows 8.1 desktop) becomes disconnected but probably with no close (tapping a key in terminal window makes it realise the PyGamer's gone away) and the CIRCUITPY becomes inaccessible. I left the PyGamer screen illuminated and that's almost same printed l...

manic glacierBOT
#

Powered on PyGamer today, left same code running for 2 mins, then copied a file off and that triggered a restart. That hung within about 10 mins too. Same serial output, the last line is only on the serial over USB not the PyGamer screen. My printed line of text per loop is a touch longer than the PyGamer screen width so each line wraps onto a new screen line.

tough flax
#

@slender iron (and @tulip sleet I suppose): does that answer imply that there is no indirection in the addresses? I mean thereโ€™s no way to move an item on the heap?
If so I get it, but if there is, shouldnโ€™t the collect also defragment when memory is critically low?

tulip sleet
#

@tough flax Writing a compacting (defragmenting) gc is hard, and is really hard right now because the gc in MicroPython/CircuitPython is not "precise". Some discussion here: https://github.com/micropython/micropython/issues/3792#issuecomment-393734390 and in the surrounding thread. The "long-lived" stuff we added allocates storage for objects that are probably permanent (compiled code) in one space, and allocates temp objects in another. That was a step toward less fragmentation, but not a general solution.

The problem is knowing what to move, what points to the object that's moving, and when it's safe to move. There's data on the stack that can be mistaken for an object pointer, but it isn't. If we mess with that data thinking it's a pointer, but it's not, we'll damage the data.

prime flower
#

@fathom patio MiniMQTT supports SSL/TLS by default

tough flax
#

@tulip sleet yeah thatโ€™s what I meant about the indirection. One way other gc languages solve this is to have an allocation table that indirects each heap access. So if youโ€™re reading someObj.value and someObj was allocated dynamically, youโ€™d go to the table to get the current location of someObj before indirecting to .value.

#

It adds overhead to every memory access

tulip sleet
#

and uses up ram

tough flax
#

But solves the frag issue

tulip sleet
#

will be afk in a few mins

tough flax
#

Yes, I get the issues. I was just asking if it did it

tulip sleet
#

we wish it did, but sadly, it doesn't ๐Ÿ˜ƒ

tough flax
#

And... it wastes memory. But in a way that probably gives more usable ram in the long term

tulip sleet
#

we tend to leave core stuff to MPy so we can continue to pull from upstream

tough flax
#

The more Iโ€™m reading about men in cp; the more I think string processing is my problem

#

Reading configuration files, splitting, parsing, etc. all will allocate lots and thatโ€™s evil here

tulip sleet
#

it might help to make sure that once you know, say, that a variable holding a string is not being used, that you set it to None or something so that it's obvious it's garbage. ... ok, gotta go

prime flower
#

@tough flax Hi bill - I had a few interesting ideas last night regarding the PyPortal ALS and wireless connectivity. Can PM or move to a diff channel if you'd like since it's too off topic for here

slender iron
#

@tough flax yes, anything that allocates and free a bunch will make fragmentation worse

tough flax
#

I think Iโ€™m going to go to a python configuration file. No json and no .ini file. This is a bummer because Iโ€™d like the same format in our Arduino projects

#

But oh well

slender iron
#

we could improve the libraries to allocate less probably

manic glacierBOT
drowsy geyser
#

@slender iron We could also hack the GC code (looking at gc.c) to relocate blocks to contiguous memory, and maybe auto-trigger collect() after last object reference is removed? Obviously don't know enough yet, so perhaps speaking out of the wrong end of my body. Regardless, such a scheme would need to be opt-in because of the obvious performance hit.

slender iron
#

for 1) when would you know to long live the memory and 2) we don't store ref counts so how will you know when the last reference is removed

drowsy geyser
#

Uh, yeah, good points. I was thinking back to the days on UNIX when the gc calls were added by the compiler on free().

slender iron
#

๐Ÿ˜ƒ it's tricky but I'm open to ideas

drowsy geyser
#

Well, before I provide any more unsubstantiated wild speculation ๐Ÿ˜ƒ I'll finish groveling through the GC implementation.

stuck elbow
#

it would be nice to be able to make audioio use a pre-allocated buffer, instead of allocating one every time you call play

#

this time you could allocate it at the beginning when there is still space, and re-use it

simple pulsar
#

But I suppose that's only for one particular length sample so you can't really change it later without making a new array.array

slender iron
#

@drowsy geyser I recommend watching the stream I did too

stuck elbow
#

@simple pulsar that's for raw samples, for wav playback it allocates internal buffers

#

it makes games on ยตgame crash randomly too

simple pulsar
#

Oh, do they get reallocated when you play a new wav file then?

drowsy geyser
#

@slender iron Yes!!!! I forgot about that one! I'll go back and watch (when I'm not at work).

#

Oh, we have a weekly call in 1/2 hour, yes?

minor plume
#

I'll be text-only for the CircuitPython weekly chat.

drowsy geyser
#

Ah, ok. Thanks!

minor plume
#

@drowsy geyser I'm assuming there is one this week, but it's very far from up to me. ๐Ÿ˜„

#

@slender iron and @gilded cradle are probably people who can answer that question, maybe?

drowsy geyser
#

I assume there will be some comment in here, so I'll just chill for now. ๐Ÿ˜ƒ

gilded cradle
#

Yep, as far as I'm aware the meeting should still be happening.

stuck elbow
#

@simple pulsar yup

#

or when you re-play the same file

manic glacierBOT
graceful heart
#

I'll be listening / text only

stuck elbow
#

ditto

minor plume
#

Same.

rigid dune
#

me2 ๐Ÿ˜„

prime flower
#

@stuck elbow your mic is on ๐ŸŽค

old smelt
#

Lurking

drowsy geyser
#

Audio is good.

#

Lurking today too, since I'm in the open office space, ostensibly "working."

twin mica
#

lurking

inland tusk
#

Lurking

prime flower
#

@slender iron I could, is there a link to the doc?

slender iron
graceful heart
#

@drowsy geyser haha same ๐Ÿ˜›

river quest
#

PyOhio is July 27-28, 2019 in Columbus, Ohio! Kattni Rembor will be the opening keynote speaker!
https://www.pyohio.org/2019/

PyOhio is a FREE annual Python conference. July 27-28, 2019 in Columbus, OH.

minor plume
#

Status and hug reports added to the doc.

river quest
#

295 - In the key of lime - Embedded.fm podcast -
https://embedded.fm/episodes/295

#

8/8/2019 is CircuitPython day!
Getting started programming microcontrollers with CircuitPython by NYC Resistor - August 3, 2019.

CircuitPython Day with the India Linux Users Group Delhi (ILUGD) at the Delhi Technical University for Women - August 4, 2019
https://twitter.com/ilugdelhi/status/1153305958690328576

What do you think about the #circuitpythonday poster? Awesome, no? @hellozee54 is to be credited for the awesome work on poster :)

We have boards to hack on provided by @adafruit and @DelhiHHC volunteers to help out with your @CircuitPython
journey.

Tickets will be liv...

minor plume
#

My audio isn't working at all, but I updated the doc and will watch the recording later.

river quest
slender iron
#

ok, @minor plume I'll read it off. thanks!

river quest
gilded cradle
#

It's a really good video

tidal kiln
#

ok lurking

#

group hug

#

also dan for forum

#

and good luck to kattni for pyohio

stuck elbow
#

I have my mike working

graceful heart
#

๐Ÿ˜ƒ

errant grail
#

Lurking. Loving rc1,

slender iron
#
prime flower
#

no ๐Ÿฟ !

errant grail
raven canopy
#

aww. but i like "chipmunk cater"... ๐Ÿ˜ฆ hehe

errant grail
tidal kiln
errant grail
#

<lurk mode again>

drowsy geyser
#

(you can just say "Phil" ๐Ÿ˜ƒ )

slender iron
#

๐Ÿ˜ƒ

cerulean pawn
#

@onyx hinge trying to run your audiopwmio code, but as soon as I enable the audio amp IC, it shuts down the system :/ something wrong in the schematic I guess

slender iron
errant grail
#

unlurking

simple pulsar
#

@errant grail If you have a spare 5 mins, I'd be interested if your Feather M4 board on its own exhibits the same strangeness I see with its analogue out (I used A0, A1 does the same) trying to make a high frequency square wave: https://forums.adafruit.com/viewtopic.php?f=24&t=153707

errant grail
#

@simple pulsar will do. heading into the studio now and will report back.

drowsy geyser
#

Thanks team!

prime flower
#

thanks all!

errant grail
#

Thanks!

graceful heart
#

Thanks! cya.

cerulean pawn
#

@errant grail I have a custom board I'm trying it on, turning on the amp for the first time just now

meager fog
#

@umbral dagger @slender iron im in meetin's for rest o day so please chatter together about the displayio screenshottin'

slender iron
#

kk

solar whale
#

Have a great week, all ๐Ÿ‘‹

slender iron
#

@umbral dagger if you are up for it you could try hooking python to fill_area

manic glacierBOT
errant grail
#

@simple pulsar Yes, using CPy 4.1.0rc1 on the Feather M4 Express, there's an 8-step staircase from 0 to max value under all conditions I've observed, both one-shot and continuous.

#

The stairsteps are a fixed artifact regardless of the value selected. Always 1/8th of the maximum, about 5us per step. No artifacts on the trailing edge (from max to 0). Trailing edge fall time is about 3us.

#

@simple pulsar Does that answer your question?

slender iron
#

@raven canopy where is the total library count put?

simple pulsar
#

@errant grail Very helpful, still puzzling what causes it. Perhaps it's a hybrid DAC with 3+9 bits but I'm hoping there's a fix to get a consistent, faster rise

errant grail
#

It's confusing since the value change from max to min doesn't have a similar artifact.

simple pulsar
#

Indeed

errant grail
#

I wonder how CPy handles the normalization of the 16-bit value into the 12-bit DAC value. Haven't had the time or skillset to look under the covers yet.

#

The chip supports a 16-bit dithering scheme, too.

simple pulsar
#

It has some filtering too and a current mode

#

Do you mind if I add your images to forum post?

errant grail
#

Would prefer to use raw values, personally.

#

Yes, okay to share the photos.

simple pulsar
#

Is there a lightweight/practical way to put a query into Microchip to ask if that's expected DAC behaviour on SAMD51? They might quickly say "yes, that's what it does" or "you want to change X to get it to behave normally".

slender iron
#

@errant grail it just drops the last four bits

#
  • lowest
errant grail
#

16-bit dithering can be combined with Interpolation, as well. I'm getting above my pay grade with this...

simple pulsar
#

Oh, I did wonder if 0 is a special optimisation in some way (grasping for an explanation of fall slew being ok) but didn't try other values for low of square wave.

errant grail
#

Same here. Just cycled between 0 and a variable value up to 65535.

simple pulsar
#

I'll try 4096 61440 later on

errant grail
#

Could it be in the MicroPython source, perhaps?

#

Anyway, nice catch. I noticed the artifact when playing around with X-Y plots on the o-scope, but thought it was something related to signal noise.

#

... or issues with getting X-Y to work on a digital scope.

#

I have an outboard 12-bit dual DAC that I'll test tonight when back in the studio. It uses an "ancient" driver that pipelines raw 12-bit values to the DAC via I2C.

#

May not prove anything, but will at least give me a baseline perspective.

simple pulsar
main meteor
errant grail
#

^ nicely done. Can't beat X-Y on an analog o-scope.

simple pulsar
#

@main meteor thanks, it's awaiting publishing, that video is currently unlisted

stuck elbow
#

@slender iron about that idea of yours for disabling memory allocation -- how hard do you think it would be to be able to "sandbox" a fragment of code to a pre-allocated fragment of memory?

#

@slender iron so that it can allocate, but only inside that buffer you give it

#

I guess MicroPython does something like that with that emergency exception buffer for interrupts

slender iron
#

@stuck elbow I think that'd be tougher than turning them all off

stuck elbow
#

for sure

manic glacierBOT
raven canopy
slender iron
#

kk perfect

#

thanks @raven canopy

#

@tulip sleet @ionic elk I think I usually grab the pip install line out of travis

#

I use brew to install python3 and then create a virtual env to install into

ionic elk
#

I used the travis install line but it hasn't added anything to the path. I don't have a virtual environment.

slender iron
#

did you install python through brew?

ionic elk
#

yes

tulip sleet
#

what is your $PATH?

slender iron
#

did it output any info about other commands to run?

ionic elk
#

/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/opt/X11/bin:/usr/local/CrossPack-AVR/bin:/usr/local/bin:/usr/local/bin

tulip sleet
#

if you try uninstalling something, like Sphinx, it will ask you to confirm the removal of files, and it will give their paths, so that's a sneaky way of finding what it put where. There's probably some pip info command to do that too

#

pip uninstall Sphinx, and then answer n

#

/usr/local/bin is very popular in your path

#

@slender iron is pip for python 2 on Mac?

ionic elk
#

@tulip sleet yeah, I haven't swept it in a while

slender iron
#

maybe

tulip sleet
#

try pip3 instead

ionic elk
#

I did install with pip3. I'll try the uninstall trick

slender iron
#

you can reinstall python with brew to see if there is anything else you need to do for it

onyx hinge
#

@cerulean pawn oh no!

ionic elk
#

@slender iron are you familiar with the bash clinging to old paths after a brew uninstall? -bash: /usr/local/opt/sphinx-doc/bin/sphinx-build: No such file or directory

raven canopy
#

@ionic elk, have you closed all bash instances, and started a new one? i imagine mac-bash works the same that the $PATH isn't updated on the fly...

ionic elk
#

@raven canopy EYYY I didn't know that! I guess I haven't done enough $PATH shenanigans.

raven canopy
#

$PATH shenanigans are the most funnest. /s

manic glacierBOT
ionic elk
#

Unfortunately, I'm now having another issue: ImportError: cannot import name 'TYPE_CHECKING'. My python 3 install is up to date so it shouldn't be having this issue. Do I need to manually specify for Sphinx to use python 3?

slender iron
#

ah, I always open a new terminal after updating PATH

ionic elk
#

@slender iron do you still have the old default of python 2.7 on your mac? Or have you moved everything over to python 3 now?

slender iron
#

I usually use python3

#

looks like python is 2.7 by default

ionic elk
#

Apparently I have python3 on my mac that has not been installed with homebrew. That's fun.

slender iron
#

ya, it's tricky to have everything jive together

ionic elk
#

I'm not even sure how to update it?

#

It's 3.5.0, so that might be causing the issue with type_checking

raven canopy
#

is pyenv available for mac? i recently used it, and it does help with the multiple version stuff... looking for mac-ability

manic glacierBOT
raven canopy
#

probably not worth it if you won't spend much time in Python land though

ionic elk
#

I see, I must have actually used the python downloadable installer way back. I've actually got an app for it in Applications.

#

Has anyone had that on their machine before? I'm concerned that just trashing it from the applications folder will cause some issues

raven canopy
#

i have no Mac experience. cannot assist. ๐Ÿ˜ฆ

slender iron
#

@ionic elk I think that delete it from applications is the way to go

ionic elk
#

Had to also delete the Library/Framework files but now I think I'm set! It's returning the proper homebrew version

#

OK, finally working. thanks for the help @raven canopy + @slender iron

slender iron
#

great! nice job

raven canopy
#

๐ŸŽ‰ yw

slender iron
#

@prime flower next time you change the tinylora constructor I'd recommend using kwargs for the pins. kwargs make it easier to add args without breaking the api

drowsy geyser
#

The "approved way" to remove the app is to open the Launcher, press and hold the app icon, and then press the little X when everything starts jiggling. Then you can re-install.

#

But hey, if it's workin'... ๐Ÿ˜ƒ

prime flower
#

@slender iron Good idea - will do for the next library I write/going fwd.

slender iron
#

or the next time you need to break the api ๐Ÿ˜ƒ

raven canopy
#

after an hour+, i'm thinking that trying a 64bit kernel/os on the RPi will be easier than trying to build gcc-arm-embedded from source. ๐Ÿ˜†

exotic pumice
#

are you trying to compile it on the pi?

raven canopy
#

yep

exotic pumice
#

yeah that's gonna be a bad time

#

cross-compile if you can

raven canopy
#

i knew it was going to be a slog. all of the previous "cheats" are void though, since they're like 5 years old.

raven canopy
#

๐Ÿค” this is why we do this right? because of all the fun thought exercises. hehe. ๐Ÿฝ time...

manic glacierBOT
#

Thank you for doing this!

I think we should either add the boards to travis if we want to keep them on the downloads page or delete the board def if they aren't worth it. I'd choose to just add them for now. We'll need to speed up the build regardless of whether we build these four extra boards.

Also, did someone manually stop the last test job? I'd hope that the rest of the build continues if this test fails. It's important to find as many failures in a single build since they take so ...

manic glacierBOT
manic glacierBOT
#

I'm not sure I like the negation of this because it's now unpleasant.

I do not disagree at all.

the listing would be simplified by combining a set of boards into a standard group that could be listed below the table.

I remembered that Dan had mentioned several moons ago that he wanted to get away from a Cartesian type map, as well as move towards a exclusion based system. Its just difficult with rST/Jinja to do non-table-Cartesian (for me, at least).

Grouping shouldn't be diffic...

#

Also, did someone manually stop the last test job? I'd hope that the rest of the build continues if this test fails. It's important to find as many failures in a single build since they take so long.

That's on me. I recommended that this be placed in the before_script section. Ironically, for the same reason that builds take so long. Ostensibly, after this initially merged, the only time a board will be missing from TRAVIS_BOARDS is when one is added. I felt its better to fail fast o...

manic glacierBOT
cerulean pawn
#

I was having some trouble playing wav files converted using ffmpeg, turns out it adds some extra RIFF fields by default, needed to add flag '-flags +bitexact' to the commandline like ffmpeg -i input.wav -flags +bitexact -ac 1 -acodec pcm_s16le -ar 22050 output.wav, maybe it can be documented somewhere on https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out ? without this, it results in ValueError: Data chunk must follow fmt chunk

Adafruit Learning System

The next step in learning CircuitPython.

stuck elbow
#

that's why I always use sox instead

umbral dagger
#

I only use sox where I go outside on cold days during the winter.

stuck elbow
#

just remember to remove the presents

umbral dagger
#

@slender iron I'm looking into the fill_area code... the use/purpose isn't completely clear.

#

@slender iron Also, screenshots. I got the impression you have been giving that some thought?

lone sandalBOT
slender iron
#

@umbral dagger fill_area is what computes pixel values for a portion of the screen

#

aka, screenshots

umbral dagger
#

@slender iron OK, so it'd be used to generate a screenshot

#

got it.

#

It all makes sense now

slender iron
#

right, so if you call that with a buffer it'll fill it in with packed pixels in the display's format

umbral dagger
#

I was thinking of it as going the other way (filling an area with a color) and trying to get it to make sense.

#

Cool.. time to charge forward.

#

It could maybe be named better?

#

"extract_area" ?

#

Off to a dr appt and lunch now. But I'll dive in when I get home.

manic glacierBOT
slender iron
#

@onyx hinge ping me when you are around and let's brainstorm on the nrf pwm pr. I'd like to get the naming settled before merging. I think we'll want to split AudioOut from audioio too so it matches audiobusio. Maybe @simple pulsar has naming/restructuring ideas too.

#

@ionic elk the micropython stm32lib does look good

ionic elk
#

@slender iron I tested it just now and it's got a lot of missing/out of date files

slender iron
#

we can fork and update it

ionic elk
#

Sure - what's the benefit of that?

#

Does it make merging easier?

slender iron
#

it's already together in one place

#

oh, wait

#

st is moving stuff to github

ionic elk
#

isn't that nice

slender iron
#

so I say, use the repo I just made and we'll switch to a fork of STs repo when it's out

ionic elk
#

Want to just wait for that?

#

Ok great

manic glacierBOT
#

@hathach I agree with @hierophect and would prefer to use newer STM32Cube APIs. I doubt we'll ever push our STM code back upstream.

It looks like ST is starting to make repos for the code so we should switch over to a fork of theirs when it's available. More info here: https://github.com/STMicroelectronics/STM32Cube_MCU_Overall_Offer

Also, these changes should go straight to master. It's okay to have partial support on master. Using multiple branches for ongoing work makes it hard for t...

slender iron
#

@ionic elk which nucleo boards were you trying? don't some of them have usb plugs for the native usb?

pastel panther
#

hey @slender iron I'm trying to bring up a new board; got the uf2-samd bootloader flashed apparently successfully (jlink didn't compain) however double tapping reset does not cause a BOOT drive to show up. Instead when I give a double reset I get this in dmesg:

795376.971824 AppleUSB20XHCIPort@03100000: AppleUSBHostPort::disconnect: persistent enumeration failures
slender iron
#

what kind of board is it?

pastel panther
#

It's a custom board, most similar to an itsybitsy m4

slender iron
#

ok, so samd51

pastel panther
#

ya

slender iron
#

does it have any status leds?

pastel panther
#

no ๐Ÿ˜

#

it has wiring for a dotstar but I haven't hooked one up yet as it's on a header

slender iron
#

try using gdb to see where it is in the bootloader

pastel panther
#

will DEBUG=1 build it with symbols?

#

apparently yes

#

@slender iron

Program received signal SIGTRAP, Trace/breakpoint trap.
0x000015b4 in main () at src/main.c:209
209                    led_tick_step = 1;
manic glacierBOT
#

Using an Adafruit Ethernet FeatherWing with a Feather M4 Express, without an ethernet cable attached causes the REPL to become non-responsive. The second time, after resetting the board, it caused a crash and the repl printed that it crashed into the HardFault_Handler.

The feather is currently unable to switch back into CircuitPython, only the bootloader.

Code:

import board
import busio
import wiznet
import socket
import time
spi = busio.SPI(clock=board.SCK, MOSI=board.MOS...
slender iron
#

@pastel panther if it looks like it's working and usb is having issues I'd check the soldering of the usb

pastel panther
#

hm, ok

slender iron
#

you could use a beagle to see what's happening if you have one

pastel panther
#

I do not

#

@slender iron whern you say "it's working" you mean the bootloader? Does the fact that I'm seeing enumeration issues on the computer narrow down anything?

slender iron
#

ya, I mean the bootloader for its working

#

you could set a pin as a bootloader led and use a scope to see what it's doing

pastel panther
#

what would that tell me? That I couldn't theoretically see from stepping through with gdb?

ionic elk
#

@slender iron The Nucleo 144 board layout does have a separate USB port. However, it doesn't allow the board to be powered off of it, requiring external power either through VIN or the STLink USB (to be fair, so does the DIS_F411, which is equally irritating). I also couldn't get any of the baseline CubeMX USB stuff working for it as a control, and it has none of the extra features of the DIS_F412, so I just dropped it for now. Figured we could revisit later

#

The 144 board layout only supports the F412 and up, too. The Discoveries are just way more capable for those boards, for a fairly comparable cost.

slender iron
#

@ionic elk ok cool. I just picked up a couple nucleo's as well. excited for the progress you are making ๐Ÿ˜ƒ

#

@pastel panther similar but you don't need to break with gdb

manic glacierBOT
pastel panther
#

@slender iron is there info somewhere on what the led behavior would be? My wiring seems fine, as far as I can tell. There is continuity from the cable to the pins ๐Ÿคท

slender iron
#

fast fade means its alive but unable to connect to host

onyx hinge
#

@slender iron @simple pulsar I'm home just briefly but I should be back around 8PM US central time for at least an hour or more.

slender iron
#

kk, np @onyx hinge

onyx hinge
#

I feel like with some suggestions and feedback I can get back on track with nrf-pwm-audio. It looks like I need to

  • factor out the sample part of audioio so that it can be shared
    • this might just be arranging to build Mixer.c, RawSample.c and WaveFile.c either when AUDIOIO or AUDIOPWMIO is enabled
    • and then making them appear in the globals of both modules
    • but would it be better to rename it to make the sharing clearer? -- _audiocommon?
  • copy shared-{bindings,hal}/audioio/{__init__,AudioOut}.[ch] to audiopwmio
  • rename a bunch of symbols, header guards, etc
  • rename nrf's audioio to audiopwmio
  • supporting makefile stuff, which (aside from the code sharing) should be straightforward
    I did start this and got bogged down in exactly how the makefiles select source files to include; but I do have substantial experience with GNU make and will be able to understand it once I take the time.

If you think this sounds like what you envisioned, that's great. If not, please point me in the right direction.

slender iron
#

ya, that's the right track. we'll want the common or core audio bit to be public api (no _). I can help with the makefile stuff too

onyx hinge
#

So ultimately, on nrf, you want this line to work:from audiopwmio import RawSample, AudioOut

#

but on samd it's from audioio import RawSample, AudioOut

#

and maybe in some future board, both lines would work, and get you two different sets of independent audio functionality?

#

and in that case audioio.RawSample is audiopwmio.RawSample

#

Is it OK to continue organizing all this work as a single pull request?

#

(right now my hack gets you the first two things, but it does NOT chart a clear path to having both at the same time; in fact, it creates barriers)

simple pulsar
#

@onyx hinge @slender iron My perspective here would only be that of a user of the python apis as I've only looked at bits of the c code and don't have a good grasp of exactly how they all work together.

#

BTW, does the nrf hardware have the DMAC feature (like SAMD have) to be able to write data continuously "in the background" to the chosen D pin?

slender iron
#

@onyx hinge RawSample should live in a module different from AudioOut

onyx hinge
#

@simple pulsar I am happy to hear your perspective. Yes, audio plays in the background, same as on SAMD

#

(nrf calls the feature "easydma" but I'm not sure whether it's actually easy)

simple pulsar
#

Oh, very cool.

cerulean pawn
#

hi @onyx hinge, I tested a bit with your branch, quality wasn't so great with my audio circuitry, but I am getting sound but possibly wrong sampling rate? I'll try getting pure sine wave to compare tomorrow maybe.

onyx hinge
#

@cerulean pawn what is the original sample rate of your audio file? Do you think it's a little wrong, or extremely wrong (such as twice as fast / twice as slow)?

simple pulsar
#

@onyx hinge Are you familar with Soulsby Synths? I believe that is purely PWM output on humble arduino-esque hardware

onyx hinge
#

I did some simple testing where I started playing my wav file at around the same time with vlc and on my feather, and it seemed "close-ish" to me

cerulean pawn
#

22050Hz, a little wrong maybe, but that's just by hearing a not so good speaker

simple pulsar
#

I think he has an analogue filter to give it a thorough clean though

onyx hinge
#

@slender iron OK if you want it in a new module that doesn't exist yet, what should the module with RawSample, WavFile, and Mixer be called?

cerulean pawn
#

might not actually be wrong, that's why I said I'll test with a sine

slender iron
#

@onyx hinge that's the question. audiocore or audiocommon maybe?