#circuitpython-dev

1 messages · Page 258 of 1

meager fog
#

nrf is way easier than samd 🙄

onyx hinge
#

It's working well enough that I can tell whether I recorded "eeeeee" or "aaaaaa" sound of my voice

meager fog
#

samd you need to setup the whole i2s kit

#

ok it just pipes back the sample for you then?

onyx hinge
#

but the audio level is low

meager fog
#

oh thats normal

#

you need to boost the gain

#

its not going to be 3.3Vpp 😄

#

its like 0.5Vpp

onyx hinge
#

PWM audio out too

meager fog
#

you should get like +- 1000 value

#

PWM output you can easily measure to see whats up

#

eg pwm out a triangle wave, see the wave output

#

it did seem a tad quiet

#

but only like 50%

onyx hinge
#

in a "quiet" room I am getting a variation of ~1600

meager fog
#

if that

onyx hinge
#

and when I make a loud noise with my voice I get a variation of ~5000

meager fog
#

mm in a quiet room there should not be much variation at all

#

how are you setting the decimation

#

or is that done for u too

onyx hinge
#

I think that's the RATIO register

meager fog
#

can you plot the output with mu or other plotter

onyx hinge
#

sure, let me see what I can do

#

hm this machine doesn't have mu yet

#

I can install it rq

meager fog
#

are you running this within circuitpy

#

also i have the fresh new CPB - i could test it 🙂

onyx hinge
#

🤤

meager fog
#

im doing the tester now iz whats up 😄

#

so i was like "HOW CONVENIENT

#

lol

onyx hinge
#

so here's a question for you. If I hook the DATA pin to GND instead of to the mic, shouldn't I get an unchanging sample value, because it will always read 0 bits in?

meager fog
#

correct

#

does that not happen?

onyx hinge
#

no, that does not happen 😕

meager fog
#

what numbers is it givin ya

onyx hinge
#

well, nothing like what I expected!

meager fog
#

well thats interesting

#

yeah i recommend getting the plotter going

#

so you can see in realtime

onyx hinge
#

so there's still some sort of transient going on(?) but there is an audio signal on top of it

meager fog
#

yeah DC offset changes, thats not unusual

#

it looks ok actually

#

please try mu - that way you can get realtime plotz

#

then get an audio generater website up

#

and sweep some tones

#

while you check the plotter

onyx hinge
#

mu keeps telling me I'm flooding so I resorted to a product I know

meager fog
#

ahhh ok

#

it kinda looks like it does some long-term adaptation

onyx hinge
#

you think that's from the mic, or from the nrf?

meager fog
#

(samd peripheral does nothing)

#

if you are tying DAT to GND, and you get that blue curve, its either a wiring issue, or someting in the nrf

#

its not bad tho

onyx hinge
#

I am "enabling" and "disabling" the NRF periph each time mic.record is called, perhaps that's a mistake

meager fog
#

could try without

#

samd does nothing for you, so we track the DC change by hand - the nrf might be trying to 'help' you

onyx hinge
#

let me see, I did that because I didn't want it to DMA somewhere unexpectedly, but I can just allocate a 4 byte static buffer

solar whale
meager fog
#

those are the side pads

solar whale
#

doh!

meager fog
#

@onyx hinge if/when you want, if you build me a CPX UF2

#

i can try some of the existing demos we have

solar whale
#

😳

onyx hinge
#

@meager fog oh that reminds me, I think I found a bug where RawSamples always loop on nrf. 😦

meager fog
#

theres a lotta lil bugs in nrf

#

we'll squish them over the next few months - i still get some hardfaults

onyx hinge
#

OK, I'll look.

meager fog
#

but yeah - you'll need to boost the gain

onyx hinge
#

for now, I guess I'm reassured that the audio levels are not unexpected and I have a direction to try to work on the transient / dc offset problem

#

there is a register for gain setting, but no way for the user to set it through the current Python API. Would you want a static value chosen to suit the CPB / this breakout?

#

or do we need to go full AGC or extend the API?

meager fog
#

we should add a gain value at some point

#

i wouldnt AGC yet

onyx hinge
#

okay, I may just hard-code a non-default AGC value for myself for now

meager fog
#

chat w'dan about adding a gain kwarg

#

yah

#

i think you're getting good data tho

onyx hinge
#

I appreciate you taking the time to make sure I wasn't completely off track

meager fog
#

PDM mics are cheap because you have to do this extra work 🙂

#

np i been there

onyx hinge
#

if the board def was merged, I could build you a firmware for cbp(le) but I think it's quite premature at this point

meager fog
#

oki

#

will check it this week!

onyx hinge
#

great, I may have a few more updates for the monday meeting, otherwise I'll be putting in little bits of time every evening this week and then another block next weekend

meager fog
#

gr8, check out the existing pdmin demos

#

ill say they're minimal, the '21 wasnt fast enough to do much

onyx hinge
#

It looks like just continuously recording is not possible with the API

meager fog
#

the 840 isnt much faster, but you don't have to decimate so i think we have more process time, also its an m4

#

soooo maybe

#

yeah there was no chance of that so we didnt add it

onyx hinge
#

nods

#

not sure what you would do with the data anyway

#

doing arithmetic on every sample from python is not going to get you much, no darth vader voice for you

meager fog
#

yah its for sound sensing, not sound recording

#

dunno why the '840 has so much flash/ram but anemic on speed

onyx hinge
#

OK, yes, when I leave the peripheral active the whole time then I get a variation of 75 for a quiet room, and ~600 for me saying "eeee" from 2' away

#

4000 from me saying it from 2" away

meager fog
#

thats pretty good

#

you were getting a 'pop'

#

sounds solved 🙂

marble hornet
#

I have been unable to update a class's instance by changing it's _ dict _ attr is this bug or space saving measure?

onyx hinge
#

@marble hornet the latter, I think

marble hornet
#

ex:```class oneoff_module():

def __init__(self, file_path):
    namespace = {}
    exec(open(file_path, 'r').read(), namespace)
    print(namespace)
    print(self.__dict__)
    self.__dict__['v'] = 5
    self.__dict__.update(namespace)
    print(self.__dict__)

x = oneoff_module('foopy.py')
print(x.v)```
prints 5 in cpython but not cirpython

#

@onyx hinge any suggestions to get around it?

onyx hinge
#

I assume this is the error you get instead? AttributeError: 'dyno' object has no attribute 'v' (except your class name is different)

#
    
    def __init__(self):
        setattr(self, 'v'), 5)
        print(self.v)

x = dyno()
print(x.v)
``` this works for me, prints 5
marble hornet
#

hrmm, okay, so: for name in namespace: setattr(name, namespace[name])?

#

which is similar to has has been posted a few days ago

tulip sleet
onyx hinge
#

instead of dict.update, yes, I'd try something like that

#

afk, good luck

marble hornet
#

cu

#

i think this also works if a bit odd, my one concern would be that classes can be long lived and the b=goal is to make a destructible object.

#
    class app_module():
        exec(open(path, 'r').read())
    return app_module```
tested it seems to work  i can access attrs
#

@tulip sleet thoughts?

tulip sleet
#

I haven't looked at this in detail: are you still trying to re-import modules?

marble hornet
#

either reimport or import and delete to free up space

#

preferably the later

tulip sleet
#

are you doing this for workflow reasons or because your program wants to pull in new code and throw out old code?

marble hornet
#

yes, i want to keep stuff in memory until i need something new and am out of memory

#

then get rid of old stuff

tulip sleet
#

I would just say that in general Python and the MicroPython VM does not try to make this easy. It may seem to work, but there are dangers about trying to throw out existing classes, and we haven't tried to make sure that it cleans up properly.

stuck elbow
#

@marble hornet I would really recommend doing a soft restart instead, maybe saving some state that you need in the nvm

tulip sleet
#

then you are guaranteed things are in a clean state

marble hornet
#

okay, in the external flash?

#

as opposed tp the on chip flash?

tulip sleet
#

doesn't matter, really. microcontroller.nvm will be easier because you don't have to make the filesystem R/W. Just don't write to it excessively. Maybe check to see if it's already in the state you want before writing: don't update continuously

marble hornet
#

kk

tulip sleet
#

