#circuitpython-dev

1 messages Β· Page 265 of 1

tacit zenith
#

I just purchased a new Feathre M0 RFM9x LoRa (https://www.adafruit.com/product/3178). I'm trying to get https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to work, but I'm getting an error. I've loaded the adafruit_bus_device and rfm9x libraries. Here's what I get: > rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/troy/lora/Adafruit_CircuitPython_RFM9x/adafruit_rfm9x.py", line 367, in init
RuntimeError: Failed to find rfm9x with expected version -- check wiring

#

it looks like the library is looking for a specific version: if version != 18:
raise RuntimeError('Failed to find rfm9x with expected version -- check wiring')

solar whale
tacit zenith
#

that worked. Thank you!

exotic pumice
#

random hardware question, when I touch A0 on a cpx with my rust-hal, I get a bit of noise from the speaker. Does cpy have a way to prevent this?

meager fog
#

@exotic pumice disbale the speaker amp

#

@tidal kiln for real almost done with the guide

#

replicating the instructions on a clean windows box turned out to be a real journey

#

turns out neither hyperv nor virtualbox can cope with the ft232h

raven canopy
#

not surprising. vbox passthrough is a pain...

meager fog
#

yeah other devices it has worked for me

#

but because you force it to libusbK it is 😦 😦 😦

#

and then turns out that disabling hyperv can really wreck yor win10 install

#

i feel like i learned a lot lol

raven canopy
#

if i haven't broken it, i don't understand it. πŸ˜„

onyx hinge
meager fog
#

@tidal kiln woo guide is live after fighting some kexts, windows 10 and many old software pkgs

#

@tidal kiln pt will blog it for ya

tidal kiln
#

@meager fog woot! thanks!

meager fog
#

@tidal kiln whats next for ya

meager fog
#

we have a couple more old-style Python libraries that we have CircuitPython for

meager fog
#

@tidal kiln whee

#

archived and all issues/pr's closed!

manic glacierBOT
slender iron
#

Hi all, tomorrow's community meeting is just under 12 hours away. I'm excited to chat with everyone. All are welcome to participate. The meeting happens here in the CircuitPython voice channel at 11am Pacific / 2pm Eastern. Meeting notes doc is here: https://docs.google.com/document/d/14NbReysUfBp2V8u8U1XDLdUZT6xx1lNCgwx6Uctz8SE/edit?usp=sharing <@&356864093652516868>

manic glacierBOT
onyx hinge
sacred blade
#

It seems that circuitpython (5..0.0 beta 4) is not quite ready for PDMin on the Monster M4ask : I get "Invalid clock pin", and looking at the code it's clear that this pin combination is not handled. Should I submit a bug report, or is it something you're working on already ?

onyx hinge
#

@sacred blade if it hasn't already been reported it will be helpful to file an issue on GitHub so we can track it. I don't know the specifics (I don't have an m4sk), but if Arduino can do that then circuit python should be able to too.

#

Thanks!

manic glacierBOT
#

hiya tried burning that to my f405 feather but it didnt enum, by chance did you compile the wrong firmware.bin?

Whoops sorry that's for the F412! I totally forgot in the moment we had the 405 up and running, ha! If you still have your 412 kicking around you could try that but I'll get the 405 build up and running today, just haven't added the periph definitions for it quite yet.

ionic elk
#

@meager fog I'd forgotten - the reason I don't have a F405 build up and tested yet is because I didn't have a usb C cable to connect to it with. I'll send a new binary as soon as it comes in today.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@tannewt I'm a little confused by your non-comment question about SPI checking. There isn't anything preventing pins that are not actively claimed from being used? The only things that are checked are
a) core checking to make sure a pin isn't claimed, which doesn't take place here
b) making sure the pins selected are a valid combination for an SPI
c) making sure the SPI module itself selected via that pin combination is free for use. This doesn't check the pins.

There's no restriction ...

orchid basinBOT
manic glacierBOT
#

@hierophect The case I'm talking about is when a set of pins has more than one SPI that can use it. As written now, it'll only ever check the first SPI to see if it's free. This will prevent it from using a secondary SPI on the same set of pins. This only happens when multiple SPIs are in use which is common when one is used from external flash.

meager fog
#

@ionic elk haha ok

#

USB C is the fuuuuuuuuuuuuuuuuture

#

except for everone else who has to scramble to get adapters

meager fog
#

@tidal kiln and then mirror that into the '232h guide

tidal kiln
#

@idle owl @slender iron cant make meeting today. added hugs to notes.

idle owl
#

@tidal kiln cheers, thanks

tidal kiln
#

@meager fog okie doke. will do.

meager fog
#

@tidal kiln its a great guide, you did amazing on it. im now using it a lot on my compy to quickly test CPython stuff with libraries instead of wranging my Pi

tidal kiln
#

neat. thanks!

manic glacierBOT
meager fog
#

@slender iron @ionic elk i'll wait on testing SPI on the F405 till ya have a build for me, no rush πŸ™‚

slender iron
#

@meager fog did the last CI build make a 405 bin?

meager fog
#

ooh i dunno

#

i think we aren't making S3 builds yet

#

i have to remind @ionic elk to PR that into the build script

slender iron
#

(top right)

#

we should do that right away

meager fog
#

@ionic elk are ya workin' today?

slender iron
#

looks like our board check isn't checking stm32f4s

meager fog
#

might have to wait till he's back πŸ™‚

#

its about lunchtime on eastcoast

slender iron
#

ya, np

#

I'm looking into why it isn't failing the CI

#

it's supposed to fail if a board dir is added but not to the CI

#

just not failing

manic glacierBOT
#

@hierophect The case I'm talking about is when a set of pins has more than one SPI that can use it. As written now, it'll only ever check the first SPI to see if it's free. This will prevent it from using a secondary SPI on the same set of pins. This only happens when multiple SPIs are in use which is common when one is used from external flash.

Ah, I see what you mean. I guess this would only ever come up for 1 and 3 or 4 and 5? So, the specific scenario would be using SPI 4 on a differ...

#

Well, the usage difference is that I'd completely forgotten that I employ the usual trick of re-creating the object each time when some update functionality isn't working (duh).

But, played with changing x and y in the loop and some perhaps helpful behaviors become apparent. With the last part of the code changed to:

# Group 1
splash.append(displayio.Group(max_size=1, scale=1, x=0, y=0))  #dummy
font = terminalio.FONT
text_area = Label(font, text="01234567890123456789", color=0xFF...
ionic elk
#

hi @meager fog I'm here!

#

I fixed most of scotts PR stuff this morning and JUST got the USB C

#

Currently digging out of a pile of JST headers dumped on my desk but I'll get you a build momentarily

slender iron
#

@ionic elk can you add the 405 boards to the github CI file too?

ionic elk
#

will do

manic glacierBOT
slender iron
#

thanks

meager fog
#

@ionic elk yah if you do the github CI thing as a separate mini PR we can have auto-built bin's which makes testing super ezzzz

pearl notch
#

Hi all. Could someone please point me to the source of audioio and audiocore? I’ve searched various Adafruit github repositories without success.

#

I’m exploring making the perceived loudness even across all audible frequencies on the CPX.

slender iron
#

@pearl notch the source is in the circuitpython repo

#

ports/atmel-samd/common-hal/<module>

#

python -> C is in shared-bindings/<module>

pearl notch
#

Ah, goodie. Thanks, Scott!

slender iron
#

np

crimson ferry
#

@slender iron Just reading meeting notes... sorry had to re-open that issue #2137 😦

slender iron
#

haha, no problem πŸ™‚

crimson ferry
#

@solar whale, can you load a new UF2 via USB-C iPad? I wasn't able to on lightning iPhone with camera adapter (at least as of a couple of weeks ago).

ionic elk
#

@meager fog oh nuts I can't program it either because I don't have the special SWD header 😦 gotta get my bootloader setup up and going.

#

BAH

#

I'll throw a binary up on github anyway, it SHOULD work

pearl notch
#

Do we have the top of the hour meeting doc link yet? I looked up above for a ways.

ionic elk
#

I usually search for @ circuitpythonistas

#

@pearl notch

#

since that's usually in the post message

manic glacierBOT
ionic elk
#

@slender iron ok I give up where's the CI setting again

#

...nevermind I found it LITERALLY SECONDS after I hit enter

slender iron
#

πŸ™‚

idle owl
#

<@&356864093652516868> Todays weekly meeting starts in ~13 minutes. Hope to see you there! Here is the notes document - please feel free to add your notes even if you'll be present in the meeting, it's super helpful! https://docs.google.com/document/d/14NbReysUfBp2V8u8U1XDLdUZT6xx1lNCgwx6Uctz8SE/edit?usp=sharing

pearl notch
#

Am I correct that the only volume control with CircuitPython and the CPX is the magnitude of the sample itself?

idle owl
#

@pearl notch I believe so, yes.

slender iron
#

I think mixer can do it now in 5.x

idle owl
#

Ah nice!

pearl notch
#

Time for me to move to 5. πŸ™‚

idle owl
#

Let us know if you find any issues please!

solar whale
#

@crimson ferry the Bootloader File system does not show up on my iPad

crimson ferry
#

Thanks, I had similar issue (some dialogs popped up and it was grayed out), a couple of public betas ago.

nimble narwhal
#

good afternoon ! just lurking...

prime flower
#

good afternoon @nimble narwhal

nimble narwhal
#

thanks ! you too...

idle owl
#

We're finishing up another meeting, we'll be here soon!

#

I will brb.

sterile bronze
#

lurking and hello all

crimson ferry
#

lurking

old smelt
#

lurking

raven canopy
#

Having headphone issues... Text only if I make it.

meager fog
#

text mode for me

#

hugz to carter for the epic ft232h work - much appreciated and unlocks some neat use cases

turbid radish
#

lurking

river quest
#

CircuitPython on any Computer with FT232H, Powerful computers can now use the power of CircuitPython libraries
https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h/overiew
https://youtu.be/CZ6TtvYJTeI

Adafruit Learning System

Powerful computers can now use the power of CircuitPython libraries.

The new STM32F405 Feather that we designed runs CircuitPython at a blistering 168MHz - our fastest CircuitPython board ever! We put a STEMMA QT / Qwiic port ...

β–Ά Play video
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Farnell Sales of Raspberry Pi Computer Reach 15 Million Worldwide – β€œFarnell sales help make Raspberry Pi the UK’s most successful computer, and the third-most popular general-pur…

#
#

Made with Mu - Improving Programming Education and the Alchemist's Tower
https://testandcode.com/89
https://youtu.be/GNOya_OZxjg

A "play through" of my PyWeek 28 entry. Apologies for the sound quality. My aim was simple: to create an experience reminiscent of the mysterious exploration...

β–Ά Play video
idle owl
#

It definitely is

prime flower
idle owl
#

5

idle owl
#

It's down to 4 this year.

pastel panther
#

they don't even have to be merged

ionic elk
#

Jesus what is it with 2019 and the Outrun theme

raven canopy
#

Haha. I was thinking the same last night. adabot

ionic elk
#

are we back in the 80s

gilded cradle
#

Nice! I want to look into the hacktoberfest more.

idle owl
#

Old issues. Not PRs.

#

Anecdata is in the notes

turbid radish
#

You're welcome!

#

lurking

#

Great work Brent!

prime flower
#

thanks, mike!

turbid radish
#

anytime πŸ™‚

errant grail
pearl notch
#

β€œSee myself out”—ha ha ha!

idle owl
#

No it's not just you.

old smelt
#

Have to drop off early today. Have a great week, all!

ionic elk
#

Ok I gotta head out for a class too, see you later everyone

raven canopy
#

πŸ‡Ά πŸ•΅ (phone keyboard...)

idle owl
#

Silence?

slender iron
#

ya, me too

solar whale
#

πŸ‘

pearl notch
#

Congrats on your move!

#

VMware what? Fusion?

idle owl
#

@pearl notch Thanks!

pearl notch
#

My mom took a Photoshop class and the teacher kept calling it β€œAdobe”.

#

(I contracted at VMware for over 6 years.)

idle owl
#

@pearl notch Ah! I got my copy from someone who works there now.

pearl notch
#

@gilded cradle I’ve been learning to use PIL myself. I made graph β€œpaper” with it, to use with my graphics tablet.

gilded cradle
#

Awesome! It can do some really cool things.

raven canopy
#

Nailed it!

pearl notch
#

Yes, I would like to be one of those β€œistas”, please.

idle owl
#

@pearl notch Done!

raven canopy
#

Thanks everyone!!

errant grail
#

Thanks!

gilded cradle
#

Thanks everyone

pearl notch
#

Test

errant grail
raven canopy
#

Gotta run. πŸ‘‹

slender iron
manic glacierBOT
solar whale
#

Have to go too, have a good week!

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-1
errant grail
idle owl
#

So how does freezing modules work? There's no way to make it only freeze one part of a lib?

pearl notch
#

@slender iron @idle owl @errant grail I misread the code before. There is not a new sine waveform generated prior to the playing of each note.

#

So without going deeper than I want to right now, I won’t be able to speed this up.

idle owl
#

It didn't seem quite right what you were saying, but it's been so long for me that I figured I was missing something. πŸ˜„

pearl notch
#

if not self._sample:
self._generate_sample(length)

#

Plus I sounded so confident. πŸ˜‰

idle owl
#

It's a good look!

pearl notch
#

Heh heh

#

I removed turning off the speaker and that didn’t stop the clicking. So I’ll abandon that, too for now.

#

Equalizing the volume would require generating several sine waveforms at different amplitudes. I’ll still consider that.

slender iron
#

@idle owl the current frozen config is done at the library level

idle owl
#

@slender iron Library level? like the configuration is in each library?

slender iron
#

no, the board def lists the library names to include

idle owl
#

hmm ok.

slender iron
idle owl
#

@slender iron Ahh.... hmm ok.

errant grail
#

@pearl notch Are you measuring output level with Audacity with a direct connection to the audio output or with a microphone?

slender iron
#

only freezing part would be confusing too

idle owl
#

Confusing how?

pearl notch
#

@errant grail with my fancy r, o with a slash through it, d, e mic

slender iron
#

only parts of it would be available by default

idle owl
#

Right, but you said we don't use spi_device and the CPX lib is only frozen into one board, so freezing only the .express module wouldn't limit functionality.

errant grail
#

@pearl notch Ah. That should produce a fairly flat response. I suspect speaker resonance is the primary issue, then. Sounds like you're on a path to measure the resonance curve so that it can be adjusted in code?

pearl notch
#

@errant grail Are you saying the measured amplitude differences is caused entirely by resonance?

#

In any case, yes, my aim would be to produce a measured result with equal amplitudes

errant grail
#

Yes, assuming that the signal voltage provided to the amp is constant.

#

I doubt that the tone routines play with amplitude based on frequency. Haven't confirmed that, though.

#

Do you have an o'scope to look at the amp input signal?

pearl notch
#

I have a little digital one. That sounds like fun. I would have no idea where to connect it on the CPX.

errant grail
#

Let me take a look at the CPX...

slender iron
#

even though we don't use it, it's confusing if the user tries to use it and only the other part of the lib is frozen in

errant grail
#

@pearl notch I suspect that you could connect the scope to A0 and GND, but I'll confirm.

idle owl
#

I guess I'm confused as to how someone could use a frozen lib on a different board without loading the UF2 onto the wrong board.

slender iron
#

you don't need to swap the uf2

errant grail
#

@pearl notch Yes, A0 and GND. You'll see a DC bias on the signal of about +1.6v on A0 between notes. The sine waveform will start at +1.6v and rise up and down from there. You won't be able to see the effect of the speaker on/off signal on A0, though.

slender iron
#

if we remove spi_device from the cpx build and the user tries to use it, then it'll be a weird error

idle owl
#

Ok, so specifically with the CPX lib. If we froze in only the express module, how would that limit users?

slender iron
#

it wouldn't unless they try to use something weird accidentally

idle owl
#

It would fail now if they tried to use something weird.

slender iron
#

true

#

it'd be nice if it threw a friendly exception instead of an import error

pearl notch
#

@errant grail I’ll try it! Wow, that was fun!

idle owl
#

That's easy enough.

pearl notch
#

The amplitude is constant.

idle owl
#

@prime flower Ping me when you're around, I have a question.

prime flower
#

@idle owl I'm around

idle owl
#

The simpletest.py in this folder, would it make sense for it to live in the /examples/ folder? Or is it specific to mqtt and that's why it's in the mqtt folder.

errant grail
#

@pearl notch Good to know. Still, it would be worthwhile to make it more constant from the speaker.

prime flower
#

@idle owl that simpletest is specific to testing the MQTT class.

idle owl
#

@prime flower Is that the main functionality of the lib?

#

Or it is equally both

prime flower
#

I could rename files within the examples folder to adafruit_io_mqtt_xyz and the other to adafruit_io_http_xyz

idle owl
#

Sorting through the lib infrastructure issues, and it not having a libname_simpletest.py is triggering the check. However, if it makes sense in those folders, then I will have the checks updated instead.

prime flower
#

It's both, you can use the lib with the mqtt or the http client, they're meant to be separate interfaces.

idle owl
#

Ok.

#

I'll look into having the check updated to search folders.

prime flower
#

@idle owl I can't think of another library which follows that directory structure, I can change it if folder searching wont work.

idle owl
#

@prime flower I'll let you know, thanks.

pearl notch
#

@errant grail Thanks for suggesting the oscilloscope. Other than playing with it, this was my first real use of it! I’m gonna make a little video.

prime flower
#

np - i'd ideally like to keep it for future mqtt/http libraries (i think sep. folders makes it clear that there are two sep. clients) but could change it

idle owl
#

I think it's nearly trivial to make it search folders. Simply needs to be added.

#

I created an issue for it and will find out.

prime flower
#

@crimson ferry heya - re: your issue on ESP32SPI, I just put together a decent test setup to debug both nina-fw (on the ESP32) and circuitpython code simultaneously. it does get hairy and have glitches, working on some ideas to simplify it (especially the workflow).

manic glacierBOT
#

initial tests sucessful! tried writing multiple bytes as well as an echo test, there's some debug printf's you can get rid of please :)