I know it's fun to try to mess around with Python's low-level language mechanisms, but what MicroPython (and therefore us) do is not that well-defined, and isn't meant to follow the CPython semantics or even necessarily be the same from release to release. The import code and the gc code weren't written with unloading modules in mind. I'm sorry if you've spent a lot of time on this.

marble hornet
#

i haven't spent an inordinate amount of time,i guess i;m just looking for a way to memory (ish) manage in a language that does that for you

#

thank you for the advice

meager fog
#

@onyx hinge here's a doublebuffer demo in arduino

marble hornet
#

what's an mp_obj_t?

#

in the source code it is used a c data type

exotic pumice
#

it's a uint64

#

or a void pointer

#

depending

#

py/obj.h

marble hornet
#

can i pic your brain about some other things ?

#

and thank you,

exotic pumice
#

I don't know if I know enough to answer but we can try

marble hornet
#

so i'm making a new module but wants data to persist through reloads

#

however i know modules have an init file, is that called on every reload or on every bootup?

exotic pumice
#

a python module?

marble hornet
#

yes,

exotic pumice
#

I'm not sure

marble hornet
#

kk, thank you anyways!

exotic pumice
#

I think maybe the init file is loaded on import

marble hornet
#

kk

exotic pumice
#

but yeah I'm no expert, I just have a recursive grep tool that let me search for where mp_obj_t is defined 😅

high oracle
#

Hello everyone, I recently ordered a pyPortal. Just wondering if there is any way to implement threading.?

marble hornet
#

micropython has a rudimentary threading, you might be able to get that working. however it was disabled in cirpython 1st to save space and secondly to keep it simpler for beginner makers, and advanced makers too

#

@high oracle i do not know if it just needs to be turned back on or it was removed manually form the source code

high oracle
#

@T@marble hornet I went to the github repo, but was unable to find any preprocessor for that

manic glacierBOT
marble hornet
#

@exotic pumice do you remember where modules are added to a macro so they can be accessed by name and such

#

?

exotic pumice
#

not sure what you mean

manic glacierBOT
keen ocean
#

Thanks @pastel panther... I'll connect with @prime flower regarding AWS...👌

manic glacierBOT
manic glacierBOT
#
  • Generalize the nRF "charge up pin" touchio implementation so it can be used by all ports, and move it to shared-module/touchio.
  • Turn on generic touchio for SAMD51. Now all CircuitPython ports have touchio.
  • Add CIRCUITPY_TOUCHIO_USE_NATIVE flag to indicate whether to use common-hal/touchio or shared-module/touchio. Because SAMD21 has a native implementation, but SAMD51 does not, it was difficult to do this automatically, using, say, weak references. The lists of source dire...
onyx hinge
#

whee, with a few tweaks, the sound meter demo works on nrf

manic glacierBOT
#

I'v traced through the execution of the with the J-Link and I just don't see what is going wrong. It appears to be attempting to set the color, but the writes are having no apparent effect. The face that it works on the Trinket_M0 but not on the PyRuler makes me wonder if the problem is related to the extra pin definitions on the PyRuler. Is something causing a conflict with the initialization or execution of the writes to the SPI bus at this stage. It works later in the REPL, but not doing t...

orchid basinBOT
slender iron
#

@marble hornet @exotic pumice init.c is used to store module level functions rather than those associated with a class within a module which end up in a file with the class name.

manic glacierBOT
exotic pumice
#

Oh I thought we were talking __init__ in Python

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@solar whale I am trying to reproduce the Gemma M0 and PyRuler problems. I don't have a PyRuler, but a Trinket with a PyRuler build doesn't act odd on my Macbook. The Gemma also seems OK. I am using a simple USB-C to USB-micro cable: no hubs or anything.

#

are you using some kind of hub?

#

regular MacBook with a single USB-C port, running 10.14.4

manic glacierBOT
manic glacierBOT
#

So far, this supports only 16kHz and 16-bit samples with a fixed gain. This is enough to support the basic functionality of e.g., sensing ambient sound levels. Stereo support is coded but untested.

Testing performed:

  • all tests performed on Particle Xenon with PDM Mic Breakout
  • recorded and played back short samples (using PWM Audio Out)
  • adapted the "playground sound meter" program (using a NeoPixel stick board)

Additionally, @ladyada reports "tested this and it works great ...

tulip sleet
#

@onyx hinge so no filtering needed at all, huh? Very nice peripheral.

onyx hinge
#

@tulip sleet yeah there's no hard math required

#

there would be if sample rates besides 16kHz were required, perhaps

tulip sleet
#

I am out for dinner but will merge this after the build complete successfully. Thanks!

onyx hinge
#

cool, thanks for the swift attention!

manic glacierBOT
slender iron
#

CircuitPython community meeting tomorrow at 11am Pacific / 2pm Eastern here in the Discord voice chat. All are welcome to attend. The notes doc is here: https://docs.google.com/document/d/16nsp4_ess3BlQQjJ75LQ1ImaGmmtdklNQmK_OJgWF2I/edit?usp=sharing <@&356864093652516868>

manic glacierBOT
#

I don't have one of the esp32 wifi wings on hand right now, but will look into picking one up, at least for testing. Are they strictly wifi, or is it possible to solder on an rj45 port? Not sure all the final locations for these sensors will have strong wifi signal, and I was hoping to use PoE splitters to power the boards from a single switch.

Not sure if this is related, but on some further testing, excessive load seems to also confuse the socket after a while. Something like this:

...

manic glacierBOT
#

I ran into some issues trying to switch between transparent and colored fills for some buttons I was using in a recent project.

Once a shape is created with either fill=<SOME_COLOR> or fill=None, the shape will act as either a filled OR transparent shape and cannot be changed.

The issue appears to be related to the Palette core module in displayio, and the symptoms show up in Adafruit_Display_Shapes as well as Adafruit_Display_Buttons.

It seems like the intent is to allow shape...

manic glacierBOT
#

The following seems to suggest that the time.time() function passes time faster than time.monotonic

import time
sleeptime = 300
monotime = time.monotonic()
clocktime = time.time()
print('starting %ds wait' % sleeptime)
time.sleep(sleeptime)
monotime2 = time.monotonic()
clocktime2 = time.time()
monoElasped = monotime2 - monotime
clockElasped = clocktime2 - clocktime
print('Mono elasped %f\nClock elasped %d\n' % (monoElasped, clockElasped...
manic glacierBOT
manic glacierBOT
#

@tannewt the build time for the first subjob went to 1.5 hours after I accepted the -flto merge for nRF52. I rearranged things to this. Would you be willing to accept this for now to get the jobs more balanced again (and shorter) for now until GitHub actions is working? Here's the latest build: https://travis-ci.com/adafruit/circuitpython/builds/123654081. There's a short test-only job, a shorter nRF job, and the 5 others are similar to before. So not just 5 like before, but still some empt...

solar whale
#

@tulip sleet thanks for looking into the dotstar issues -- I'm ok with closing the gemma and looking more into the PyRuler -- but now -- I'm off to bed! Goodnight.💤

manic glacierBOT
tulip sleet
#

@solar whale thank you as well! good night!

manic glacierBOT
manic glacierBOT
#

Bleh, still says "missing message ID". The .po files are very re-ordered: maybe the merge didn't work out that well. Also, what version of xgettext are you using? Mine is:

$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1
...
Maybe take the content of `locale/*` wholesale from upstream, and then do

make translate
make check-translate

since it's `check-translate` that's failing.

@tannewt Maybe we should make `make check-translate` be part of what...
manic glacierBOT
#

hmmm -- looking closely at th malfunctioning Gemma_m0 I can see that the green LED in the DotStar is actually pulsing as expected, but the blue is on steady and the red intermittently starts to flash on/f very quickly. It does look like a HW issue with this board/dotstar. I tried pressing on it, but no change. If I get brave, I may try replacing it. For now, I'll move onto other problems ....

#

I'm on debian stretch x86_64. ```
jepler@babs:~$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1
$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

onyx hinge
#

@tulip sleet I am at a loss for the "make check-translate" problem, it passes locally. 😦 clearly something different between my dev environment and travis.

#

and I have to go AFK until the meeting

tulip sleet
#

np - i'll clone your repo and try to reproduce

solar whale
#

@tulip sleet I was not advocating keeping the feather_m0_supersized in the build list. Certainly not for my benefit.

tulip sleet
#

no, i understand - you're perfectly capable of building your own 🙂

stuck elbow
#

why are you awake?

idle owl
#

I ask myself that question.

solar whale
#

sleep is overrated 😉

stuck elbow
#

it is actually severely underrated

idle owl
#

I'm with @stuck elbow on that one.

solar whale
#

💤

tulip sleet
#

@stuck elbow "why are you awake?" who do you mean ?

#

Jerry and I are on Eastern time; it's 1017.

solar whale
#

The day is half over ....

old smelt
#

@solar whale - half over at ~10AM?

#

🙂

solar whale
#

My dog usually has me up at 5.... best part of the day!

manic glacierBOT
old smelt
#

Anything before 6:00am is yesterday.

main meteor
#

My heart doesn't even start beating until 9AM.

stuck elbow
#

@tulip sleet ahh, for some reason I thought you are in Seattle or Portland

tulip sleet
#

@stuck elbow no, I am near Boston. Scott is Seattle. But sometimes I stay up too late 🙂

stuck elbow
#

cool

#

well, we all do

#

I sometimes watch show and tell, for example

manic glacierBOT
stuck elbow
#

@tulip sleet by the way, I don't suppose you had any time to look at that audiocore buffer PR?

tulip sleet
#

i did look at it, but wanted to check with Scott about the backwards compatibility aspect.

#

no, wait, wrong PR, hold on

#

ah, ok, looks good, I'll approve and merge. was waiting for the doc addition and I missed the email that it arrived

manic glacierBOT
stuck elbow
#

@tulip sleet thanks, I forgot about it, that's why it took so long

manic glacierBOT
solar whale
#

I’ll be late if on at all for today’s meeting. If I miss it, have a good week!

idle owl
#

@solar whale Thanks for letting us know

minor plume
#

I updated the meeting notes doc, but I don't think I'll be able to join today. 😦 I have a ridiculous week of non-stop work meetings this week.

manic glacierBOT
idle owl
#

@minor plume Thanks for adding to the notes!

#

<@&356864093652516868> Meeting in ~10 minutes. Everyone is welcome! Here's the notes doc. Please add your hug reports and status updates even if you'll be present in the meeting, it's super helpful! Thanks! https://docs.google.com/document/d/16nsp4_ess3BlQQjJ75LQ1ImaGmmtdklNQmK_OJgWF2I/edit?usp=sharing

onyx hinge
#

oops sorry for the chewing sounds'

tidal kiln
#

** lurking** but group hug!

sterile bronze
#

lurking

slender iron
#

grabbing water and will be back

onyx hinge
#

we need a group video "show and tell your pet"

river quest
#

Hug report, @onyx hinge audio stuff with nrf...

onyx hinge
#

happy to

river quest
#

New feature: Bryan, Dan, and Melissa!

errant grail
#

<lurking today>

river quest
#

CircuitPython book!
https://twitter.com/AoyamaProd/status/1161419847781142529
"Limitless hue of the spectral color represents the infinite possibilities by multiplying the programmatic necessity by the creativity of the CPX users. I would be happy if my artwork visualizes the multiplicity of the possibility of CPX."

My CPX and CircuitPython book in Japanese will be out in 22-Sep in Tech book fest(@techbookfest).

Cover character; Chika IORI
Cover artist Ruri(@Teleid_dreaM)

技術書典7(9/22)でCircuitPythonの本を頒布いたします。
表紙のキャラクター: 一織 知佳...

#

Stickers all month:
https://www.adafruit.com/free

#

Circuit Playground Bluefruit - Bluetooth Low Energy, ahead of schedule!
https://www.adafruit.com/product/4333
https://youtu.be/FzYq9_8j-Bg
https://youtu.be/sS5JoHFpvw8

tidal kiln
#

face tat? dan - go for it!

idle owl
#

@fluid helm Are you lurking or do you plan to give hug reports and status updates?

fluid helm
#

Text today! I posted in the wrong channel 😬 @idle owl

idle owl
#

@fluid helm No worries! We'll read it off when we get to you. Feel free to post it early if you'd like.

stuck elbow
#

arghm @onyx hinge and @tulip sleet, not Scott, though of course I appreciate Scott's reviews too

fluid helm
#

My hug report this week goes to the team working on the Circuit Playground Express BLE version. It’s going to open up a whole new way to interact with the Circuit Playground and CircuitPython.

gilded cradle
#

too quick

slender iron
fluid helm
onyx hinge
#

swoons

pearl notch
stuck elbow
#

you have to run circuits around the library

fluid helm
#

This week I’ve been working on an offline version of EduBlocks as it’s been heavily requested by multiple people. For now, I’ve only got it working on Linux + Raspberry Pi & Hopefully Windows + Mac when I learn how to do installers for them. It’ll include offline support for CircuitPython so you can code your CircuitPython compatible devices in block format without having internet.

pearl notch
#

Awesome

fluid helm
#

No worries!

prime flower
#

It lets you do custom PNG backgrounds too

fluid helm
#

Oh handy! Many thanks

onyx hinge
#

thank you

fluid helm
#

Bye all!

#

thanks

idle owl
#

Dropping off.

slender iron
manic glacierBOT
slender iron
#

@onyx hinge did you update tinyusb in circuitpython without a PR>

exotic pumice
#

has anyone made circuitpython guitar pedals yet? is it possible?

#

I'm looking at arduino ones but I don't think the person I want to build it for could handle all the arduino setup

#

oh wait I forgot you can uf2 an arduino project

#

hmm

#

now to find out if electrosmash's pedalshield is compatible with a metro

slender iron
#

@onyx hinge nvm, I see 2067

manic glacierBOT
idle owl
#

@slender iron the displayio.release_displays() is to keep it from creating multiple instances of the same display..? I don't remember exactly what you said about why it needs to be included.

obsidian compass
#

Hi, I am facing a weird problem with CircuitPython 4.1 running on Metro M0 board . I've interfaced a rotary encoder and the sample code was running fine till a few minutes back and I was able to record change in position by printing current position on serial console. Now it's like hanging, missing values. Looks like it's continously spitting out values on console as I can see the tx led glowing solid. What could possibly be wrong here? - Checked the sensor and wiring, nothing wrong there!

#

This is happening ocassionally , seems like something else is going on in the background and I cannot register change in values during that instant

main meteor
#

@exotic pumice If there aren't CircuitPython pedals yet, there probably will be soon. SparkFun makes a handy pedal protoboard to hook up input, output, battery, and switch easily. https://www.sparkfun.com/products/13124

exotic pumice
#

I was looking at electrosmash's pedalshields but those are only for atmegas 😦

#

I might design my own at some point but no time soon

slender iron
#

@idle owl ya, it's because displays are NOT automatically reset like everything else

tulip sleet
#

@obsidian compass it uses interrupts, but if there are higher prio things going on, it may miss some, or if you are running out of RAM and it's garbage collecting a lot

manic glacierBOT
obsidian compass
#

thanks @tulip sleet , diggin deeper.

manic glacierBOT
onyx hinge
#

@exotic pumice seems like there may be a few missing pieces for doing real time audio manipulation in CP (you can't sample continuously from an audio source, for example, at least if PDMIn is any example), and the amount of calculation you can potentially do per sample would be very limited even if you could do it...

exotic pumice
#

alright

#

I just need uf2 more than I need circuitpython

onyx hinge
#

nod to that, uf2 bootloading is pretty sweet

exotic pumice
#

it really helps the nontechnical folks

#

I want a guitar pedal you can drag and drop new effects to

onyx hinge
#

I think I need a little tutorial on how to filter GitHub emails in Gmail so they don't go to my inbox

exotic pumice
#

lol

onyx hinge
manic glacierBOT
#

I've been playing around with the PyRuler as I received it as part of my order a week ago. Right from the beginning I have seen only the Dotstar as a magenta light. At no time have I seen this change when plugged in or when functioning. I did alter the code as recommended to enable the keyboard by setting it True. What also happens is that I don't get the correct characters for the ohm and pi touch pads, but I do get the mu, µ, character and the DigiKey url. For ohm I get Û, and for pi I get ...

#
  1. Can you verify the existence of the resistor and error if it's not attached?

Yes, it turns out I can detect that. I have a change to throw an exception and will push that later after resolving the discussion below.

  1. What happens when we add native touch support? Is it ok to leave the resistor on? Should we name this differently so it's clear that it's a separate implementation?

I tested on a SAMD21 with native touchio and it still works even with a 1M resistor.

I don't...

silver tapir
#

FIY, I've been working on my CircuitPython Braille for CircuitPlayground and it is now working well enough for anyone to learn how to type braille using a Playground express.

#

Thanks again to @tulip sleet who help and suggested ways of cleaning the code and how to debounce it.

#

Depending on the cpx switch it will either print to REPL (notice, mu-editor still prints weirdly with unicode) or work as an HID input device.

#

Any bugs, comments, PRs, all welcome.

pastel panther
#

heya @tulip sleet I was asked a few times which CPython version CP is closest to and wasn't sure beyond 3.X. Do you know?

stuck elbow
#

3.5

tulip sleet
#

3.4 is what MicroPython was trying to be compatible with

stuck elbow
#

ah, sorry

tulip sleet
#

i'll double-check

stuck elbow
#

they do have some features from 3.5

tulip sleet
#

right, and are thinking of adding more

stuck elbow
#

like the spaces for zero separator in number literals

pastel panther
#

Excellent, thanks guys

tulip sleet
crimson ferry
#

re: @obsidian compass 's question above... are there other core modules (e.g., gamepad, rotaryio) that interrupt and buffer their inputs (that could potentially be repurposed for other interrupt uses (e.g., maybe a PWM out could be routed to pulseio for counting time)? Also, is there a list of the priorities that supersede interrupts used in the core modules?

tulip sleet
#

@crimson ferry PulseIn is one

crimson ferry
#

Thanks. I'm wanting to simulate a timer-based interrupt. That looks promising.

tulip sleet
#

@obsidian compass if you continue to have trouble, could you file an issue at https://github.com/adafruit/circuitpython/issues and include your whole program? I looked at the interrupt handler, and there's not much that should go wrong or be non-interruptible with it, so I'd want to try it too.

manic glacierBOT
#

Update tinyusb to current tip of master. Current version is a PR commit but not the resulting merge. @hathach recently updated tinyusb from the develop branch.

In the latest version, lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c was merged with lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c, so a mentioned of hal_nrf5x.c was removed from ports/nrf/Makefile.

Tested on nRF52840, Metro M0, and Metro M4. CIRCUITPY and REPL work. HID keyboard tested on all three.

raven canopy
#

finally gets to in-the-weeds: before Dan mentioned it, i was thinking about pinning library versions to circuitpython. i wouldn't use separate branches though, from a maintenance nightmare standpoint.

maybe a living file in the library's repo that points to the latest release tags for each supported cirpy version.

the tricky part is how to do this in a non-manual way. best i can think of right now is having a version flag in PR notes. cumbersome however you approach it. bundling the versions in circuitpython-build-tools shouldn't be much of an issue, though.

slender iron
#

What do you all think about a 6.x branch that holds backwards compatibility breaks? Basically a holding area until master is 6.x

manic glacierBOT
raven canopy
#

pinyin...sooo close 😦

Build metro_m0_express for zh_Latn_pinyin took 18.74s and failed

-4 bytes free in flash out of 253696 bytes ( 247.75 kb ).

itsy m0 overshot by quite a few more though.

slender iron
#

haha, I've been there

#

is your git version dirty?

#

I think that'll add -dirty to the version that's stored in the bin

raven canopy
#

that's from my travis. not sure i'll get through the new 8 subjob build though; my fork is still stuck on .org...

slender iron
#

ah, bummer 🙂

meager fog
#

@umbral dagger hih

#

i just saw yr email

manic glacierBOT
umbral dagger
#

@meager fog Yup. All set for whatever you have in mind.

meager fog
#

ok so the pi4 is a red herring, you wont be using it

#

(yet)

#

ok @slender iron what does @umbral dagger need to do to get the bitmap capture PR good for mergin'

slender iron
#

I haven't looked at the newer commit (but will look now)

#

usually I only see if the author asks for another look

meager fog
#

np it was on friday

#

@umbral dagger is it ready for another look?

umbral dagger
#

@slender iron Ah. I'll keep that in mind.

#

Yeah. I addressed Scott's comment

slender iron
#

deshipu's should be addressed too. as is, it won't very that the object is actually an array

umbral dagger
#

@slender iron K. I'll dig into that tomorrow

slender iron
#

k thanks!

meager fog
#

@umbral dagger ok please do that and then tag scott/deshipu for review

slender iron
#

will add more comments tonight too

manic glacierBOT
meager fog
#

@umbral dagger ok tomorrow after you fix the PR i will give you the NEXT PROJECT

umbral dagger
#

@meager fog You really know how to slow roll these things

meager fog
#

i wanna get stuff complete before moving on, so we can build on successes 🙂

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I made some changes to the code as suggested by a post from saddacious in the Adafruit forms and now the characters for ohm, mu and pi display properly on my Mac. The characters still do not display properly for Windows 10 PC. Also the dotstar on the PyRuler remains magenta when plugged in to either the Windows 10 PC or my Mac. I also removed a few of the unused files that were originally installed as space is very tight once the code changes were made.

obsidian compass
#

@tulip sleet thanks alot for the info. I’m not facing the same issue anymore. Seems like when you print on serial console continuously (w/o delay) the RAM usage of mu-editor sky rockets which then in turn hangs the IDE and not the controller, So output was not displaying on the console even though the board was sending it out (verified using screen). Though I’m still not sure how the board was re-setting automatically after certain time yet? If I encounter that problem again, I’ll open an issue with steps to reproduce. For now it’s working fine. 😃

#

@crimson ferry I was using rotaryio, usb_midi, adafruit_midi

manic glacierBOT
#

I am now seeing very similar behavior to #2037 on my second PyRuler.
with no code.py program, on boot, the dotstar flashes magenta very rapidly. think the blue led is steadily on and the red is flashing so it looks magenta -- once in REPL it remains steady blue.
On the first PyRuler discussed above, the LED is steady magenta all the time.
Would you prefer to move the DotStart issues to a separate issue -- possibly re-open #2037 with a new name?

manic glacierBOT
lone sandalBOT
manic glacierBOT
umbral dagger
#

@slender iron OK, I pushed some changes. Let me know if that's what you were thinking. It seems to work, but there might be something off.. I'm going to test/push it harder.

umbral dagger
#

@slender iron OK.. after more testing, it seems to work fine.

slender iron
#

ok, thanks @umbral dagger will look in the next hour

#

@prime flower please always release as semver (x.x.x) no v

#

having a consistent version format makes it possible to automate checks

prime flower
#

@slender iron Ok, will remove the v. going fwd.

manic glacierBOT
#

OK, looking at this in more detail, the saturated builtins are only available on M4, not M0. There's a lot of stuff online about how to implement unsigned and signed saturated arithmetic. This is good (original web page is blank at the moment): https://webcache.googleusercontent.com/search?q=cache:bSrCZnMkEfkJ:https://locklessinc.com/articles/sat_arithmetic/+&cd=3&hl=en&ct=clnk&gl=us

There are a few example libraries in github but mostly in C++, unfortunately. The code here could maybe be ...

slender iron
#

@umbral dagger back to you. just one suggestion to remove the array object cast

umbral dagger
#

@slender iron OK. Testing that now

slender iron
#

thanks!

#

understand why I suggested it?

umbral dagger
#

@slender iron I was an assumption and should be more general?

#

@slender iron Also, just moved the mp_get_buffer_raise call earlier

idle owl
#

@tidal kiln Do you have a minute? I think you can help me with something.

tidal kiln
#

sure. what up?

idle owl
#

I'm writing a guide using displayio and associated things, and I am not sure how to describe this section of the code. python clock = label.Label(font, text=time_display) date = label.Label(font, text=date_display) text = label.Label(font, text=text_display)

#

I get what it's doing

#

but I don't know the correct terminology.

#

like creating an instance of label which needs the font and text to display?

#

Feels like picking random words.

tidal kiln
#

yep. that's pretty much it.

idle owl
#

oh.

#

Fair enough.

#

Thanks 😄

tidal kiln
#

imagine wanting those text labels at 3 different locations on the screen

#

so you need 3 separate labels

#

so you can set position for each

#

and show/hide also if you want

#

different fonts for each, etc

idle owl
#

Ah yah I did the different position thing for each of them

tidal kiln
#

are you getting that from an existing example?

idle owl
#

I wrote the example. It exists yes

#

Redoing the MicroPython OLED watch in CircuitPython using displayio

tidal kiln
#

there's probably a lot of that going on in the various PyPortal code in the Learn repo

#

if you want some other examples to look at

#

4 separate labels so position could be set

#

same here

idle owl
#

Examples weren't the issue, the code is already written, but I couldn't figure out good wording to describe it.

tidal kiln
#

creating an instance of label which needs the font and text to display

#

that seems fine

idle owl
#

right on, thanks

tidal kiln
#

the key being that it's only needed if you want separate text items

idle owl
#

Not sure that fits into this guide.

#

But now I know

tidal kiln
#

want to ping me when you have a draft page? i can take a look

idle owl
#

@tidal kiln Sure. It'll be on hold for a bit anyway because it's waiting on 5.x CP release and bundle creation. But I intend to finish the page today.

tidal kiln
#

sure np. when evs.

idle owl
#

thanks!

crimson ferry
#

@idle owl Are you covering what these really do? •displayio.release_displays()refresh_soon()wait_for_frame() 🙂 Maybe it's covered elsewhere, but they've baffled me (and many others I think) since the dawn of displayio

idle owl
#

I quickly explained release, but my code doesn't use the others so they're not covered in this guide.

tidal kiln
#

@crimson ferry i glossed over those in the displayio guide. always meant to cycle back and add info on those in. still intend to at some point.

crimson ferry
#

Sounds good, thanks, @tidal kiln !

tidal kiln
#

(i was confused too) 🙂

slender iron
#

@crimson ferry @tidal kiln refresh_soon and wait_for_frame are being removed in my next PR in favor of refresh

crimson ferry
#

What does it actually do? When to use it, and when not to?

slender iron
#

refresh will only be needed if you want to control when the display is refreshed

#
  • for tfts and oleds
#

epaperdisplays will require you to call refresh because they are only updateable every few minutes

crimson ferry
#

TFTs get refreshed on some interval if content changes, so refresh() would be an attempt to accelerate that?

slender iron
#

no, the interval is fixed by the init code

#

the trick is syncing your python code to the display

#

I'm adding auto_refresh which will work like it does now

#

which is every interval, update what has changed

#

that suffers from showing intermediate updates though

#

so if you want to control it yourself then you do auto_refresh = False and then call refresh yourself

crimson ferry
#

Ah, nice, that makes sense. Thanks!

tidal kiln
#

(sounds very much like auto_write in neopixel)

slender iron
#

ya similar

#

refresh has kwargs to track how you are doing keeping up with the screen refresh though

#

target_fps and minimum_fps

#

and if you call refresh too slow for your target it'll skip the real refresh

#

to try and catch up

#

is testing this today

tidal kiln
#

(sounds like a fancier auto_write) 🙂

slender iron
#

neopixels don't have a separate refresh clock to worry about 🙂

idle owl
tidal kiln
#

looking.....

manic glacierBOT
idle owl
#

The one time I want my code to fail pylint hard, and I get one error.

#

Ooh wait, I think I nailed it. It's cascade failing! 🎉

main meteor
#

Um, yay?

idle owl
#

😄 yay indeed

#

Writing a guide on using pylint. Needed a program to fail in a particular way.

manic glacierBOT
lone sandalBOT
meager fog
#

@umbral dagger hiya how is that PR going

#

is it ready for review?

umbral dagger
#

Yeah, I was waiting on Scott's final feedback.

meager fog
#

@umbral dagger did you tag him in the github PR

#

so he knows to look at it?

umbral dagger
#

Like that?

#

He's in the reviewer list.

meager fog
#

@umbral dagger better if you say something like "@slender iron this is ready for another review"

umbral dagger
#

Gotcha

meager fog
#

its good to be explicit, people can't read your mind - they dont know if you have more pushes coming or not

umbral dagger
#

nods

meager fog
#

scott and i are 'reviewers' on approx 40 PR's at any time

slender iron
#

ya, I don't get emails without a message of some sort

meager fog
#

think about how to make reviewer's lives easy so they'll be excited to review 😉

slender iron
#

I'll take a look tomorrow. in epaper land now

exotic pumice
#

just saw that epaper photo on twitter. looks great

manic glacierBOT
prime flower
#

Seems dict sort order appears to be "off" in circuitpython 4.1, or I'm incorrect about how dicts are ordered.

exotic pumice
#

dict ordering is random

prime flower
#

I guess I could use an ordered dict, but I wonder why it stays in the same order in CPython?

tulip sleet
#

CPython dicts were naturally ordered kinda by accidnet, and now they've decided to make that a feature

exotic pumice
#

I'd call it undefined behaviour

tulip sleet
#

MicroPython is not adopting this, at least for now

prime flower
#

Huh, interesting...

exotic pumice
#

implementation detail = UB imo

tulip sleet
#

they are insertion ordered (not sorted) in CPython

#

now official feature in 3.7

exotic pumice
#

it's not a bug it's a feature

manic glacierBOT
#

The only M0 builds that include this are express boards with audiocore turned on (via audioio).

As of now, there are 5 build failures; all 5 only fail the Pinyin translated versions. I used a Feather M0 Express during dev/testing. The en_US build currently has 4168 bytes free in flash (in my env).

If not including MixerVoice on M0 is really how we want to proceed, it will require maintaining the current Mixer only code for M0, and the Mixer+MixerVoice for the M4 (using `#if...

manic glacierBOT
slender iron
#

sorry for the emails circuitpython librarians

exotic pumice
#

I'm not a circuitpython librarian but I'm having fun checking out all the cool sensors you're forking 🙂

#

especially that fm transmitter looks cool

manic glacierBOT
errant grail
#

Need some help, please: What's the default I2C clock speed for adafruit_bus_device.i2c_device? According to the documentation, it isn't called out as a settable option. Couldn't find anything in the bus_device code in the repo either. Is there a way to confirm the clock speed that the library uses?

exotic pumice
#

my guess would be 400KHz

#

measure scl with a logic analyzer?

errant grail
#

Excellent suggestion. I'll grab my o'scope.

#

It's 300kHz on the M4 Express. Thanks for the suggestion and quick response, @exotic pumice

exotic pumice
#

yw

indigo wedge
#

If anyone from here is at CCCamp right now, I have 4 Blinka stickers I can give away, one per person 🙂

tulip sleet
manic glacierBOT
errant grail
#

@tulip sleet Thanks. bus_device inherits it from busio's default. Should have known that. Is there a reason that the UI for bus_device.I2CDevice doesn't allow setting it similar to bus_device.SPIDevice's baud rate parameter?

tulip sleet
#

@errant grail the I2C frequency cannot be changed after the busio.I2C object is created, unlike SPI. For SPI, there's a configure() call that can change it at any time.

#

So if you just create an I2C object at the right frequency and pass it to bus device, that would do it

errant grail
#

Super! Thank you for the explanation. I wanted to test different devices on the bus that may have clock sensitivity and still use bus_device's abstracted management scheme.

tulip sleet
#

as to why you can't change the I2C frequency later, it may have to do with the HAL libraries we're using not providing that, or something like that

errant grail
#

Ah. I'm trying to imagine a scenario where I might need to dynamically adjust the clock speed except for testing.

#

adjusting for cable length/interference? that's a stretch.😏

manic glacierBOT
crimson ferry
#

@river quest Not sure best place for this, but... Wondering if you've had any success updating a UF2 in iOS 13 using a lightning-to-USB adapter?

#

With Trinket M0, iPhone XS (iOS 13 latest public beta), and the standard Camera Adapter (MD821AM/A), I get a "Cannot Use Accessory: Trinket M0: This accessory requires too much power" as TRINKETBOOT even though CIRCUITPY behaves nicely. Could be some difference in CP?

#

With powered USB 3 Camera Adapter (mk0w2am/a), I first get "The Operation Can't Be Completed. The file "adafruit-circuitpython-trinket_m0-en_US-4.1.0.uf2" couldn't be opened. Trying to look at TRINKETBOOT contents again yields "Content Unavailable: The folder could not be displayed because the connection to the server timed out. Try Again" and Try Again then works. But thereafter TRINKETBOOT is grayed out and can't be selected for a Move to Folder.

meager fog
#

haven't tried it yet

#

but....yeah thats a good thing to try! did you get it working with CP code.py editing?

crimson ferry
#

Yeah, that's working great!

marble hornet
#

It’s so cool to open up cirpy code on an iPad and have it run!

meager fog
#

@crimson ferry ok we'll look at UF2s next...no idea yet

meager fog
#

@umbral dagger hiya your PR doesnt pass travis

#

so it cannot be reviewed

manic glacierBOT
umbral dagger
#

@meager fog have no idea what to do about the out of flash failure on itsybitsy_m0_express for zh_Latn_pinyin

meager fog
#

right, scott will fix that

#

right now its not getting past test

#

start with the first set of errors at the top

umbral dagger
#

What I just pushed should fix that

meager fog
#

ok!

slender iron
#

I snag the commands travis is running to test locally

meager fog
#

(make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; S=$? ; echo $S > status ; (exit $S)

slender iron
#

ya, this bit make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2

#

I canceled the job to save cycles

umbral dagger
#

OK, this should do it

#

Related to previous PR

#

@slender iron OK.. I ran make translate and pushed again.

slender iron
#

👍 looking at the itsy m0 build now

slender iron
#

@umbral dagger to make room in the itsy m0 let's turn i2cslave and rtc off: ```

CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_RTC = 0

umbral dagger
#

OK, added and pushed

slender iron
#

👍

#

looks like the translations need a merge

umbral dagger
#

OK.. that might/should do it

slender iron
#

@umbral dagger boards aren't building because the objarray.h include is gone

umbral dagger
#

Ah.. I stripped it down too far

slender iron
#

and my suggested change hasn't been done

umbral dagger
#

which?

umbral dagger
#

I hadn't caught that

slender iron
#

you shouldn't need the array cast at all then actually

#

since you can get all of the info out of bufinfo

umbral dagger
#

ok... once more

idle owl
#

Welcome @crimson ferry to the CircuitPythonistas!

onyx hinge
#

👋 @crimson ferry

gilded cradle
#

Welcome @crimson ferry!

crimson ferry
#

👋 hi everyone, thanks. I'll put this out there too... I'm always happy to test bugs and builds (especially esp32 & displays), have a reasonable inventory. Just ping me and I can usually reply pretty quickly.

tidal kiln
#

is it because Adafruit_CircuitPython_BLE is a "pre-release" that not all the files are getting in the bundle?

tulip sleet
#

@tidal kiln the pre-release libraries don't get put in the bundle; you have to get them manually. We put in a check for library version numbers that have a - in them, and ignore those

#

the last release that is not a pre-release is going in the bundle

#

it's compatible with 4.x

tidal kiln
#

ok. i'll grab manually. thanks. just wanted to make sure something wasn't broken.

umbral dagger
#

@slender iron OK, all passed that time

marble hornet
#

anyone have a mo to help me fix adding a module to cp?
i have made folders and init.c and init.h in shared-module and shared-bindings for a module called capsule.
In circuitpy_mpconfig.h, I added "CAPSULE_MODULE" to MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS and tried adding a #if micropy_py_XXX but i'm seem to not be adding the #if correctly. here the the error: ```QSTR updated
In file included from ../../py/objmodule.h:29:0,
from ../../py/objmodule.c:31:
../../py/circuitpy_mpconfig.h:555:68: error: 'mp_module_capsule' undeclared here (not in a function); did you mean 'mp_module_machine'?
#define CAPSULE_MODULE { MP_ROM_QSTR(MP_QSTR_capsule), MP_ROM_PTR(&mp_module_capsule) },
^
../../py/obj.h:246:24: note: in definition of macro 'MP_ROM_PTR'
#define MP_ROM_PTR(p) (p)
^

#

i have just also tried just #define CAPSULE_MODULE { MP_ROM_QSTR(MP_QSTR_capsule), MP_ROM_PTR(&mp_module_capsule) }, in the #if section

onyx hinge
#

@marble hornet is this affecting a bord which DOES have "capsule" or which DOESN'T?

marble hornet
#

@onyx hinge what do you mean? i have not added a #define to the board, rather directly above it in mpconfig.h

#

since i;m only compiling for one board rn

onyx hinge
#

Looks like usually next to the #define for the module is an extern declaration for the related symbol, like ```#if CIRCUITPY_UHEAP
extern const struct _mp_obj_module_t uheap_module;
#define UHEAP_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module },
#else
#define UHEAP_MODULE
#endif

marble hornet
#

i'll give it a shot

marble hornet
#

@onyx hinge so i tried it, and moved CIRCUITPY_CAPSULE = 1 into the board's .mk and am now getting a bunch of: ```
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-itsybitsy_m4_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
GEN build-itsybitsy_m4_express/genhdr/moduledefs.h
In file included from ./mpconfigport.h:79:0,
from ../../py/mpconfig.h:45,
from ../../py/emitnx64.c:3:
../../py/circuitpy_mpconfig.h:554:5: error: "CIRCUITPY_CAPSULE" is not defined, evaluates to 0 [-Werror=undef]
#if CIRCUITPY_CAPSULE
^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
In file included from ./mpconfigport.h:79:0,
from ../../py/mpconfig.h:45,
from ../../py/emitnx86.c:3:
../../py/circuitpy_mpconfig.h:554:5: error: "CIRCUITPY_CAPSULE" is not defined, evaluates to 0 [-Werror=undef]
#if CIRCUITPY_CAPSULE
^~~~~~~~~~~~~~~~~

i think i am not declaring  CIRCUITPY_CAPSULE properly?
#
extern const struct _mp_obj_module_t capsule_module;
#define CAPSULE_MODULE          { MP_OBJ_NEW_QSTR(MP_QSTR_capsule),(mp_obj_t)&capsule_module },
#else
#define CAPSULE_MODULE
#endif```
onyx hinge
#

@marble hornet There are a surprising number of things you have to do to make a new module work, and if you miss one it just won't work. 6b44e40ee8dba415213468afe14f7202b42ec429 is a recent commit which does add a whole new module, it might be helpful to refer to

#

for this current error my first guess is that a block in py/circuitpy_mpconfig.mk is missing. In this case, audiocore is a bad example, and I'd follow bleio: ``` ifndef CIRCUITPY_BLEIO
CIRCUITPY_BLEIO = 0
endif
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)

#

this turns the define in the board's mk into a C preprocessor macro that expands to either 0 or 1, but zero by default

marble hornet
#

thank you, i'll go over the commit

onyx hinge
#

Do we envision that CPB support will live in the same adafruit_circuitplayground package? New sub-module bluefruit? Hopefully sharing as much content as possible with the existing adafruit_circuitpython.express?

#

.. is there a start on this even?

#

[itching to have time to actually play with CPB, but not before the weekend!]

manic glacierBOT
onyx hinge
#

'night!

marble hornet
#

night! thank you it's compiling (even if not importable )

manic glacierBOT
manic glacierBOT
subtle sun
#

Hi @tulip sleet
Regarding PR 2083
I am interested to understand why you prefer this style? Do you think it is clearer?
I did look through the compiled assembly during my PR and saw that the inline function is optimized away, so I don't think this change effects the binary in any way.
One way or another I think that the code in the SAMD port which handles the clock source should be using the same style as the Nrf (whichever style is chosen).

manic glacierBOT
slender iron
#

@stuck elbow when you have a chance check out my epd branch. I just got celeste going on the pybadge with the new refresh api and it's awesome

#

after you load all the assets do display.auto_refresh = False and then display.refresh(target_frames_per_second=30)

#

should be able to get it PRed tomorrow

stuck elbow
#

@slender iron roger

indigo wedge
#

Circuitpython gang, represent!

onyx hinge
marble hornet
#

okay, so i have added the new module but the example in extending circuitpython only has adding classes and i have been unable to get a function in the shared module init.c to link to the module's globals.
the function:

    return 7;
}```
and the adding into user facing code:
```STATIC const mp_rom_map_elem_t capsule_module_globals_table[] = {
    { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_capsule) },
    { MP_ROM_QSTR(MP_QSTR_load), MP_ROM_QSTR(MP_QSTR_load) }
};

STATIC MP_DEFINE_CONST_DICT(capsule_module_globals, capsule_module_globals_table);

const mp_obj_module_t capsule_module = {
    .base = { &mp_type_module },
    .globals = (mp_obj_dict_t*)&capsule_module_globals
};
#

i have also tried capsule_load in the rom_map_elem_t

#

rn, in python, s variable will show up but it only links to a string

#

how would one tell it to use a specific funtion

manic glacierBOT
tulip sleet
#

@subtle sun It will be optimized away, but I'd prefer the #if so it's clear it's a compile-time option. I can change the atmel-samd check too. In general we try to use the preprocessor flags directly rather than make an inline that is optimized away.

#

i wanted to put you as a reviewer but was unable to, so I just tagged you.

#

I changed the name of the flag to specify which crystal. on the Circuit Playground Bluefruit, there is a visible onboard crystal, but it's the 32MHz crystal. Usually that crystal is hidden inside the '840 module

#

i am sorry I didn't pay attention to the PR when it first came out, since it would have saved a couple of hours of debugging :). i thought it was for something else, for some reason.

#

also we try to use #if rather than #ifdef checking now to catch missing preprocessor definitions. Unfortunately in the nrf port turning on a warning for that causes fatal warnings in the nrfx library

#

... looking at the atmel-samd port, I see you copied that style. That's in a separate samd-peripherals repo, so I won't try to clean that up now -- it's a bit involved

#

thank you for your work on this

marble hornet
#

and @onyx hinge thank you again for your help last night, it got me so much closer

subtle sun
#

@tulip sleet no problem. It was more of a general question for future work I am planning to upstream.

tulip sleet
#

we appreciate your contributions!

onyx hinge
#

@marble hornet happy to hear it

#

@marble hornet I won't be around much today to help with your problem including functions, 😕

#

If I had to guess, maybe you are missing the part where you declare/define the "function object", or else you're missing an accompanying extern declaration.

#

Here's a C function followed by the definition of its related function object: STATIC mp_obj_t time_monotonic(void) { uint64_t time64 = common_hal_time_monotonic(); // 4294967296 = 2^32 return mp_obj_new_float(((uint32_t) (time64 >> 32) * 4294967296.0f + (uint32_t) (time64 & 0xffffffff)) / 1000.0f); } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);

#

then way down below, time_monotonic_obj is in the globals: STATIC const mp_rom_map_elem_t time_module_globals_table[] = {... { MP_ROM_QSTR(MP_QSTR_monotonic), MP_ROM_PTR(&time_monotonic_obj) },... };

#

as far as creating the proper declaration, in case the MP_DEFINE and the module globals have to be in different source files, it looks like there are macros like MP_DECLARE_CONST_FUN_OBJ_0

#

0 of course means the function takes no arguments

#

there are also variants for 1/2/3/variable/keywords arguments

lone sandalBOT
slender iron
#

@subtle sun I added you as a collaborator so you can review changes. also added you to circuitpythonistas

tulip sleet
#

@slender iron I'll merge the CPBlue clock fix unless you want to review it also

slender iron
#

nope, other reviewers are enough 🙂

manic glacierBOT
slender iron
#

interesting to see all of the hal/freertos files brought in

marble hornet
#

@slender iron if an entire module can be made in the shared bindings what part of it should i put in the shared modules?

tulip sleet
#

the part that does the work, see for example bitbangio

subtle sun
#

@slender iron Thanks

slender iron
#

@marble hornet another way to put it is that shared-bindings should only do argument validation and conversion to C

manic glacierBOT
solar whale
#

Other than for support of WPA Enterprise, is there any reason to upgrade the ESP32NINA Firmware on the various boards? that is, if WPA Enterprise is not needed, is there any reason to upgrade from the delivered NINA v1.2? Does 1.3 add anything other than WPA Enterprise?

manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron re all write_from_read_info PR's. I missed some of the discussion last night. Are we going to test all of these on hardware? I remember hearing about using kattni's stock of everything, though I have some of these too. And we should test a newer library that uses adafruit_register with its changes as well.

As for the ePapers, do you want someone to test those too? Not sure if who has what. I have none.

#

but i also have ble hid to work on, which would take higher prio maybe than hw testing

slender iron
#

I think kattni will do the stop= testing and hopefully @gilded cradle is game for helping with ePaper. I've tested all the ePaper's myself too

#

I'm thinking I'll add clang-format actions to github ci too

tulip sleet
#

@slender iron if you can get it working now in a basic way and PR that (before adding clang-format), that would be great. If you do a test clang-format it would be interesting to know how much churn that is. We'd only want to do shared-bindings/ shared-module/, and our ports, I assume

slender iron
#

I'd do it all. we'd just need to run it over micropython before we merge it in

#

and ya, I'll do them separately

#

but I'm seeing too many folks care about formatting

tulip sleet
#

does it do stuff like adding brackets on single statement if-then's?

slender iron
#

I think it's time to set it up. should hopefully be able to have it auto-format PRs after a review

#

ya, think so

idle owl
#

(╯°□°)╯︵ ┻━┻

#

Pylint 1.9.2 requires Python 3.6.x to work. And "downgrading" Python is straight up black magic.

#

Have to redo all my screenshots because the output differs ever so slightly, and I didn't notice. Managed to get it working at least but now I have to document the Python requirement.

#

At least I was told to assume people using this guide can handle their own Python installs. But even I had to have help to get it going right.

gilded cradle
#

@slender iron, sure I can help. I think I have have most of the eInks (no Pimoroni ones though).

idle owl
#

@slender iron @tulip sleet Yep, the stop= testing is up after this guide is finished.

prime flower
#

@solar whale Nope, it adds enterprise. Eventually we'll expose more functions from there as-needed, though. (I just exposed it's getTime a few minutes ago)