import busio
import board
import time

spi = busio.SPI(board.PA05, board.PA07, board.PA06)
while not spi.try_lock():
    pass
spi.configure(baudrate=10_000_000)

buf = bytearray(1)
i = 0
while True:
    buf[0] = i
    spi.write_readinto(buf, buf)
    print(buf[0])
    i = (i+1) % 256
    time.sleep(0.1)
pearl notch
#

@errant grail Given a wav file with a recording of a chromatic scale, how can I condense that to just the maximum amplitude of each note in the scale? I’m playing with scipy wavfile now. I’d like a split and max.

manic glacierBOT
meager fog
#

@ionic elk i can test the other SPI busses on the 412 if you know what they are

#

@ionic elk @slender iron if y'all have a moment to discuss post-SPI work lemm eknow

slender iron
#

I'm around

ionic elk
#

I'm here

#

SPI pins BTW

#

const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = {
    SPI(1, 5, &pin_PA05),
    SPI(1, 5, &pin_PB03),
    SPI(2, 5, &pin_PB10),
    SPI(2, 5, &pin_PB13),
    SPI(2, 5, &pin_PC07),
    SPI(2, 5, &pin_PD03),
    SPI(3, 6, &pin_PB03),
    SPI(3, 7, &pin_PB12),
    SPI(3, 6, &pin_PC10),
    SPI(4, 6, &pin_PB13),
    SPI(4, 5, &pin_PE02),
    SPI(4, 5, &pin_PE12),
    SPI(5, 6, &pin_PB00),
    SPI(5, 6, &pin_PE02),
    SPI(5, 6, &pin_PE12)
};

const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = {
    SPI(1, 5, &pin_PA07),
    SPI(1, 5, &pin_PB05),
    SPI(2, 5, &pin_PB15),
    SPI(2, 5, &pin_PC03),
    SPI(3, 6, &pin_PB05),
    SPI(3, 6, &pin_PC12),
    SPI(3, 5, &pin_PD06),
    SPI(4, 5, &pin_PA01),
    SPI(4, 5, &pin_PE06),
    SPI(4, 5, &pin_PE14),
    SPI(5, 6, &pin_PA10),
    SPI(5, 6, &pin_PB08),
    SPI(5, 6, &pin_PE06),
    SPI(5, 6, &pin_PE14)
};

const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = {
    SPI(1, 5, &pin_PA06),
    SPI(1, 5, &pin_PB04),
    SPI(2, 5, &pin_PB14),
    SPI(2, 5, &pin_PC02),
    SPI(3, 6, &pin_PB04),
    SPI(3, 6, &pin_PC11),
    SPI(4, 6, &pin_PA11),
    SPI(4, 5, &pin_PE05),
    SPI(4, 5, &pin_PE13),
    SPI(5, 6, &pin_PA12),
    SPI(5, 6, &pin_PE05),
    SPI(5, 6, &pin_PE13)
};

const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = {
    SPI(1, 5, &pin_PA04),
    SPI(1, 5, &pin_PA15),
    SPI(2, 5, &pin_PB09),
    SPI(2, 5, &pin_PB12),
    SPI(3, 6, &pin_PA04),
    SPI(3, 6, &pin_PA15),
    SPI(4, 6, &pin_PB12),
    SPI(4, 5, &pin_PE04),
    SPI(4, 5, &pin_PE11),
    SPI(5, 6, &pin_PB01),
    SPI(5, 6, &pin_PE04),
    SPI(5, 6, &pin_PE11)
};
meager fog
#

ok so i did cursory testing of SPI so i think you're going to be able to merge it in a bit

#

so next up you could EITHER

#

fix up internal Flash storage so it is actually 48KB instead of 24 KB

#

OR

#

get SPI flash chip going

ionic elk
#

I have a lot of other cleanup stuff to do too

errant grail
ionic elk
#

But SPI flash is the most exciting

slender iron
#

spi flash is my vote

meager fog
#

SPI Flash it is! by unanimous decison πŸ™‚

ionic elk
#

woo

slender iron
#

good to learn how to debug and add new definitions

ionic elk
#

Ok, I've got all the chips in for that as well

meager fog
#

it will let us test drivers/feathers and such

slender iron
#

πŸ‘

meager fog
#

ok after SPI Flash, then we can do cleanup, more board defs

#

since we have the majority of built ins

slender iron
#

how are we on analog?

ionic elk
#

Sounds good, I've got the cutsy boards you asked for

meager fog
#

analog in works

ionic elk
#

Analog's done

slender iron
#

UART?

ionic elk
#

DAC isn't

meager fog
#

dac does not

ionic elk
#

no UART

meager fog
#

uart is not done either

ionic elk
#

we ninjaing each other

meager fog
#

that's a lower priority for me - uart is usually a fairly easy peripheral

slender iron
#

it'd be good to finish modules like analogio and busio

meager fog
#

oki i think uart before dac

slender iron
#

makes it easier to track and explain

meager fog
#

dac's hard

pearl notch
#

@errant grail going to private chat

ionic elk
#

DAC for STM32 HAL is pretty streightforward from what I can see but I agree, UART makes more sense first

meager fog
#

sooo... SPI Flash, then UART, then DAC?

ionic elk
#

what about cleanup?

slender iron
#

πŸ‘

meager fog
#

tan, where ya want cleanup?

ionic elk
#

Need to add package management, flash restructure, etc

slender iron
#

I think cleanup needs to be more specific

#

are there issues for the individual ideas already?

#

I think getting internal flash happier would be good

ionic elk
#

Package management (lots of STM packages), flash total size fixes and cache buffering implementation, macro cleanup and restructuring

#

moving various helper functions to board leve

slender iron
#

oh you mean physical ic packaging

ionic elk
#

yeah

meager fog
#

lol

ionic elk
#

It's not in a good spot right now, it'll be hard to expand to BGA

#

there's often 7+ package options for STM

#

and that's not even counting power pin mods

slender iron
#

I think the packaging stuff will be driven by the boards we want to support

ionic elk
#

also improving the workaround in I2C, which has an issue

#

Yeah this would just be prepping for that, really

slender iron
#

I bet there are a number of boards we can add with what we have

ionic elk
#

Adding the 405 was weirdly painful, I'd like to make it better for new ones

slender iron
#

ya, the internal flash is really weird

ionic elk
#

Anyway, happy to make issues for everything. But in terms of order, SPI Flash, UART, DAC, then new boards?

slender iron
#

it'd be good to add as many boards as we can before worrying about bga

#

new boards may be better after spi flash

ionic elk
#

Still want me to do that bootloader tutorial too? Would love to do some writing, and it'd make it easier to support people on the F405

slender iron
#

I think that could come after spi flash with more boards

ionic elk
#

Any board that uses the F405 will be pretty easy, so cleanup could be avoided if we just stick to boards using that.

slender iron
#

ah, meowbit is a 401

meager fog
#

the discovery boards seem to thave SPI flash on it too

slender iron
#

ya, I'd definitely start there

ionic elk
#

Yes, F412 has QSPI chip.

slender iron
#

makes internal flash less urgent

meager fog
#

not qspi?

ionic elk
#

Can you force regular SPI on a QSPI?

slender iron
#

ya

meager fog
#

yes all qspi chips are SPI

slender iron
#

just slower reads

meager fog
#

so you can always pull HOLD/WP high and now its a SPI chip πŸ™‚

#

also, dont send it the command to start QSPI mode πŸ˜„

ionic elk
#

F412 Discovery flash chip SUPER old though, obsolete, can't be bought. Is it still pretty simple to add just the settings and roll with it?

meager fog
#

the F412 is no longer made?

ionic elk
#

No, just the QSPI chip on it isn't shipped by digikey or anything

meager fog
#

ooh

#

they all have near identical commands

ionic elk
#

edited message that was unclear

slender iron
#

ya, it should still be simple to add the chip definition

meager fog
#

it isnt very hard to add support for it - just make the JEDEC id match up

#

we have some other winbond 25Q chips supported

ionic elk
#

Gotcha. Ok, so what's the final verdict on priority? Issues for all cleanup, SPI flash on F412/feather, add support for other F405 devboards and maybe 401, UART, DAC, remaining cleanup?

meager fog
#

yah make issues for everything

#

SPI Flash support on F405feather, then discovery boards

#

then UART

#

DAC

#

and then we'll look at other F405 devboards and 401

slender iron
#

feather is likely easier since the flash def should be in cp already

meager fog
#

edited

#

tan, where's the SPI chip defs live n ow?

ionic elk
#

I wanna say tools/device.h?

slender iron
ionic elk
#

supervisor/shared/external_flash/devices.h

#

my b

meager fog
#

oh ya