solar whale
#

@prime flower Thanks for confirming. It's kind of a pain to upgrade - especially on some of the new newer boards so I was hoping to not have to bother. I don't need Enterprise at this point. Nice to see all the new support in ESP32SPI and other libs.. Great work!

prime flower
#

@solar whale How are you upgrading?

#

ESPTool + Arduino Passthru? or miniesptool

solar whale
#

Ive used both -- passthru when I can --

tulip sleet
prime flower
#

@solar whale I recommend using the arduino passthrough sketch and ESPTool, it's much faster and less of a pain

#

also more reliable for reading chip info ive found

solar whale
#

I have not looked at it lately - do you need to jumper any of the pins on an airlift featherwing to use the passthru? can you use passthru for the featherwing?

prime flower
#

🙂

solar whale
#

do you need to jumper gpio0 to use the passthru for the featherwing?

prime flower
#

@solar whale they're connected on the Metro M4, but the FeatherWing has pins which need soldering

solar whale
#

just gpio0 thought for passthrough, right -- don't need rx/tx do you?

prime flower
#

You need all three

solar whale
#

ah -- ok -- good to know 😉

prime flower
#

uses uart iirc

#

esptool, not the passthru

solar whale
#

I was just looking at the .ino and did not see uart pins being used.

prime flower
#

I'm referring to esptool.py

#

You don't need to decl. the RX/TX pins from the ino

solar whale
#

OK -- I need to go back and review- been too long.... I'll try when I get a chance.

#

cobwebs grow too fast 🕷

onyx hinge
#

If I wanted to make a jig to connect the swd pads of a circuitplayground with pogo pins, which style of pin do I want? "needle head"? https://www.adafruit.com/product/2430 also, I haven't looked yet -- are they at the same locations on CPX and CPB?

tulip sleet
crimson ferry
idle owl
#

@slender iron Did you fork everything for those PRs? Trying to figure out what Git fu I need to dust off to test this stuff.

manic glacierBOT
onyx hinge
#

@tulip sleet thanks for the pointers. not sure how soon I'll get motivated, but I feel like making a pogo pin rig is something I should do someday

tulip sleet
#

If i am debugging, I usually just solder three header pins onto the pads, tipped back a bit, or jumpers. It makes the bottom of the board lumpy but it's not terrible

onyx hinge
#

I'd be lucky to do half as well

tulip sleet
#

put some solder on a pad, hold it with needlenose, tack it, adjust position, then tack the others

gilded cradle
#

@slender iron, for the eInks, does it require me to build CP5 or should they work with 4.1.0?

slender iron
#

@gilded cradle you'll need the PR I hope to make today