simple pulsar
#

Has there been a scan of PR's recently? I noticed https://github.com/adafruit/Adafruit_CircuitPython_DotStar/pull/35/commits lingers and two of mine haven't been applied: https://github.com/adafruit/Adafruit_CircuitPython_MIDI/pull/13 and https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/pull/39 (I did that minor tweak for that one)

manic glacierBOT
ionic elk
#

also wanted to bring up one wacky idea again: would we ever want to consider adding a USB breakout for the Nucleos? A lot of people have those, but we can't really use them right now because there isn't any direct USB access.

meager fog
#

@ionic elk they'll be very close

#

@ionic elk we have osme breakouts for usb c/microb

#

if they wanna try wiring up fast

#

is it plain USB FS?

ionic elk
#

No, they don't have direct USB to the chip at all, in most cases

meager fog
#

then how do you add USB?

ionic elk
#

The usb pins are exposed

#

so you'd need the breakout as you said

meager fog
#

ok yah id just tell em to wire the breakout

ionic elk
#

Yeah we could consider adding support to the nucleos then, even if they're a bit less accessible. They're super common, I've seen way more of them than the discoveries

meager fog
#

@simple pulsar we have lots of libraries and PRs, often a tester/reviewer is needed - see if you can find someone to trade a PR with, they can test yours and you test theirs πŸ™‚

#

@ionic elk ok yep can add them after we get peripherals squared away

slender iron
#

@simple pulsar I'm looking now. feel free to post a message on the PRs themselves. That'll cause them to hit my inbox which I sweep most days.

ionic elk
#

@meager fog coolbeans. I'll get the cleanup issues logged and then get right on SPI

meager fog
#

okidoke!

#

πŸ‘

ionic elk
#

one last thing - would you like me to put my huge dev journal in the port dir as a readme type document?

meager fog
#

you should be set for this week taskwise

#

@ionic elk i defer to @slender iron on dev journal dox

slender iron
#

can you post it as a gist somewhere so I can look at it?

ionic elk
#

sure, let me sanitize it a bit and send to you to see if you think it'd have any value

#

is gist a literal thing I don't know about or just a turn of phrase, btw?

#

like is there a gist.io I should use

#

also @slender iron if you could just check out that one note I made on SPI, I think we should be done. Just a style question, whether we should keep the line as is or add a couple extra to make it more variable centric.

slender iron
ionic elk
#

aha it was real

slender iron
#

@ionic elk did you see my "You don't need to unset it, only check it if the pins are NULL. (Before the "Invalid SPI pin selection" error.)" response?

ionic elk
#

guess it didn't load, let's see

tidal kiln
#

@slender iron responded to forum thread

slender iron
#

thanks @tidal kiln

ionic elk
#

Oh I see I'd check the flag within the NULL pin section.

#

Yeah I can do that.

slender iron
#

ya, exactly. because at that point you know the SPI is free

#

which is why you don't need the second copy of the test

ionic elk
#

sure. It's still 2 lines vs one, but it does seem more readable

slender iron
#

πŸ‘ lines are cheap

ionic elk
#

wait, is there an edge case here where we could misidentify the error?

slender iron
#

depends on what the code is

crimson ferry
#

@prime flower Sounds cool, I wouldn't mind taking a look when you're ready.

ionic elk
#

sorry I just had to think about it for a sec. If it's on, it means there was a valid pin combination you tried and it failed because it was busy, so it's never viable to say it was a bad pin configuration. I just got worried about it continuing to go through possible failure conditions with the flag still active.

manic glacierBOT
ionic elk
#

@slender iron other quick style question to save time, would you prefer:

if (spi_taken) mp_raise_RuntimeError(translate("Hardware busy, try alternative pins"));
        mp_raise_RuntimeError(translate("Invalid SPI pin selection"));

or have the full else and brackets? Since both errors halt execution, there's no point to the else, right?

slender iron
#

full else with brackets please

ionic elk
#

ok glad I asked.

slender iron
#

it's easier to read

#

mp_raise requires micropython specific knowledge that someone browsing the code may not know

ionic elk
#

pushed

slender iron
#

k looking

idle owl
#

@pastel panther ping me when you're around, Found a thing with RTD that needs to be done when you're setting it up.

manic glacierBOT
slender iron
#

@ionic elk go ahead and merge once the CI is happy

ionic elk
#

im not allowed 😦

slender iron
#

@ionic elk now you can

ionic elk
#

im mearly a circuitpeasant, content in my lovely filth

#

I have been knighted! Thank you good sir

pastel panther
#

@idle owl I am around

idle owl
#
#

The LPS35HW one isn't working right, but I can't look into it until you add Adabot. So I can try to figure it out if you add it.

manic glacierBOT
#