#

just rebasing it now

gilded cradle
#

Ok, I'll wait then

slender iron
#

@idle owl I worked within the bundle actually

idle owl
#

oh hmm

#

The PRs make it look like you forked them. At least the two I checked.

slender iron
#

@onyx hinge @tulip sleet I was considering making an oshpark flex pcb to hold an swd connector

#

@idle owl oh, ya I did. but I didn't clone them individually. I just add my fork as a remote within the bundle's submodule

idle owl
#

For testing bus_device do I need to load one of the updated libraries or will it work with a current lib? I'm a little confused on testing that one. I understand the updated bus_device is necessary for the updates libs, but is the opposite true?

slender iron
#

ideally bus device should work with existing libs

idle owl
#

Ok

tulip sleet
#

hub clone adafruit/circuitpython instead of git clone https://github.com/adafruit/circuitpython and similar for hub remote add ,etc.

#

saves brain cycles

slender iron
#

the only things that the bus device will break are uses of write_then_readinto that don't set stop

idle owl
#

Ok. Then I'll test it with a project currently hooked up and if it runs, merge it.

slender iron
#

@tulip sleet hub fetch tannewt within the bundle's libs was handy

idle owl
#

Then start on the libs.

slender iron
#

heh

idle owl
#

@slender iron Since that's an API breaker, it's a whole version number right?

#

on bus_device

slender iron
#

yes please

idle owl
#

Released.

slender iron
#

fram and lidarlite are the ones to test

prime flower
idle owl
#

@slender iron FRAM and LidarLite?

#

I don't have the hardware for the latter.

#

I'll ping Limor see if she wants me to order it or have someone else test it.

slender iron
#

ya, notice in the gist that they don't provide a stop argument

#

I don't either

tidal kiln
#

@idle owl curious what (if any) is game plan for all the i2c related PR's? need help?

idle owl
#

@tidal kiln YES. Yes I do need help. Plan was to get bus_device merged first and then start down the list. There are a few discontinued ones that I might be the only one with, so I'd do those, but help would be incredibly appreciated.

tidal kiln
#

looks like that was just done...like 35 minutes ago..

idle owl
#

Yes.

#

It was necessary for the outstanding PRs

raven canopy
idle owl
#

@tidal kiln So basically, grab the new bus_device and test whatever you can is the plan. I think we should comment on the PR if we're starting to test it so we're not doubling up work, and then approve as applicable etc.

#

@raven canopy Couldn't do venv, wasn't using it in the guide. 😕

#

Otherwise yes, a thousand times, yes.

raven canopy
#

not venv though. pyenv lets you install and manage multiple versions of Python.