The only real outliers at this point in time are audiocore and audiomixer (https://github.com/adafruit/circuitpython/blob/master/py/circuitpy_mpconfig.mk#L88).

  • audiocore: default_value = "CIRCUITPY_AUDIOPWMIO, CIRCUITPY_AUDIOIO".
  • audiomixer: default_value = "CIRCUITPY_AUDIOIO".

I imagine audiosynth will follow the same suit.

#2021 lists a couple other outliers that have not been addressed yet, at the py/circuitpy_mpconfig.mk level.

pastel panther
idle owl
#

Correct. I would need to add an internal page with that on it.

pastel panther
#

fixed the lps (wrong alias), adding adabot now

idle owl
#

@slender iron I went through all 140 issues on all the libs, and only one is a good first issue. I also went through the lib infrastructure issues and created issues for everything that would be a good first issue and labelled it. We're going to add Hacktoberfest to all of them. Should at least provide something for newcomers to do. Came out to 19 issues I think. There are not a lot of good first issues at the moment.

#

@pastel panther Thanks!

pastel panther
#

sure, np

slender iron
#

@idle owl awesome! Thanks! I'll brainstorm more

idle owl
#

Sounds good.

meager fog
#

@tidal kiln hihi

raven canopy
#

@idle owl @slender iron there appears to be 101 issues across the landscape (core + libs) labeled as good first issue. do we want all of them marked as Hacktoberfest, or just the libs?

raven canopy
#

_ * 101 number gathered from a search on github (org:adafruit label:"good first issue" org:adafruit label:"good first issue" repo:Adafruit_CircuitPython)_

tidal kiln
#

@meager fog heyhey

idle owl
#

@raven canopy I would say yes. If we labeled it, then it's probably good for it.

raven canopy
#

kk. should have majority of it done tonight..

idle owl
#

Thanks!

#

@raven canopy some are already labeled hacktoberfest btw.

raven canopy
#

yep. already saw that, and planning on ignoring them.

idle owl
#

@tidal kiln I went through the FT232H guide. Two things: 1. It works in VMWare Fusion on Windows 10 running on Mac OS. 2. The first "Setup" page is a little confusing - you link the official pyftdi installation instructions, which I went through first, and you don't mention that the Windows instructions aren't the same. It still worked in the end, but I had to undo some things first.

tidal kiln
#

@idle owl thanks. ill take a look.

meager fog
#

@tidal kiln ok i replie to your basecamp

#

i think there's some fun ft232h projects you could do, if you have any desire to

raven canopy
#

@idle owl @slender iron looks promising so far. will spend the rest of the night in "no push mode" to get a better feel for when it can go live.

{
  "url": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Motor/issues/31",
  "number": 31,
  "title": "Example should be renamed to include simpletest",
  "labels": [
    {
      "id": 783374807,
      "node_id": "MDU6TGFiZWw3ODMzNzQ4MDc=",
      "url": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_Motor/labels/good%20first%20issue",
      "name": "good first issue",
      "color": "7057ff",
      "default": true
    }
  ],
  "state": "open",
  "locked": false,
  "author_association": "MEMBER",
  "body": "Example `motor_servo_sweep.py` should be renamed to `motor_servo_sweep_simpletest.py` to fit with CircuitPython library standards."
}

-> github.post("/repos/adafruit/Adafruit_CircuitPython_Motor/labels", {'name': 'Hacktoberfest', 'color': 'f2b36f', 'description': 'https://hacktoberfest.digitalocean.com'})

-> github.patch("/repos/adafruit/Adafruit_CircuitPython_Motor/issues/31", {'labels': ['good first issue', 'Hacktoberfest']})
idle owl
#

@raven canopy Brilliant!

raven canopy
#

who knew ~75 lines of code could save so much time? πŸ˜‰

idle owl
#

Oi...

tough flax
#

Hi folks - I'm starting a WebUSB project using TinyUSB. Is there a CP interface yet?

meager fog
#

do you mean circuitpython?

#

then no

slender iron
#

@tough flax interface to do what?

tough flax
#

Yes, Circuit Python. I'd like to send data to a Javascript App via WebUSB... I can do it in Arduino

#

But prefer Circuit Python

#

As for "what for", I am making a device that will allow Occupational Therapists (and other ATPs) to test a variety of switches and other measurement tools to get "intent" out of an individual

#

My first pass will be a CPX sending data to a web page running Javscript.

#

Easier to code a web interface that takes raw data & presents it on the user's laptop

tawny creek
#

Is there an STA library for CP with Airlift?

#

yes

#

❀

slender iron
#

@tough flax we don't have a separate serial link over usb but you can probably reuse the existing one. I don't know of any webusb example code though

tough flax
#

It's OK - I will start with Arduino and chat with @tulip sleet after Rosh Hashana and perhaps @gentle bronze as well - no rush on this

manic glacierBOT
lone sandalBOT
granite crow
#

Hi, last year some github issues were marked with a hacktober label, will this year be the same?

digital topaz
#

What is the difference between circuitpython and the normal python?

main meteor
#

Normal Python is a fairly heavy-duty language that requires more resources to run than are normally available on microcontrollers, so MicroPython was created as a smaller subset that could run on a microcontroller. CircuitPython is a derivative of MicroPython with some expanded capabilities.

raven canopy
#

@granite crow yes. There are some actually still marked from last year, and we're working on the rest currently.

manic glacierBOT
#

I think it’s version 4. It’s whatever came by default on the Adafruit Metro
M4 Airlift.

Zach

Le jeu. 26 sept. 2019 Γ  11:31, Scott Shawcroft notifications@github.com a
Γ©crit :

@3ach https://github.com/3ach What version are you using? I'm actually
very surprised three worked. I think I've knocked it down to 1 in 5.x. All
display objects and their busses are statically allocated so they can live
outside the vm. The limit is controlled by CIRCUITPY_DISPLAY_LIMIT
<https://github.c...

idle owl
#

@granite crow They don't need to be labeled to count for Hacktoberfest. We label the easy ones for new people to find.

tidal kiln
#

@meager fog ft232h project ideas? sure. ping me or can just add in basecamp if you want.

prime flower
#

@crimson ferry yep! I started on some "workflow" stuff this morning on a branch of nina-fw (https://github.com/brentru/nina-fw/tree/certificate-work). I've added a modified makefile to allow commands for uploading the serial passthru uf2, loading the binary via esptool and popping open miniterm for uart.

#

inspired by the esp-if make firmware flash monitor workflow, but with more steps

crimson ferry
#

Cool! I saw your guide too, that will be handy for a lot of people. @sly falcon and I were talking a few days ago about where best to store and archive all of the NINA binaries... circuitpython.org? Github? Someone may want to try the latest or stick with 1.2.2 tried and true, or... without jumping between various documents to find the downloads.

prime flower
#

@crimson ferry I'll ask @meager fog and get back to you, we might want a S3 bucket for all the binaries

tidal kiln
ionic elk
idle owl
#

@tidal kiln Looks good, thanks for the update

#

Maybe make the last sentence bold

#

Regardless, it's much clearer

tidal kiln
#

@idle owl cool. thanks. for the VMWare stuff - maybe ping limor? i only did the linux section.

meager fog
#

@ionic elk ??

#

i have to move it over?

ionic elk
#

just a smidge

#

if it's not too late

meager fog
#

ok - ya can maybe sand the connector down a bit

#

yeah thats not the final

idle owl
#

@tidal kiln I think she wanted a note added somewhere that it runs in VMWare. Not an entire section. The Windows instructions work in VMWare

ionic elk
#

I found a really skinny one and bent the pins so I'm ok

#

Is there any chance we could get some solder bridges or something to rerout for SWDIO and SWCLK? Those would be really handy off duponts

tidal kiln
idle owl
#

It's VMWare Fusion for MacOS, so maybe on the Mac page? I'm not sure which section makes more sense :/

meager fog
#

@ionic elk squidgin

ionic elk
#

@meager fog or maybe some of the GPIOs could be swapped out for them? It's not like they're useless pins, they're just PA13 and 14. I could tie their never-reset status to a debug flag

meager fog
#

hiero, they dont have any special functions :/

ionic elk
#

so they're only there for people who really want debug

meager fog
#

there's so few pins, i like having it this way

#

its pretty rare for people to need debug

ionic elk
#

it's true it's a super tight fit

#

that's ok. Did all the other pins you pick have an altfunction?

slender iron
#

@tidal kiln ya, if flash fails the repl will work but the fs won't

tidal kiln
#

@slender iron any REPL way to check that?

meager fog
#

@ionic elk yah

slender iron
#

the os.listdir() they did is usually what I do

meager fog
#

for example, CAN is on 9/10

tidal kiln
ionic elk
#

@meager fog what would you think about having a little extended-header baggie option to go with the f405? I had to really poke around the A2 shelves to find ones that'd fit in a breadboard.

meager fog
#

@ionic elk you mean stacking headers?

ionic elk
#

Just stuff to elevate it so it can be used on a breadboard while debugging

meager fog
ionic elk
#

I dunno how high priority it'd be but it might be nice

#

Oh whoops

meager fog
#

one above and one below

ionic elk
#

that's exactly what I meant

idle owl
#

@tidal kiln Yah looks good

ionic elk
#

Should have searched better!

tidal kiln
#

@idle owl cool. thanks.

meager fog
#

@ionic elk all good πŸ™‚

#

@ionic elk lemme know when you start on the SPI flash

#

and i can suggest some attack vectors

tidal kiln
#

@slender iron and OSError: [Errno 19] Unsupported operation is expected behavior if flash is bad?

slender iron
#

I thiiiiiiink so

#

it can happen if it's a different chip too but I don't know if we have different version of the small flash chip

tidal kiln
#

ok. i'll ask them for some more details. also to try something other than a Pi just to get that out of the equation.

slender iron
#

I'd just replace it. They said they tried other CP boards with the Pi and they work fine

#

and if it's a usb thing then the os.listdir() would work fine

ionic elk
#

@meager fog oh whoop I've been working on it for like an hour

#

what are your suggestions? I've gotten everything wired up and it compiles, but I don't see any filesystem yet

meager fog
#

@ionic elk ok have you verified with your scope that you are seeing SCK/MOSI and CS toggle on the right pin

ionic elk
#

Not yet, I'll go grab the A2 Saleae

meager fog
#

@ionic elk ok an oscilloscope will work better for this

ionic elk
#

Only just got to the testing phase, had to piece through all the macro defines and get openocd to recognize the 405 first

meager fog
#

but a saelae will work too, gotta clip onto the lil legs

#

okidoke

#

why ya using openocd not jlink?

ionic elk
#

tannewt had me get a cool clip thingy

#

habit?

meager fog
#

ok i find jlink 'just works'

#

but whatever is good for you

ionic elk
#

I tend to go for stlink because it's already on the discoveries

meager fog
#

oh true

#

ok

ionic elk
#

so I don't even have to worry about it most of the time

meager fog
#

well, when you get to the point of togging data on those lines lemme know

ionic elk
#

sure thing

main meteor
#

That's some attractive PCB routing.

ionic elk
#

I'm always in awe of the feathers

main meteor
#

They're like little jewels of circuitry. However, I wouldn't want to hand-assemble one.

#

Then again, I think the Teensy 4 has some 0201 parts on it, eek.

ionic elk
#

@meager fog hang on, doesn't mosi need to go to miso and vice versa? Or do you swap terminology on the flash chip for convenience? Looking at the Feather schematic

meager fog
#

no

#

MOSI is always from host to device

#

MISO is always from device to host

ionic elk
#

hmmm. I could have sworn I needed to switch them for the BMP280 though

meager fog
#

should not be unless we miswired something

ionic elk
#

and other cases

meager fog
#

SPI naming is consistant

ionic elk
#

Yeah seems like I'm just getting it mixed up

#

That was my original memory of SPI from the other times I've used it, I don't know why I got it mixed up recently. Must have messed up my wiring.

main meteor
#

Yeah, MOSI and MISO are great at reducing confusion, avoiding all that RX/TX guesswork.

meager fog
#

@ionic elk you will never forget now!

main meteor
#

MOSI is "master out, slave in" and MISO is "master in, slave out".

ionic elk
#

@meager fog and it is a GD25Q16C on this feather, correct?

meager fog
#

yep

north silo
#

sorry.... is there a sales or customer service channel? for pre sales questions...? ive got stuff in my cart.. and am reluctant to purchase without some hand holding....

#

thanks in advance

tidal kiln
#

@north silo try asking in #general-tech or one of the help-with channels

north silo
#

Danke!

stuck elbow
#

I think this will be the final one.

slender iron
#

@ionic elk you are getting confused with uart which is tx to rx

#

@idle owl nice job with hacktoberfest! cool to see some new folks already πŸŽƒ

pearl notch
ionic elk
#

@meager fog, I have the logic analyzer going, did a control test with the BMP, and now I've got it rigged up to the flash chip. I'm seeing CS drop down, but no other activity. Any tips before I dive into the debugger, since you brought it up earlier?

slender iron
#

@ionic elk nothing else going sounds like the SPI may have been reset or never inited

ionic elk
#

@slender iron I'll check that first, then.

slender iron
#

cs usually works because we don't use the spi peripheral to manage it

ionic elk
#

Is there a way to attempt to force the flash to reload without restarting the chip power? There might be mp error messages I'm missing because they only occur directly after power-on.

idle owl
#

@slender iron Yep, didn't take long.

slender iron
#

@ionic elk I use the debugger at that point and put breakpoints at the critical parts

ionic elk
#

@slender iron actually, I blanked on my setup, but this was actually for a SPI test of that line WITHOUT the flash system.

#

As in, I do not see any activity when attempting to manually use the SPI pins attached to the flash memory, using the internal flash and without SPI memory enabled.

errant grail
#

@pearl notch Excellent analysis!

manic glacierBOT
#

Fixes #1696.

  • Needed to update tinyusb to bring in HID fixes necessary for gamepad to work on XAC controller.
  • Added HID OUT interface descriptor to match many existing devices. Not yet supported by CircuitPython libraries.

To use the XAC-compatible gamepad descriptor, add a line like this to, say, ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk:

USB_HID_DEVICES=XAC_COMPATIBLE_GAMEPAD
meager fog
#

@ionic elk hihi checkin in - did ya work out getting SPI twiddling?

raven canopy
tidal kiln
manic glacierBOT
ionic elk
#

@meager fog no I've had no luck so far. SPI isn't activating at all on that channel - only the SSEL line is active for very brief periods, compared to a control test on the default SPI line, which shows activity on SLK and MOSI.

#

I believe it's probably tied to the fact that SSEL is pulled high by default on the feather, where as for the default case with the 280 or an empty line, SPI is either floating or low. I was going to refresh on the documentation for the whole protocol tomorrow morning/

#

Since some other stuff came up for me this evening.

manic glacierBOT
idle owl
#

@tidal kiln Probably an accident. I enabled them.

tidal kiln
#

cool. thanks. figured it was just something like that.

idle owl
#

@gilded cradle Ran into issues with making the fritzing, needed PhilB to step in, and so I moved onto the other Fritzing I needed to create. Hoping tomorrow for yours because I need Limor's input on this one before I can move onto doing the weird editing for yours.

gilded cradle
#

Ok, thanks @idle owl.

meager fog
#

@ionic elk ?? the pullups, if any are pretty small so that wouldn't affect SPI functionality

gilded cradle
#

I'm adding a Gizmo example to ImageReader, but getting through automated test challenges like the 7735 driver.

meager fog
#

@ionic elk so its probably something else

slender iron
#

@tulip sleet I think we need to move the local service stuff out of peripheral

#

because servers are almost entirely independent of connections

#

the only thing that needs a connection handle is notify/indicate

#

read and write ignore it

tulip sleet
#

do you mean move the services list out? Right now both central and peripheral have remote services lists, and only peripheral has a local services list. This is probably just because I hadn't implemented a central with local services

#

i didn't have an object to put it in. who will hold the local services list?

slender iron
#

it can be a global

#

so Adapter

#

I think I'd move more into Adapter and unify Central and Peripheral into Connection or remote device

#
hid = HIDService(HID_DESCRIPTOR)
device_info = DeviceInfoService(software_revision=adafruit_ble.__version__,
                                manufacturer="Adafruit Industries")
adafruit_ble.advertise(hid, appearance=961)

k = Keyboard(hid.devices)
kl = KeyboardLayoutUS(k)
print("Start typing:")
while True:
    c = sys.stdin.read(1)
    sys.stdout.write(c)
    kl.write(c)
tulip sleet
#

does that conflict with your idea of multiple peripherals? probably not, since in SD it is not really separate

slender iron
#

that's the hid server example code I want

#

multiple peripheral connections are ok but they see the same view of the server

tulip sleet
#

it's fine, I think it's fine, just make sure that user code specify its role easily (peripheral or central)

slender iron
#

peripheral and central are implicit in how the connection is established right?

tulip sleet
#

yes, and in advertisign

slender iron
#

advertising is separate I think since a central can attempt to connect to a BLE address without a scan

tulip sleet
#

notice that you are kinda moving toward a more procedural interface from an oo one. It's fine, but because of the multiple roles it's really difficult to have fixed-role objects

slender iron
#

how so?

#

for GAP I am I think

tulip sleet
#

i mean that the purpose of having a Peripheral or Central class is decreasing. It's all connections, it's all dynamic, the device roles shift as the device takes on different roles over time

slender iron
#

ya, totally

tulip sleet
#

e.g. above you have adafruit_ble.advertise() instead of periph.advertise()

slender iron
#

it can be both at once to different other devices

#

right

#

is it possible to have multiple connections between the same two devices?

tulip sleet
#

from the code writer point of view, it means that the code writer has to know more about the BLE model in an implicit way, rather than via knowing what the classes are

#

a phone could pretend to be two centrals, i don't see that a peripheral would know

#

i just think that the easy stuff should still be easy (e.g. doing Bluefruit protocol stuff should have a nice wrapper), to avoid our end user having to understand BLE fully

slender iron
#

does that involve wrapping connection management?

#

in this example the server doesn't care if anything is connected

#

I could have the service get advertised by default

tulip sleet
#

you mean in the HID example above? What would hang if there was no connection? I think the user program may want to know when there is a connection, to report status, decide to do something else, etc.

#

would kl.write() hang?

slender iron
#

nothing in the example would hang. However you could read the list of active connections to know

#

although that still doesn't handle if you care if someone is subscribed to your characteristic

tulip sleet
#

I'm asking what would happen if there's no connection by the time you get to kl.write()

slender iron
#

or the adaptor class could have a sleep_until_connect() function

#

it would still write the attribute value

#

but it would only end up in the local table

tulip sleet
#

i don't think that's good, the program wants to tell the user whether there's a connection yet or not, so the user knows not to type, for instance

#

e.g. still need a .connected property

slender iron
#

on the local server though? Or is a list of active connections enough?

#

it's ok to not care if something is connected though

#

it can be a separate concern

tulip sleet
#

the example above is like a tiny version of screen; i want to know whether I'm connected or not

slender iron
#
while not _bleio.adapter.connections:
    pass
print("Start typing:")
while True:
    c = sys.stdin.read(1)
    sys.stdout.write(c)
    kl.write(c)```
tulip sleet
#

and suppose connection goes down during while True loop?

slender iron
#

check the connections in the loop too

tulip sleet
#

the current examples all poll about the status of the connection

slender iron
#

I know, but do they need to?

tulip sleet
#

yeah but it could be a connection to a different service

#

right now they need to know when to start advertising again

slender iron
#

right

tulip sleet
#

and they might decide to not start advertising; it shouldn't necessarily be only automatic

#

like if the connection is really flaky, they might give up

#

e.g. a remote sensor wants to report that the connection to the central is really flaky

#

by turning on an LED or somethign

slender iron
#

ya

#

this is relevant

#

it's not really possible to know if a peer cares about a service

#

the only clue is whether it enables notify/indicate on a characteristic

tulip sleet
#

i see what you mean, but you do care if you are connected at all.... I do think there might be examples where the CCCD is checked to see if anyone is listening. There might be examples in Bluefruit52lib for that

slender iron
#

looks

#

I like the top level Service instatiation for the local service in my example

#

interesting that both scanner and advertiser can restart on disconnect

tulip sleet
#

I think that's good, too. just maybe do have an easy way to check for a connection, as we already discussed. I don't think you need to return a list of the connections: that will potentially generate Python garbage, just a .connected is ok

slender iron
#

ya, could have both

#

you need a list of connections in case you care about something already connected

tulip sleet
#

central is more complicated, because it initiates the connections, and won't start doing anything until it has set up a connection it's interested in

#

it does not want to read from a service until there's somethign to read

slender iron
#

right,

#

that's where you'd check the list of existing connections and scan if the device you are looking for isn't connected already

tulip sleet
#

i think maybe we are rediscovering why the SD API is like it is

slender iron
#

probably πŸ™‚

#

I'm also hoping I'm not just reading simplifications of their own

tulip sleet
#

there is a little discussion of simplifications in the micropython BLE PR that just got merged, nimble vs SD, I think

slender iron
#

I did get the hid descriptor parsing going

tulip sleet
#

woot!

slender iron
#

definitely weird

#

it's like they were really worried about overall size

tulip sleet
#

also we don't know how much of the spec was, "well, we did this already, so just take it"

slender iron
#

ya

tulip sleet
#

i appreciate the fresh blood you have brought to BLE. I would say fresh look but I think there's some blood there too πŸ™‚

slender iron
#

heh, I'm enjoying it

#

just blowing my mind every day or two

#

I may want to split local vs remote for service and characteristic

#

the high level api may not use it but it may be nice to build on

tulip sleet
#

i thought about that but there was a lot of shared code. on the other hand i did split device into central and peripheral

slender iron
#

πŸ™‚

#

discover_remote_services begs to be shared

tulip sleet
#

right, ultimately it's very functional, not oo

slender iron
#

It's probably not wise to rely on the underlying BLE stack (nimble, nordic, bluedroid) being able to add services "later on". In other words, the common denominator here would be to assume that all services must be registered at the same time. from damien is interesting because ble is designed to indicate when services change

#

well, that is what the generic attribute service is for

tulip sleet
#

designed, yes, but not necessarily implemented that way. and as I mentioned, the Apple library (and I think the Android one too) are not as flexible as you might expect. The Android API has gone through several revisisions to make it better

slender iron
#

πŸ‘

tulip sleet
#

by functional I mean the API has to be functional (repeating what I said before)

#

watch out or you'll end up on a standards committee

slender iron
#

heh

#

ya, I agree gap is functional because it manipulates global state

#

gatt feels oo to me

tulip sleet
#

but the gatt objects get bound to connections, so that's the dynamic part, as you have done

#

they are self-describing, it's reminiscent of ASN.1

slender iron
#

the remote services do

#

heh, asn.1 sounds like protocol buffers too

#

standard interface description language for defining data structures that can be serialized and deserialized in a cross-platform way.

tulip sleet
#

"network management" interfaces are a lot of a.b.c.d.e kind of paths, and they are kidn of like characterisitics

slender iron
#

πŸ‘

umbral dagger
#

Oh hey... Great talk at MIT.

tulip sleet
#

thanks!

#

it took a while to find some things to draw out as lessons learned

slender iron
#

I wonder if scan should be async

tulip sleet
#

@slender iron scan is typically implemented by calling a callback for each received advertisement

manic glacierBOT
manic glacierBOT
raven canopy
#

the irony that my first qualifying Hacktoberfest PR, is automating Hacktoberfest label assignment. 🀣

slender iron
#

@old smelt what did you have to change in rect?

old smelt
#

In init:

            self._palette[0] = fill
        else:
            pass
            #self._palette.make_transparent(0)```
meager fog
#

@ionic elk hiya lemme know if yr working on SPI today

old smelt
#

commented out the make_transparent() call. (Added pass to keep the else)

#

then in the fill setter added make_opaque() to allow colors again:

    def fill(self, color):
        if color is None:
            self._palette.make_transparent(0)
        else:
            self._palette[0] = color
            self._palette.make_opaque(0)```
meager fog
#

@ionic elk i have more stm32 feathers now so i can test

slender iron
#

@old smelt that is really weird that it breaks it

old smelt
#

I agree. But right now how all the Palette and Bitmap stuff works is still murky to me. I thought if I shared this, it might generate some ideas for those know understand the details better.

slender iron
#

did you try reproducing it without the shape library?

#

narrowing down the breaking code can be super helpful

old smelt
#

Not yet. I was headed there. I was trying all the shapes first to see if they all had the same behavior. Got as far as rect vs roundrect and discovered I could (1) fix the problem with rect, and (2) not with roundrect.

That detoured me a bit. But I'll keep moving in that direction.

I also tried recreating on the M4 Express and TFT in case there was something happening in the PyPortal libs that was unique. So far, no difference.

ionic elk
#

@meager fog yeah I found the source of the error.

#

@slender iron is there a way to manually define an SPI flash chip with circuitpython, the way you can with the arduino libraries?

slender iron
#

@ionic elk I don't know what you mean. I don't do arduino at all. You should be able to use busio.SPI to talk to it from user code

ionic elk
#

Sorry - what I meant was, is there an interface in circuitpython for manually reading and writing to the flash chip, or would I be recreating flash commands on via busio?

slender iron
#

there isn't for doing the filesystem stuff

#

once you have it talking to the chip though it should be easy to set up the internal stuff to do it

ionic elk
#

Sure. For now I'm just trying to double check that my SPI line is working as it should.

slender iron
#

right, I wouldn't worry about the filesystem stuff then, just read the chip id

meager fog
#

@ionic elk there's a line where the JEDEC is read out

#

halt the debugger there and print it out

slender iron
#

he isn't seeing any activity on MOSI and SCK last I heard

meager fog
#

yah that needs workin' first πŸ˜„

slender iron
#

@gilded cradle or @pastel panther are you planning on reviewing @plucky flint 's PRs to circup?

meager fog
#

unclear if "yeah I found the source of the error." fixed that or not

slender iron
#

ah ya

gilded cradle
#

Yes @slender iron

slender iron
#

awesome, thank you!

pastel panther
#

@slender iron I'm working on the travis integration atm. thanks @gilded cradle

slender iron
#

πŸ‘

manic glacierBOT
ionic elk
#

@meager fog @slender iron sorry, been in the weeds. I've got the SPI line working, there was a dumb index mistake in the pin assignment system that we missed because it won't occur for the first pin set of a given SPI peripheral.

#

Now I've got the SPI flash rigged up, and my logic analyzer says it's talking to it a LOT, but it doesn't seem to ever finish

#

Wondering what's a reasonable amount of time for that to finish

idle owl
#

@gilded cradle The TFT Gizmo fritzing object is pushed, but it's not ready. I'll let you know when it is. Wanted to let you know so if you saw it, you didn't try to use it yet.

meager fog
#

@ionic elk did ya put a break on the JEDEC check line?

gilded cradle
#

Ok, thanks Kattni. I'll wait on it.

meager fog
#

it could be busy-polling

manic glacierBOT
#

Here is a diff for folks who want to see the changes: https://github.com/adafruit/circuitpython/compare/master...sparkfun:master

Flash start up time should be ok. For the bitmask you'll want 0x02 since quad enable is bit 1 in the status register. You could try lowering the maximum speed to ensure it's not related to that.

Linker script looks right.

For board config, you'll want to add the QSPI pins if you switch to that. In SPI mode, it should not reset the pins automatically. I don'...

ionic elk
#

@meager fog Looks like I'm running into an infinite loop related to HAL timeouts but that's up next

slender iron
#

@ionic elk are you getting the old chip going? it's possible it's stuck waiting for a write to complete or something

#

the initial format shouldn't take more than a second

ionic elk
#

@slender iron I think I've found it - there's this spi_flash_read_command that happens very early, and it doesn't configure the SPI before that. So it's just in its floating initialization state

#

which isn't really floating or anything, but there's no guarantee that it's appropriate for the board

#

Why is external_flash trying to do reads before it's even set the baudrate?

slender iron
#

@ionic elk link me to the call you are looking at please

slender iron
#

that first read is trying to figure out what chip it's talking to

#

so the default baudrate should be fine

ionic elk
#

what is the default baudrate?

#

I mean, there's the chip default baud, but that can be different for any given board

#

And the program never even hits configure before this point. So the baud it's attempting to read at could be literally anything.

idle owl
#

@gilded cradle Alright, with Limor on the assist, it's all set to go. The fritzing object is ready. For the "wiring diagram" you'll want to put it on a CPX - you won't see the CPX, but it shows all the mounting holes on the Gizmo connected and green. Same as with FeatherWings essentially.

gilded cradle
#

Ok, thanks Kattni

idle owl
#

Sorry about the delay, that one was tricksy from the beginning.

gilded cradle
#

Yeah, I saw your struggle

idle owl
#

There was a whole issue before that too πŸ˜„

#

There was something in the .brd file named with a ' in it, and it barfed. Phil had to dig to find out why.

gilded cradle
#

Ugh

#

That's touch. Almost as much as the phantom space at the end of a file

idle owl
#

I had to edit the .brd file in a code editor to get it to run

#

But hey, now I know 🀦

gilded cradle
#

Ah, yeah

prime flower
#

@solar whale @crimson ferry did some hacking on nina-fw the last few days, just tested it out this PM with AWS IoT (device certificate and PSK are hardcoded into nina-fw for now)

slender iron
#

@ionic elk SPI should be usable before a configure call

ionic elk
#

@slender iron is there a specific default frequency you'd like me to target?

slender iron
#

atmel starts at 250k so I'd do the full divisor for stm

ionic elk
#

ok

slender iron
#

configure can then be used to boost it up

ionic elk
#

well, still no dice

#

I was seeing some ugly stack corruption in the SPI flash startup before, I'll try and determine if that's still happening.

sly falcon
#

@prime flower nice πŸ‘Œ

prime flower
#

@sly falcon Thanks for including info about Arduino team's work in their nina-fw for enterprise in the PR notes. I made sure not to take the command addresses they are spec'ing out

#

the ones I took are nicer anyways πŸ˜†

sly falcon
#

heh...you're welcome! didn't even know it'd come in handy....err...I mean...I totally planned it that way πŸ˜‰ lol

prime flower
#

@sly falcon I did a lot of "under the hood work" for nina-fw's WiFiSSL library as well (you'll prob see the PR in tomorrow). Added user-defined certificate/psk along with an active connection timeout managed by wifinina (not circuitpython code)

sly falcon
#

dopeness 🀘

prime flower
#

more verbose error logging, and a new makefile which has a esp-idf inspired workflow for setting a SAMD51 device into serial passthrough mode -> flashing nina-fw binary to the ESP32 -> uploading circuitpython to the device -> uart serial with esp32

sly falcon
#

@prime flower so...you touched it last, so you're the new NINA fw person, right? right?? 😜

prime flower
#

lol, I actually like working on it. It's just a lot of active cross-referencing between esp-idf, nina-fw, and the mbed docs.

sly falcon
#

oooo....I'm liking this makefile work of which you speak...that sounds really cool

#

oh hey....that's something I hadn't caught onto yet....mbed docs?

prime flower
#

Tooling that helped me not go insane πŸ™‚

sly falcon
#

does the mbed stuff help with the esp-idf portion or the nina portion?

prime flower
sly falcon
#

gotcha

#

probably why I didn't know about it - that's a portion of the code I haven't poked in

prime flower
#

The part I "figured out" was that the esp32-arduino BSP's "WiFiSecure" arduino library references these as well and I was able to use their implementation of connect.

#

so I was able to start working backwards from there. As a result - looking at how esp32-arduino "cores"/"libraries" implement the esp-idf might be the best jumping off point for @crimson ferry when they write the AnalogWrite/AnalogRead impl.

sly falcon
#

heh...I did do a bit of poking in the arduino-esp32 core on Espressif's repo...and my head started to swim

#

but this was probably a bad weekend to try to wrap my brain around code, anyway

#

I'll definitely look at it again

#

this is the downside of having a hobby too closely related to my day job....when I get home, I'm often brain fried and don't want to look at code or a computer again for many hours πŸ˜‰

idle owl
#

@gilded cradle @tidal kiln @pastel panther @slender iron @tulip sleet When doing releases on CircuitPython libraries, please start updating the boilerplate to point to https://circuitpython.org/libraries for the bundle download. I've been doing it as I make releases, so the next time we copy/paste it, it's been updated, but it obviously needs to be manually done at least once. Thanks!

pastel panther
#

@idle owl will do. It might be worth checking if github supports actual templates

idle owl
#

Not sure if they do for releases, but I'll look into it.

manic glacierBOT
meager fog
#

@ionic elk woo ok lets try out that auto-generated-build-PR thing!

slender iron
#

@meager fog it only appears after the whole check suite is done unfortunately

meager fog
#

oooh no biggie

#

thats why i couldnt find

slender iron
#

it'll be in the top right of that page

meager fog
#

all good - yah i thought maybe it moved - i will review when thats done πŸ™‚

slender iron
#

πŸ‘

meager fog
#

doesnt take so long

slender iron
#

I don't believe it has

prime flower
#

@sly falcon I feel that, between grad. school and work. But I like both! If you get stuck or have q's regarding the arduino-esp core let me know and I'll try to help out.

ionic elk
#

@meager fog when micron says that their memory is 128Mb or Mbit, do they mean megabits or mebibytes?

#

and if it's the first, would I put in 16MiB or the true 15.2588 value?

meager fog
#

138Mb is mega BITS

#

so divide by 8 for mega BYTES

#

sneaky!

#

flash memory is almost always classified in terms of bits

#

eg the 25Q16 is 16 megabits = 2 MBytes

ionic elk
#

ok so 2MiB

#

so this would be 16MiB then

meager fog
#

2 MBytes = 2048 Bytes

#

so.. umm, whatever that is MiB or MB

ionic elk
#

yeah the math is fine I'm just trying to match terminology lol

meager fog
#

a 25Q128 = 128 megabits = 16 MegaBytes

#

ya ya

#

πŸ‘

#

whee

ionic elk
#

noice

meager fog
#

@slender iron @ionic elk ^

#

haleluliah

#

time for some testin'

ionic elk
#

Oh, too bad. The F412 only has the flash chip connected to the QSPI peripheral, which I guess is completely separate from regular SPI

#

So that one will have to wait

sly falcon
#

@prime flower word...thank you! πŸ˜€

manic glacierBOT
#
Adafruit CircuitPython 5.0.0-alpha.4 on 2019-09-15; Adafruit Monster M4SK with samd51j19
>>> import audiobusio
>>> import board
>>> mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid clock pin

This is in [common-hal/audiobusio/PDMIn.c](https://github.com/adafruit/circuitpython/blob/22b7050c4cd8f2cad31657f91dd4a217b0444a76/ports/atmel-samd/common-hal/audiobusio/PD...

main meteor
#

I think 2kB is 2048 bytes. 2MB is 1024 times that.

meager fog
#

@ionic elk yah that is not surprising - we can do QSPI later, its usually not super hard

#

@ionic elk with the extra space you have now you can test BMP280 and such

#

please do!

manic glacierBOT
ionic elk
#

BMP was working on the last version actually, @meager fog, but now we can do the OLEDs which is super cool

crimson ferry
#

@sly falcon @prime flower I was looking at Arduino core and comparing to IDF. Unless I missed something, IDF may be the more direct route. Arduino core does analog read very low-level whereas IDF seems to do it with two setup calls and one read call. I'll add some notes in the issue.

meager fog
#

@ionic elk try allll!

#

i will too

ionic elk
#

Also just got the meowbit in so display stuff is definitely up there

meager fog
#

just had a meeting'

prime flower
#

@crimson ferry yep, IDF is the way to go if you can

meager fog
#

@ionic elk ok back

#

so for i2c i cant get oled to work it has an error when sending data

#

i am like 95% its due to a buffer limitation, like you have a fixed i2c buffer

#

and we're tring to push too much

#

because with oleds we wrte a big chunk of display at once

#
Traceback (most recent call last):
  File "code.py", line 20, in <module>
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 191, in __init__
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 83, in __init__
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 116, in init_display
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 166, in show
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 205, in write_framebuf
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/ssd1306/adafruit_ssd1306.py", line 205, in write_framebuf
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 112, in write
OSError: [Errno 5] Input/output error
ionic elk
#

I'll see if the HAL has a max buffer size

#

But you just pass in a pointer and a length so there's nothing I can squarely lay blame on out the bat?

meager fog
#

well the first chunk of the display gets blanked

#

thats why i think tis a size liitation, i think we are trying to write 128x32 bits = 512 bytes

#

and its got some limit of 32 or 64 byte

#

so when we call

#
    def write_framebuf(self):
        """Blast out the frame buffer using a single I2C transaction to support
        hardware I2C interfaces."""
        with self.i2c_device:
            self.i2c_device.write(self.buffer)```
#

it writes the first n bytes, then falls over

#

this is my guess based on other i2c implementations

#

sensors only xfer like 16 bytes at a time max

ionic elk
#

Hmm, what would be the traditional fix for that?

meager fog
#

@ionic elk well, start by making an issue

#

and try replicating with an i2c oled and the ssd1306 library+example

#

@slender iron @tulip sleet dy'all know what has to be enabled to make board.I2C() exist on a new port

#

like the 'default' bus thingy

#

ok tested PC9685 and AMG8833 featherwings

#

IS32FL is having same I2C buffer size issue as SSD1306

#

@ionic elk also make an issue to enable the random module on the build

ionic elk
#

I think you made one for that already

meager fog
#

@ionic elk oh ok rad

#

ok here's a fix for SPI, when the pins are not valid, throw a valueerror not runtimeerror

#

to match the other ports

#
Traceback (most recent call last):
  File "code.py", line 7, in <module>
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dotstar/adafruit_dotstar.py", line 98, in __init__
  File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/dotstar/adafruit_dotstar.py", line 88, in __init__
RuntimeError: Invalid SPI pin selection```
#

^ that should be a ValueError

ionic elk
#

god it's so nice having decent flash

#

@meager fog noted, I'll get that in there

#

flipping flip my mac has spontaneously decided to shake up the default programs for all my files again.

#

I'm moving to linux the second I can get a new PC at my desk, this is ridiculous.

meager fog
#

lol

#

oki

#

k dotstar wing tested besides that valueerror/runtimeerror thiing works

#

ill test SPI now with sd card

ionic elk
#

SPI 128x64 works great

#

just did that

meager fog
#

yay great

#

ok for SD card, we're missing another builtin module, storage

ionic elk
#

@meager fog would the busy SPI line error be a value or runtime error? Or is that not a big deal either way?

tulip sleet
#

@ionic elk @meager fog for default devices like board.I2C(), there are definitions in boards/*/pins.c and DEFAULT_* in boards/*/mpconfigboard.h.

meager fog
#

@ionic elk you should mimic whatever the SAMD error is

ionic elk
#

Dealing with the builtin modules was one of those things I'd like to handle as a part of general cleanup

meager fog
#

yah add an issue for these, and you can get thru them

#

just bumping into these on the way thru testing πŸ™‚

ionic elk
#

@meager fog there's not really a great alternative on other ports because they don't have peripheral conflicts of the same kind.

meager fog
#

hmm ok but busy/unavailable SPI pins are a generalized problem

#

for unavailable, at least, please make it valueerror πŸ™‚

#

that way the dotstar library can catch it

ionic elk
#

You're only going to run into the sort of invisible peripheral conflicts on the STM32. It's a consequence of abstracting away the fact there are distinct SPI and I2C peripherals that each have multiple combos, but still exist under the hood

#

I'd like to think of a better way of presenting it that lets people know what's going on without sacrificing the ease of use, but it's tricky.

meager fog
#

@ionic elk right, but we can work around them