idle owl
#

Ohhhhhh

#

Duly noted.

#

WHERE WERE YOU A FEW HOURS AGO.

raven canopy
#

at work? 😉

idle owl
#

Unacceptable.

raven canopy
#

they might disagree. hehe

tidal kiln
#

@idle owl good idea - commenting in PR before starting testing, will do that...i'll do what i can..i currently have an ADS1115 setup, so can check that, etc.

idle owl
#

Thank you very much.

tidal kiln
#

get that all purple

#

@idle owl also do a version/bump release if merged?

idle owl
#

Yes please.

#

@tidal kiln I'm going to comment on that issue on the plan, comment on a PR if you're testing it, and then follow through with merging/bumping etc

manic glacierBOT
#

We're looking for any assistance in testing all of the outstanding library PRs associated with this issue!

If you have any of these sensors and would like to help out, please grab something like a Feather M4 Express and do the following:

  1. Update to the latest Adafruit CircuitPython BusDevice release (4.0.0, released 22 August 2019)
  2. Find the PR for the sensor you'd like to test.
  3. Comment on the PR that you are going to test the PR. (This will avoid any duplicate work!)
  4. Test...
tidal kiln
#

@idle owl want to add some suggested boiler plate for release?
tag version = patch++
release title = I2C Update
description = Update for removal of stop kwarg. (more info)

lone sandalBOT
waxen loom
#

anyone have the link to the firmware for the new bluefruit?

waxen loom
#

ahh nice

marble hornet
#

okay: so i'm trying to have a fun_0 return a string (see below) but I am getting a ../../shared-bindings/capsule/__init__.c:25:12: error: incompatible types when returning type 'mp_obj_str_t {aka struct _mp_obj_str_t}' but 'mp_obj_t {aka void *}' was expected return capsule_msg; ^~~~~~~~~~~
error message when i use the below code

MP_DEFINE_STR_OBJ(capsule_msg, "It's not pining");

STATIC mp_obj_t capsule_unload(void) {
   return capsule_msg;
}

MP_DEFINE_CONST_FUN_OBJ_0(capsule_unload_obj, capsule_unload);```
but if i change the return type of `capsule_unload` to `mp_obj_str_t` i get a different error saying it is an incompatible  pointer type for MP_DEFINE_CONST_FUN_OBJ_0.
```In file included from ../../shared-bindings/capsule/__init__.c:3:0:
../../shared-bindings/capsule/__init__.c:30:47: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
MP_DEFINE_CONST_FUN_OBJ_0(capsule_unload_obj, capsule_unload);
                                              ^```
I have to assume this is a common issue. but i tried googling the answer i  didn;t find an answer i could apply to this situation
#

if you have to return a var of the type specified at the top of he function but you need to use a mp_obj_t for functions then how can you return a string or not mp_obj_t?

exotic pumice
#

maybe casting

#

mp_obj_t means void * which basically means any type

#

as I understand it

manic glacierBOT
#

Hmmm. The latest version of RPi.GPIO (0.7.0) claims to be updated for Pi4B. What's really annoying is that the bug appears to be in the Cython binary. So it's probably not your fault at all, but I can't fix it. You're requiring this other library RPi.GPIO and it's failing. I'm a developer and happy to help.

eh@pi4 ~/eyelert $ python3 leds.py
Traceback (most recent call last):
File "leds.py", line 29, in <module>
pixel_order=ORDER)
File "/usr/local/lib/python3.7/dist-packages/...

marble hornet
#

@exotic pumice i gave it a shot but c didn't like it. would it be better describe what i'm trying to do instead of how i'm trying to do it?

exotic pumice
#

maybe

#

though I've never seen C complain about a cast

#

return (mp_obj_t) capsule_msgor somesuch

main meteor
#

It doesn't make a lot of sense to cast a string to a function pointer, so I can imagine the compiler giving you grief about it.

exotic pumice
#

it's a void pointer not a function pointer

#

and C doesn't really give a crap about most things

main meteor
#

If it's a void pointer, you should be able to cast things to it.

#

However, "didn't like it" doesn't tell us much.

marble hornet
#

Apologies that I didn’t add in the message.
I am trying to make a module that will save a string between reloads

C.load(“it’s not pining”)```
And after a reload:
```import capsule as c
C.unload()#it’s not pining```
#

*typing on iPad: odd caps

#

my though is to make a char array of the length of the string and store the raw bytes in it then free in on the next load

#

granted the above code will not do that

exotic pumice
#

have you thought of using microcontroller.nvm?

manic glacierBOT
#

This PR reworks the display refresh mechanics by replacing wait_for_refresh and refresh_soon with refresh. refresh is required for ePaper and not required for regular displays when auto_refresh is True. auto_refresh can be set during execution to prevent intermediate screen updates. This fixes #1691. 4.x code that calls wait_for_refresh and refresh_soon can have it removed for nearly identical behavior. (wait_for_refresh may have caused a slight delay that could be replaced ...

lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

I'm not sure what "the current frame rate is below the minimum frame rate" means? Is this a validation check, or is it dynamic (things are going too slow between calls to refresh)? If the latter, then any call to refresh() could potentially throw an exception, which in many cases one would just want to catch and ignore (especially when debugging or when not an experienced programmer). Maybe better to return a status value (like the boolean refreshed/not refreshed, or a tri-state value: refr...

marble hornet
#

@sajattack#7799 yes. My reasons for not using it is that it will have a limited number of write cycles and it won't be blank on boot up

solar whale
#

@tulip sleet just got the ble_periph demo runnig on my CPB -- woohoo! -- central on a pca10059

tulip sleet
#

:ble: woot!

#

i got BLE Keyboard sorta working on Android last night, working on iOS

solar whale
#

I have both android and IOS devices so I'll be happy to try to break it whenver you want 😉

#

but now time for some yard work ....

idle owl
#

@solar whale Thank you for taking care of those PRs!