#circuitpython-dev

1 messages ยท Page 172 of 1

slender iron
#

I hadn't read that

raven canopy
#

I briefly did, when I noticed the register in Atmel Studio. Didn't even see it in the sheet before that ๐Ÿ˜„

#

I'm going to be out-of-pocket starting in a little while, and all day tomorrow. I'm shooting to have the PR in on Saturday. I was really hoping to go full on TC capture with the M4, but it just won't give up the ghost. ๐Ÿ˜ฆ

slender iron
#

did you try my suggestion yet?

raven canopy
#

i haven't. i can give it a go Saturday morning/this weekend. so I understand fully, you're suggesting a stripped down PulseIn, yes?

#

instead of counting the width, just count the rises?

#

i also need to stop saying "tempted to DMA", and actually try it. ๐Ÿ˜„

slender iron
#

not exactly because pulsein uses an interrupt every edge

#

I'm suggesting using the TC to count pulses

#

(TC.EVACT = COUNT)

raven canopy
#

so use the COUNT, instead of it's internal... yeah.

slender iron
#

then you set the compare channel to the number of pulses you want to average over to generate the interrupt

#

essentially dividing down the input signal

raven canopy
#

hmm. i'll have to re-read to see how to interface the incoming edges with COUNT. I was under the impression that compare was only an out operation. it is totally possible my comprehension is off/biased. ๐Ÿ˜†

slender iron
#

I'm being confusing. its match I think

#

or overflow

raven canopy
#

yeah, the overflow i still need to figure out how to deal with anyway. on capture, it can be used "calibrate" in the case of the captures happening after the count passes MAX. it'll be similar to how PulseIn handles the SysTick reload, I think. still have the goal of keeping overhead at a minimum to ensure the highest possible capture capacity without locking into an endless loop.

slender iron
#

right, thats why I think dividing down is the way to go

raven canopy
#

i can definitely attempt it. alright i'm off. lunch and the punishment of golf awaits us... ๐Ÿ˜„ ๐Ÿ‘‹

slender iron
#

byeee!

manic glacierBOT
manic glacierBOT
errant grail
idle owl
#

Sniffing MIDI data?

errant grail
#

Yes. The version that sends output to the REPL or terminal window works nicely, but the OLED wing version occasionally blocks incoming data.

idle owl
#

Interesting. That's super neat though!

errant grail
#

Needed it to learn more about the MIDI protocol stack. I now know enough to be musically dangerous.

idle owl
#

An excellent thing to be

slender iron
#

PSA: The SAMD51 datasheet was updated last month. Make sure you are using it.

idle owl
#

@tulip sleet Thank you

manic glacierBOT
tulip sleet
#

@slender iron - they didn't change the dates on the datasheet page ๐Ÿ˜  Errata is also updated. (I submitted a website bug report.)

tulip sleet
#

@slender iron do you have time for a quick consult before the mtg? could be in mtg video or discord. re event system

manic glacierBOT
#

Yep, i was just joining things up in case there was some link between this and my issue.

My main problem turned out to be me not respecting the tinyLiDAR's wish (requirement!) for a pause between i2c commands, read/write/pause in a loop works ok. I think I got surprised by this because it seems to go non-recoverable rather than failing a few times plus I'm confused because I had tried some pauses before...

Speculating, there's a minor possibility this would have worked or been easier to...

slender iron
#

@tulip sleet sorry, was prepping for the meeting

raven canopy
#

@slender iron @tulip sleet thanks for the heads up on updated sheet. I may get a chance to peek at it tonight..

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
ruby lake
#

@errant grail I find the i2c OLED to be a bit slow when used with midi data. I'll have to try an SPI type. In my v1 module playground I use the toggle switch to turn off certain things like A/D and oled writes when faster midi actions are needed.

stuck elbow
#

@ruby lake try to explicitly set the i2c speed to 400kHz

#

I think it defaults to 100

ruby lake
#

I'll have a look this afternoon

marble hornet
#

help needed with uploading to atsamd51. hey all, a few days ago i tried to install gdb, recommended by tannewt, so i can burn files to atsadm51 s. but i have not been able to figure out how. it seems like a good uploader. i am on a mac running 10.13.4 im fine with any program that will work to upload to atsamd21, 51, other common controllers. but i have been unable to get it to install. any and all help is appreciated

errant grail
#

@ruby lake I tested the TFT FeatherWing yesterday. It's much, much slower than the OLED in spite of its SPI interface. I believe that it's mostly due to the font bitmap to pixel routines that are coded in Python (and use the underlying vector graphics engine) and perhaps the framebuffer foundation. @slender iron suggested that improvements may be considered as the leeked game controller wing takes shape. Thanks for the idea of switching off the display during time-critical functions!

#

@stuck elbow Appreciate the I2C clock speed default suggestion for the OLED. I'll give it a try.

marble hornet
#

could you help @slender iron ? i used the JLink_MacOSX.pkg but it only installed the drivers. i think

slender iron
#

its the same process for the 51, you just change the device id

manic glacierBOT
marble hornet
#

@slender iron no i did not! thanks

slender iron
#

np ๐Ÿ˜ƒ

stuck elbow
slender iron
#

<@&356864093652516868> anyone around to voice chat about error messages?

idle owl
#

Sure

manic glacierBOT
prime flower
#

@slender iron Sure, if channel is still going on this topic?

slender iron
#

ya

simple pulsar
#

hello

slender iron
idle owl
#

Hello @simple pulsar

simple pulsar
#

I have a quick question re: instructables.com - is there a preferred category for Adafruit / CircuitPython?

idle owl
#

I have no idea, I haven't dealt with instructables. Are you writing one up and wanted to know how to categorise it?

simple pulsar
#

Yes, i published one earlier. It has things like Arduino and Raspberry Pi. I ended up choosing Microcontrollers. I'd imagine not everything warrants a category but was just curious if this was something that had been discussed before?

idle owl
#

Not that I'm aware of, but that doesn't mean it hasn't been ๐Ÿ˜ƒ

simple pulsar
idle owl
#

Ok!

slender iron
#

thank you for the help!

prime flower
#

thanks for letting me listen in

slender iron
#

np

idle owl
#

You're welcome @slender iron ๐Ÿ˜ƒ

prime flower
#

@slender iron I just checked an AVR ASM book I have and it uses the same approach dan discussed

#

but it's weird, stores the sequence in LUTs

tulip sleet
idle owl
#
from adafruit_circuitplayground.express import cpx

cpx.play_tone(262, 1)
cpx.play_tone(294, 1)```
#
  File "code.py", line 3, in <module>
  File "adafruit_circuitplayground/express.py", line 617, in play_tone
  File "adafruit_circuitplayground/express.py", line 643, in start_tone
  File "adafruit_circuitplayground/express.py", line 598, in _generate_sample
TypeError: extra positional arguments given```
tulip sleet
#

adafruit_circuitplayground.express.__version__

slender iron
#

@tulip sleet looks like it works way better. thanks!

idle owl
#

@tulip sleet Did you add changes to the sound meter code in the CP Made Easy on CPX in the learn repo for 3.0?

tulip sleet
#

@idle owl I think so

#

I grepped for all calls that needed changes from frequency to sample_rate

idle owl
#

Ok.... I thought I forgot doing it, and was entirely confused...

tulip sleet
#

that was in the PR I submitted for you to approve

#

now i remember

idle owl
#

It didn't occur to me that any of my files would be in there because I haven't pub'd the guide yet. ๐Ÿ˜„

#

Fair enough ๐Ÿ˜ƒ

#

I remember approving that now. I think I linked it in my mind with me updating the cpx lib so I didn't register that you'd updated any of my code.

#

And... now I have to rebase. ๐Ÿ˜†

slender iron
#

I changed mono to channel_count as well

idle owl
#

There's going to be another one to fix typos in the sound meter code but I have to get them up to the same point first.

#

Apparently. ๐Ÿ˜„

#

@tulip sleet Thank you!

simple pulsar
#

@idle owl hello - me again - qq on neopixels

idle owl
#

Correct. That was caught a couple of days ago by someone who put in a PR for it but closed it for some reason. I have the updated code ready to go, but I didn't push it yet because I haven't had time to update the guide.

#

You do need to import neopixel for it to work.

simple pulsar
#

Thanks, that's what/ I just did on a CPE but was about to comment it out to see if it was imported by default super-magically/

slender iron
#

keeps finding bugs

tough ridge
#

any good way to cut a list in half in python without doing the usual list[:length/2]? I'm realizing that method creates a duplicate which causes me to go over the memory limit (it's a big array)

idle owl
#

@simple pulsar Give the guide a refresh, and see if that works better for you.

#

@tulip sleet Thank you!

tulip sleet
#

@tough ridge do you need both halves? You can delete half the list with del l[0:length//2]

tough ridge
#

woah I never knew about that!

#

this is perfect, thanks so much

tulip sleet
#

it's pretty obscure!

slender iron
#

ugh, pulsein's interrupt handler called during tick handling:

#
#0  pulsein_interrupt_handler (channel=channel@entry=11 '\v')
    at common-hal/pulseio/PulseIn.c:83
#1  0x0001c7d4 in external_interrupt_handler (channel=channel@entry=11 '\v')
    at peripherals/external_interrupts.c:43
#2  0x0001d3b4 in EIC_Handler () at peripherals/samd21/external_interrupts.c:83
#3  <signal handler called>
#4  SysTick_Handler () at tick.c:45
manic glacierBOT
#

I ran into something similar today and will have it fixed shortly. Basically, the new interrupt enable and disable routines in asf4 didn't handle nested calls like asf3 did. The end result is that interrupts get fully disabled.

For now common_hal_mcu_disable_interrupts and enable will work like asf3. However, we may want to change it in the future to be more like asf4 which likely runs faster.

tulip sleet
#

@slender iron PDMIn bug manifestation seems to be that when things fail, the DMA transfers only one I2S word and then doesn't transfer any more. Trying to figure out what's wrong with DMAC at that point.

slender iron
#

weird

tulip sleet
#

yeah, I filled the buffers with sentinel values to see if they were being written at all and only the first word got overwritten

#

working on understanding the differences between dma startup in 2.x and 3.0

manic glacierBOT
idle owl
#

@tulip sleet Thank you

tulip sleet
#

@slender iron I am working on the rotary algorithm, cause I think the version as coded is still potentially bouncy. Will give you a sample impl in Python tonight or tomw mornign.

slender iron
#

yeah, I realize it might skip states and be incorrect but didn't think it was a huge issue

#

how about doing the review besides that and following up?

manic glacierBOT
#

I think the current algorithm can still jitter the position count due to bounces. For example, consider ab = 00 going to 01. If b bounces it will oscillate between this_state being 1 and 2, which will cause self->position to be incremented and decremented on each bounce.

There are actually 16 state transitions to consider: ab->a'b', so 2^4 different combinations or states. Some of these are "illegal" and represent going too fast, etc.

I'm writing up a reimplementation that considers...

surreal saffron
#

Thoughts on changing all the "cannot"s in error messages to "can't"s? I was looking for a way to free up enough space to do strerror for errno on gemmas, and it seems like a simple and obvious way to free up some room... At the risk of merge conflicts for pulling stuff from MicroPython in the future.

#

Or, in general, thoughts on freeing space by rewording messages to be more succinct?

#

I have the cannot -> can't one as a PR I could send... I just waffled on it because I wasn't sure how you'd feel about the unnecessary divergence from MicroPython.

slender iron
#

@surreal saffron How much space does it free? Ideally we'd find something with a larger payoff.

stuck elbow
#

.oO( we have lzw compression implemented... )

slender iron
#

implemented where?

stuck elbow
#

for upip

#

at the least

#

and I'm thinking displaying an error message doesn't have to be fast

slender iron
#

yeah totally

#

I have an issue for it

stuck elbow
#

nice

manic glacierBOT
#

This is a follow up to the samd21 clock refactoring.
It makes clock setup more readable.

Flash size usage (ram was unchanged):

Current master on Metro M4 Express:
281308 bytes free in flash out of 499712 bytes ( 488.0 kb ).

atmel-samd/samd51: Implement samd.clock:
+3408
277900 bytes free in flash out of 499712 bytes ( 488.0 kb ).

atmel-samd/samd51: Refactor clock setup
+16
277884 bytes free in flash out of 499712 bytes ( 488.0 kb ).

atmel-samd/samd51: Use crystal for R...
tulip sleet
#

@slender iron ok, made a rotaryio PR on your own PR, via your personal repo

manic glacierBOT
manic glacierBOT
#

Version 2

Fix Itsybitsy build by including some headers:

diff --git a/ports/atmel-samd/samd51_clocks.c b/ports/atmel-samd/samd51_clocks.c
index 201336c17..d5cb8aed0 100644
--- a/ports/atmel-samd/samd51_clocks.c
+++ b/ports/atmel-samd/samd51_clocks.c
@@ -274,9 +274,11 @@ int clock_set_calibration(uint8_t type, uint8_t index, uint32_t val) {

 #include <instance/can0.h>
 #include <instance/can1.h>
+#include <instance/i2s.h>
+#include <instance/sdhc1.h>
 #include <inst...
tulip sleet
#

@slender iron if you want to wait you could finish your PR and I'll submit a PR to adafruit/circuitpython with the encoder changes

#

i don't understand why pirkey build is failing, something cached??

reef seal
surreal saffron
#

The cannot -> can't change frees up only 16 bytes on Gemma. That happens to be enough for a change I want to make to get errno names on Gemma - still no description, but at least "EEXIST"

errant grail
#

I've looked around but can't find an answer to this question: When creating a list for the MIDI protocol stack controller definitions (there are 127 of 'em), what's the most memory efficient way to create blank entries in the list? MIDI has quite a few undefined controllers that are inserted into the stack definition in non-contiguous blocks. I tried using a dictionary but it wasn't as space-efficient as the 127-element list. Here's an example taken from the middle of the list:

#
    ('NRPN_MSB', 'Value'),
    ('RPN_LSB', 'Value'),
    ('RPN_MSB', 'Value'),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('', ''),
    ('All_Sound_Off', 'Value'),
    ('Reset_All_Ctrls', 'Value'),
    ('Local_Ctrl', 'Value'),
    ('All_Notes_Off', 'Value'),
    ('Omni_Off', 'Value'),
    ('Omni_On', 'Value'),
    ('Mono_On', 'Num_of_Chans'),
    ('Poly_On', 'Value'),```
#

... I'm using the list offset to match the MIDI controller code (0 - 127).

tulip sleet
#

@errant grail Do you need these strings to show on a display or something else human-readable?

errant grail
#

Yes. It's working now for my MIDI sniffer, but I'd like to add more features and am running out of memory. It's particularly problematic given the memory needed by different display libraries.

#

I've shortened the descriptors in the table and that seems to help, so I'm guessing that I'm on the right path.

tulip sleet
#

you could use Camel case to avoid the underscores

#

multiple instances of identical strings are no duplicated, so for instance 'Value' is only stored once

errant grail
#

Good idea about the Camel case. I tried to stay close to the MIDI standard defs where possible, but all bets are off now. Good to know that identical strings aren't duplicated. Whew.

tulip sleet
#

you could store that table as a byteaarray where the values of the bytes point into a list of string constants. you could also not use a nested list, but instead stored two parallel lists or just a single list where the even items are the first elemetns and the odd items are the second

errant grail
#

I also found that an unused entry in the table doesn't need a tuple.

tulip sleet
#

but lots of strings just takes space, period

errant grail
#

Yeah. I think the next step would be to split the table to avoid the non-defined gaps. It would be pretty easy to provide an offset translation in the code.

#

All great suggestions, Dan! Thank you! I have a few more forks in the rabbit hole to investigate now.

tulip sleet
#

you could do string expansion at runtime for common substrings, like wherever you have 'Ctrl', use '^' or some other character, and then substitute only when you need the string temporarily: 'Reset_All_^s' and 'Local_^'. ... The gaps in the table don't use up that much space, it's the strings themselves I think that are the bulk.

errant grail
#

Oh, that would help, indeed. There's a lot of repetition in the control codes table.

tulip sleet
#

you could look up the strings in a file

#

use seek() to go to the right location

errant grail
#

I like the file idea, but am also wrestling with response time to try to keep things real-time with the MIDI events. I'll try it and compare. It may be the better trade-off if I switch to sampling instead of real time sniffing. BTW, the rest of the MIDI protocol stack is pretty simple.

slender iron
#

@errant grail how much empty space is in the array? A dictionary might actually be better

#

ints can be keys in a dictionary

#

@tulip sleet back now, was doing errands

errant grail
#

The list is about 20% empty. I tried the dictionary approach using a byte as the index, but it was about as inefficient as the 128-element list approach.

surreal saffron
#

Does the CircuitPython atmel-samd port use lwip or axtls?

slender iron
#

yeah, it'll be 4 bytes keys

#

neither @surreal saffron

surreal saffron
#

Great

errant grail
#

@tulip sleet @slender iron You've given me some good ideas so rather than dragging you further down this hole, I'll go back and experiment. I like the string expansion and file approaches. Oh, and I should compare beta 3.0's memory management scheme to see if that helps. Thanks!

slender iron
#

@errant grail you could also skip the tuples and index [2*x] instead

errant grail
#

Can you share an example of that? I'm still a neophyte...

#

like in two separate lists?

#

are tuples memory hogs?

surreal saffron
#

How about libffi? atmel-samd use that?

slender iron
#

@errant grail your example would be:

#
    ['NRPN_LSB', 'Value',
    'NRPN_MSB', 'Value',
    'RPN_LSB', 'Value',
    'RPN_MSB', 'Value',
``` etc
errant grail
#

@slender iron ah, got it.

slender iron
#

then the first value is foo[2*code] and the second is foo[2*code + 1]

#

@surreal saffron I don't think so

errant grail
#

very comma-delimited-like

tulip sleet
#

@surreal saffron just checked no

#

why are you asking? we have no network support in the atmel-samd ports

#

only in esp8266 port

surreal saffron
#

Double checking my assumptions.

errant grail
#

@slender iron also lends itself to Dan's suggestion to keep the verbose descriptions in a file.

tulip sleet
#

nrf port (in progress) uses libffi

surreal saffron
#

The uerrno module lets ports define what errnos they can raise. I want to prune that list for atmel-samd

errant grail
#

Okay off to the rabbit hole. Thanks again!

tulip sleet
#

@surreal saffron makes sense - thanks for looking at that!

surreal saffron
#

I've had it half finished since PyCon, heh...

tulip sleet
#

@slender iron have to be out for half an hour or so back soon

slender iron
#

kk, I'm code size hunting

tulip sleet
#

still debugging PDMIn. Something similar to this line is in the 2.x impl:

    // Force I2S to start.
    I2S->DATA[0].reg = I2S->DATA[0].reg;

adding that to the 3.0 port makes the PDMIn loop test run for much longer, BUT then there's MSC activity, and I get a hard fault when it's doing an spi read (sync, not dma). looks like the spi device descriptors were smashed

#

maybe it's all buffer overruns somewhere

slender iron
#

ยฏ_(ใƒ„)_/ยฏ

#

if you need a break you could look at another issue

#

the pdm one should be fixed by 3.0 but we have time

rigid path
#

Might be a dumb question, but can I use 2 feathers (not wings) together on a feather tripler board? I am playing with a pair of Ferather M0 RFM69HCW Rasdio Boards.
On the transmit end, I have a feather tripler board loaded with an M0 Packet Radio, an Ultimate GPS Feather Wing and an OLED Feather Wing.
On the receive end, , I have a tripler board holding an M0 Packet Radio and an OLED Feather Wing. Right now, everything works fine, the GPS info is being transmitted to the receiver and displayed on both OLEDs just fine.
On the receive end, I want to replace the OLED feather wing with an M0 Adalogger to record the GPS readings. My question is... can an M0 Adalogger and an M0 Packet Radio Feathers co-exist on the same tripler and work together?

slender iron
#

@rigid path I don't think so since they'll both try to power it.

rigid path
#

@slender iron - I figured that might happen. Looks like I need to pick up an Adalogger feather wing. Not such a bad thing. ๐Ÿ˜ƒ

slender iron
#

๐Ÿ˜ƒ

surreal saffron
#

Is lib/berkeley-db-1.xx linked in on atmel-samd?

#

If not, I think we'll never raise EPERM...

manic glacierBOT
tulip sleet
#

@surreal saffron it's used on the esp8266 port. It's used if MICROPY_PY_BTREE is 1

stuck elbow
#

why do we even have the database stuff enabled

surreal saffron
#

Ok - likely to ever be used on atmel? If so I'll leave it in the list of errnos we can raise, if not I'll remove it.

stuck elbow
#

can you make it conditional on the same variable?

surreal saffron
#

no, not really...

faint summit
#

I'm running into some basic issues with mpy files on my metro m0. Is it alright if I ask them here?

idle owl
#

Yep, ask away! Someone will answer when they can

surreal saffron
#

@stuck elbow actually scratch that, i can - though it's a bit ugly to do so...

faint summit
#

Thanks! I want to get a .mpy of my own module so I pulled from the micropython repo and ran mpy-cross. I moved the mpy file into my lib folder and when I try to compile, I get the error "ValueError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info."

#

I read through the site and I think it's referring to their own libraries? Not too sure what's going on tbh

idle owl
#

That happens when you run a version of mpy-cross built with a different version of CircuitPython than you're running on the board.

#

So if you built mpy-cross from a 3.0b CircuitPython, and you're trying to use the .mpy file on 2.x CircuitPython, you'll get that error. Or vice versa.

#

You said you pulled mpy-cross from the micropython repo? Do you mean CircuitPython?

faint summit
surreal saffron
#

will extmod/machine_i2c.c be linked into the atmel-samd port? (How can I figure this out myself? :D)

idle owl
#

@faint summit Ok that might be the problem. You need to use mpy-cross from CircuitPython with CircuitPython

slender iron
#

@tulip sleet my local build of pirkey is out of space as well

tulip sleet
#

@slender iron I'm not seeing that, but I will reclone your repo and try again

slender iron
#

did you triple check your submodules?

#

you could be missing frozen stuff

tulip sleet
#

yah i did. new clone fails. will diff the two trees

#

i didn't change anything that should affect that build in my PR to you (famous last words)

faint summit
idle owl
#

@faint summit You can build it yourself if you clone the repo locally. It's a few steps, it's not bad. What OS are you running?

faint summit
#

macos high sierra

tulip sleet
#

@surreal saffron you can just look in the ports/atmel-samd Makefile and/or grep for that file in the atmel-samd tree.

surreal saffron
#

cool - wasn't sure if just the Makefile was enough or there were other places to check...

idle owl
#

@faint summit Give me a minute.

tulip sleet
#

@slender iron ok yes my submodules were out of date but not in an obvious way. Two of the submodule dirs were empty

#

is rotaryio turned on for non-express?

#

more likely it's the slight enlargement of the eic stuff

slender iron
#

it shouldn't be and I couldn't find it in the map

#

the busio constructors take a bunch of space

tulip sleet
#

yep, that was my motivation for removing them when we had that discussion. ifdef'ing them out is a pain

#

or reducing them to NotImplemented by ifdefs

slender iron
#

right

#

another idea I had was to shrink the mp_obj_type size

#

there are ~120 instances of it in memory

#

at 60 bytes each

tulip sleet
#

setting inline-limit to 50 instead of 60 makes pirkey fit with 380 bytes free

#

i don't see anything you can remove from mp_obj_type. you could put the optional stuff at the end ordered by priority and have a set of flags saying whether they exist or not, shortening it in some cases. or a table of 4-bit offsets saying where to find each of those function pointers in a block of function pointers, if they exist. Sounds like a 4.0 project. everything else is fine except pirkey so we can just squeeze that however we can

#

we're out to eat now for a couple of hours or so, will check back when I return

slender iron
#

k

faint summit
#

@idle owl Alright, thanks so much! Sorry for making you spoon feed me

idle owl
#

@faint summit Don't be sorry! We all started somewhere. When you're ready, I can show you how to build it yourself ๐Ÿ˜ƒ

prime flower
#

is TouchIO incl'd in the crickit CPX build?

manic glacierBOT
manic glacierBOT
idle owl
#

It's always clocks.

slender iron
#

today is clock day too ๐Ÿ˜ƒ

cunning crypt
#

Just don't get ticked at them.

idle owl
#

The first iteration of the new Adafruit CircuitPython Code of Conduct. Once completed, it will replace the current Code of Conduct displayed on Discord, and apply to all CircuitPython spaces. Please read through it and provide any suggestions you may have as a review or as a comment on the pull request. We want this to be a great fit for our community, and the best way to do that is to have community input. Everyone is welcome to submit a review for consideration. https://github.com/adafruit/Adafruit_CircuitPython_Code_of_Conduct/pull/3

cunning crypt
#

Just so we're perfectly clear

idle owl
#

Yes it would.

#

That is outlined in the description on the PR.

cunning crypt
#

Just starting to read everything now

#

grumbles about being a writing-minded person

#

There's a few places that are perfectly fine, but there's better wording.

idle owl
#

So submit a review for consideration ๐Ÿ˜ƒ

#

The wording is a bit awkward in general because it's a Code of Conduct.

cunning crypt
#

Oh, yeah

idle owl
#

Which has an almost legal undertone to it.

#

But not entirely as such.

cunning crypt
#

But I have to finish reading the whole thing before making any sort of review

idle owl
#

That's fair

manic glacierBOT
idle owl
#

@slender iron My notes are evidently sparse on getting a new repo ready for the bundle. I think I took better notes on RTD than I did Travis. I don't remember how to run Adabot (all of that was on my previous machine, so I'm assuming it didn't occur to me to take better notes on it). I activated it on Travis (I think) but "trigger build" says "custom build will not appear on GitHub" so I'm not sure that's correct. Do you have a few minutes?

slender iron
#

do need to know more?

idle owl
#

I'm still at the bit where my notes say run Adabot, find Travis, activate, trigger guild. Then RTD is next following that. The actual adding to the bundle part, I knew was documented.

cunning crypt
#

@idle owl Regarding your CoC - I feel like it should apply to all Adafruit github repos, but that seems like a little bit of a stretch for a CircuitPython CoC

idle owl
#

We already discussed that. The Adafruit Be Excellent policy already covers Adafruit spaces. This is being written for CircuitPython spaces.

cunning crypt
#

I just like unified systems, so like to cover everything with as few things as possible

idle owl
#

Understandable. But in the end, not intended to be our scope. Adafruit has Adafruit covered. We're working to outline what we're doing here. We already had two separate Codes with the current Discord #code-of-conduct and the Adafruit Policy. So this isn't a change to that.

cunning crypt
#

Entirely fair.

manic glacierBOT
#

#837 implemented human readable OSError messages, but excluded low-flash devices (ones with BOARD_FLASH_SIZE <= 192000).

This PR improves the situation on those devices:

Adafruit CircuitPython 3.0.0-beta.0-32-gd6ff451-dirty on 2018-06-01; Adafruit Gemma M0 with samd21e18
>>> for i in range(32): print(OSError(i))
...
[Errno 0]
[Errno 1] EPERM
[Errno 2] ENOENT
[Errno 3]
[Errno 4]
[Errno 5] EIO
[Errno 6]
[Errno 7]
[Errno 8]

...

cunning crypt
#

@idle owl There, did the review. Mostly pedantic stuff, if I'm being entirely honest

faint summit
#

@idle owl Hopefully I get there quick enough ๐Ÿ˜ƒ

#

@idle owl I actually have another question if you don't mind

cunning crypt
#

@faint summit Just go ahead and ask the question. Kattni can answer it when she can, or someone else might have an answer quicker.

faint summit
#

Alright! I'm wondering how I should go about with large lists (like thousands of entries). I tried converting my own module into a .mpy format, but I'm still getting memory allocation errors.

cunning crypt
#

List as in the variable type, or list as in a text file that's loaded? Either way, they take up a lot of space compared to the device's RAM

#

A huge list might not be possible to fit on the board.

faint summit
#

as a variable type. I'm using lists of ~100 entries, and I definitely need much larger ones

raven canopy
#

@cunning crypt sweet! a partner in pedanticizing on the CoC! ๐Ÿ˜„

cunning crypt
#

@faint summit Metro M0 Express, right?

faint summit
#

@cunning crypt yep! Ok, maybe not that large, but is it feasible for me to get something like 1000>

cunning crypt
#

The M0 has 32k of RAM.

#

That's... 32768 bytes

#

Not counting what Circuit Python uses by itself

surreal saffron
#

or the overhead of each python object

cunning crypt
#

You can fit around 3275 total variables with a character length of 10 each

#

Disregarding all other uses of RAM - Most significant of which will be Circuit Python, but as @surreal saffron mentions, the program itself will eat away at it too

faint summit
#

Ok, then what are some steps I can do to maximise the list size I can use?

slender iron
#

what are you storing in it?

cunning crypt
#

Make the length of each individual object as short as possible

#

You can store twice as many items with 5-character names as you can with 10-character.

surreal saffron
#

use fewer objects, if possible? You can fit more in a single big string than in 10x as many strings that are 1/10th the length

cunning crypt
#

Each string has an end character, correct?

#

So that's an extra character per string

faint summit
#

just a lot of floats

cunning crypt
#

(insert "Whatever floats your boat" joke here)

faint summit
#

the goal was to get lots of readings so I can take a reliable fft

cunning crypt
#

You probably don't need that many.

surreal saffron
#

@cunning crypt I don't believe they have a terminator, but they do each have a reference count, and a length, that are stored as part of the object

#

without any doubt, the maximum number of floats you can fit in memory will be a single array of floats.

faint summit
#

@cunning crypt fair enough, I did some quick testing and realised that I need >400 readings.

cunning crypt
#

@faint summit If you can't fit everything into the M0

#

The Metro M4 has 6 times as much RAM

idle owl
#

@cunning crypt Can you submit an actual review? You can click on line numbers and do in-line change-requests - it allows for discussion on each one, and also keeps track better as changes are made. If you're unsure how to do that, I can help you with that. (Not sure if you chose to do a comment or if it wouldn't let you directly review it.)

cunning crypt
#

@idle owl I did what was the most obvious and seemed right. I'm not familiar with GIT reviews at all.

idle owl
#

@cunning crypt Would you like to learn?

cunning crypt
#

That's a silly question. Of course!

idle owl
#

๐Ÿ˜ƒ

faint summit
#

@cunning crypt that looks promising. Do you think this is a realistic fix to this problem?

cunning crypt
#

@faint summit I'm fairly certain the issue you're running into is memory. But as @surreal saffron mentioned, try using an array first to see how that goes.

surreal saffron
#

try this in a repl:
import array
a = array.array('f', range(4000))

#

that works for me, and creates an array of 4000 floats

#

you can access them with a[0], a[1], etc

#

for both read and for write.

idle owl
#

Ok, first go to the pull request. Then click on "Files changed". Then scroll down to the code-of-conduct.md file in that list. You'll see if you mouse over any given line in that file, a blue [+] symbol will appear on the left side between the line number and the text. If you click that plus symbol, it opens a little review window. For the first one, you type in your line specific comment there, and click "Start a review". It will save it and say "Pending". Then go to the next line you want to do that, and repeat, click the +, enter your comment. This time, click "Add review comment" to continue. Once you've finished adding all your in-line suggestions, you go up to the top and click "Review changes" on the top right. Enter some quick text there, and then choose "Request changes" from the list under the text field there, and then click "Submit review".

cunning crypt
#

Ooh, got it!

idle owl
#

You'll see some inline comments there already from Scott. You can still add yours if it's the same line if he commented on something that you also want to comment on. And that's what it will look like once you're finished submitting the review.

cunning crypt
#

@idle owl Done

idle owl
#

Beautiful, thank you!

surreal saffron
#

it looks like it failed to find the expected test output - so that's weird.

raven canopy
#

@surreal saffron expand the "Building Adafruit binaries" section. quite a few errors.. looks like mostly "first use"

surreal saffron
#

aha.

#

that's probably just a header that needed to be included and wasn't, i'm guessing.

#

thanks

raven canopy
#

yeah, with that many, i would start there too. you're welcome!

manic glacierBOT
idle owl
#

@slender iron I responded earlier, but I don't know if you missed it. The documentation you linked me to isn't the issue I'm having. I'm still trying to get travis setup on the new repo. The repo exists already and has what appears to be all the right files in it. I activated it in travis (I think, I found the repo and clicked activate). I have "Run Adabot" in my notes before the travis stuff though. Is that to try to get Adabot to do the travis stuff for me? I don't remember how to run Adabot. The thing in my notes after "Activate Travis" is "Trigger build" - I found something that says trigger build, but it says it's custom and won't be linked in GitHub so I wasn't sure that was correct.

slender iron
#

adabot is used to set up the release permissions

#

which repo is it?

idle owl
#

Adafruit_CircuitPython_MatrixKeypad

slender iron
#

so adabot adds a variable under settings that isn't there

idle owl
#

Oh under Environment Variables?

slender iron
#

yeah, so it looks like it hasn't added it

idle owl
#

I didn't run it. So I guess that would make sense.

slender iron
#

running adabot is python -m adabot.circuitpython_libraries

#

it runs every night too but depends on permissions being correct

#

er, not every night. every time I do it for the meeting

idle owl
#

I clone the repo and run that inside the repo?

slender iron
#

oh thats right, new comp

idle owl
#

Yeah... :/

slender iron
#

yeah, thats the start. then you need to copy and edit the env.sh template to include your permissions keys

idle owl
#

Did you give me permission keys last time? Because it doesn't look like I have any generated.

#

@slender iron What kind of scope am I supposed to give the key?

slender iron
#

maybe, just public repo

#

or maybe I gave you adabot keys

#

ยฏ_(ใƒ„)_/ยฏ

idle owl
#

that sounds accurate

#

I feel like I remember that part of the discussion.

#

Because you said later sometimes it asks for them

slender iron
#

right

idle owl
#

Do you want to do that again or no

slender iron
#

I don't know. I'm busy poking rosie and am about to peace out for the weekend. can we do it monday?

idle owl
#

Yeah, sorry about it trying to get to it so late.

slender iron
#

np

tulip sleet
#

@slender iron if you aren't trying to get the latest PR to build I'll wait. CPX build is slightly too big. I can make LIS3DH library smaller by at least 300 bytes.

slender iron
#

I hadn't seen it. I'll look monday

tulip sleet
#

kk - I'll look at reducing library sizes in a more orderly way.

slender iron
#

ideally we'd leave some extra space so we're not always fighting it

manic glacierBOT
manic glacierBOT
raven canopy
#

git continues to amaze me. i'm rebasing WIP with the updated SAMD peripherals file/function setup, and its going pretty seamlessly. ๐Ÿ™ ๐ŸŽ‰

manic glacierBOT
#

I needed a simple way to upload firmware, attach to repl over network and a way to run tests.
@tannewt encouraged me to make a PR of my attempt.

Show some board info:

$ ./cpboard.py feather_m0_express
Device: 239a:8023 on /dev/ttyACM0
Serial number: 9B81BE1A8413D405A413E263903150FF
os.uname:
  sysname: samd21
  nodename: samd21
  release: 6479cb080-dirty
  version: patchbase-dirty on 2018-06-01
  machine: Adafruit Feather M0 Express with samd21g18

$ ./cpboard.py 239a:80...
fading solstice
#

Anyone working on or know of someone that is working on: a CircuitPython driver for L3GD20 Triple Axis Gyroscope.

manic glacierBOT
idle owl
#

@fading solstice Not that I'm aware of. If you're asking because you'd like to, file an issue on the CP repo so others know and so we can track it. Also check the issues list for it if you haven't already.

fading solstice
#

There is a issue for this one. I thought I would pick it up.

#

#596

idle owl
#

I don't think anyone is working on it. So that would be great ๐Ÿ˜ƒ Please update the issue and assign it to you if you decide to work on it.

fading solstice
#

thx

idle owl
#

Thanks for looking into it!

manic glacierBOT
manic glacierBOT
#

Running the basics/gen_stack_overflow.py test using #893 has crashed my board so hard that I'm unable to revive it.

I have the latest bootloader from https://github.com/adafruit/uf2-samdx1/releases/tag/v2.0.0-adafruit.5
INFO_UF2.TXT:

UF2 Bootloader v2.0.0-adafruit.5 SFHWRO
Model: Metro M4 Express
Board-ID: SAMD51J19A-Metro-v0

I have used the Metro M4 Express (QSPI) flash erase from https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51?view=all#old-way-f...

manic glacierBOT
#

Have you tried rebooting the RPi? Sometimes Linux gets completely confused about USB ports that have encountered errors on their devices.

You have a Metro M4 that has the word "BETA" on the silkscreen, right? The older boards had different pin configs. Did you use an update-bootloader...uf2 to update the bootloader? That will set the BOOTPROT fuses correctly to protect the bootloader against overwriting. Just loading it via a J-Link will not do that. Did you have a Metro M4 from the firs...

#

I have one with BETA on it, which I received a week ago, so I guess it's not from the first batch.
I used update-bootloader-feather_m4-v2.0.0-adafruit.5.uf2.
I did a reboot of the Pi now, didn't help. I've tried the board on a Windows computer as well.

The Pi has been quite resilient for me, I haven't rebooted in 2 weeks and had all kinds of board crashes and some flash erases of boards I have connected. It's been enough to re-plug the board to get going again.

manic glacierBOT
stoic gazelle
#

I'm looking for the order of miso, mosi, and sck on the metro m4 express, I see them on the pinout page but the page doesn't specify the order of pins

tulip sleet
#

@stoic gazelle it's the same as on the Metro M0 and the Arduino. I'll look for a picture for you.

idle owl
#

@tulip sleet I was going to ask if it was something I could do. I'll look at it.

manic glacierBOT
stoic gazelle
#

I found one for the Arduino uno

#

Thank you @tulip sleet

tulip sleet
#

@stoic gazelle note that the VCC pin is 5V, not 3.3V, even on the M0 and M4. But the SCK, MOSI, and MISO pins are 3.3V logic: don't apply 5V to them.

#

@idle owl Thanks!

stoic gazelle
#

Ah ok thanks, I am connecting the m4 to a project I started with a feather on a tripler(and a doubler)

manic glacierBOT
stoic gazelle
#

The hope is to use the joy featherwing with the GPS feather with and the SD writer to ba able to track certain things - my purpose is to track potholes so I can send the city/county a list rather than every so often give them a call with only a rough idea of where the potholes are

#

So far I am just past where I was with the m0 feather

manic glacierBOT
stoic gazelle
tulip sleet
#

@stoic gazelle clouds don't affect GPS signals in any significant way

stoic gazelle
#

lol then I should try outside

#

Thanks!

#

I put the end of the antenna out the window but I still don't get a fix, are there other things I can do to get it working?

tulip sleet
#

I've gotten a fix just by hanging it in the window, so there may be some other issue. If you just remove the antenna and keep it outside, do you get a fix? Are you getting reasonable responses back from the GPS to the microcontroller board?

#

you should not need an external antenna outside if you have a clear view of the sky

#

the GPS module has an antenna built into its cover

stoic gazelle
#

I used the example code and it is responding with: waiting for fix

#

Ok, when I head out I'll bring a laptop so I can check it outside

tulip sleet
#

you may have tx and rx reversed going to the module. I believe you'll see that if that's true.

#

rx->tx and tx->rx is what it should be

stoic gazelle
#

Oh I'll try that first

tulip sleet
#

if you're using a feather doubler/tripler then the wiring is automatically correct from feather to GPS featherwing

stoic gazelle
#

I switched the wires and get the same results, ah okay I'll switch back :)

tulip sleet
#

that's the LED on the GPS featherwing

stoic gazelle
#

After switching the wires back to how they were I now have GPS output!

tulip sleet
#

maybe they were just loose or something

stoic gazelle
#

Maybe reseating the wires helped?

#

:)

#

Thank you very much!

tulip sleet
#

congrats!

stoic gazelle
#

Thanks to @idle owl for suggesting to switch to the m4!

manic glacierBOT
#

Discovered by attempting to add a sound_level functionality to the CPX Express class library. Checking the sound level requires recording to a small buffer, and If used in code with anything that plays audio (like play_tone), it caused the filesystem to hang and required a hard reset to regain functionality. It would at times run for a few seconds before failing, but otherwise it failed every time. I was able to get the two functions to exist together in code if I had sound_level chec...

idle owl
manic glacierBOT
manic glacierBOT
#

Adafruit gave me a jlink with the boards and now I'm trying @tannewt's gdb guide. I have never used gdb before, in fact I don't think I've used a debugger in 25 years since university.

No matter what I do I always end up in _usart_async_set_irq_state().

pi@agl:~/circuitpython/workdirs/test/circuitpython/ports/atmel-samd$ /home/pi/opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gdb-py build-metro_m4_express/firmware.elf

(gdb) target extended-remote 192.168.10.175:2331
Remo...
manic glacierBOT
#

I haven't tried Arduino blink since I won't be using Arduino in the future, so I though I'd try gdb since that was something I might have use for later.
But I'll try it if this is a dead end.

(gdb) bt
#0  0x00024778 in _usart_async_set_irq_state (device=0x20001c20 <heap+6144>, type=32, state=false) at asf4/samd51/hpl/sercom/hpl_sercom.c:624
#1  0x20001c20 in heap ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
#

I'm just trying to figure out if you have a hardware problem or a software problem. First was to see if the bootloader is messed up in some way, but it seems like you used the standard update-bootloader...uf2 to make sure it's OK. Also we need to check whether the firmware image you're trying to upload is broken is some way. Did you build it yourself or did you download it from a github release? You might try the alpha.6 .uf2 as well, and/or redownload the beta.0 .uf2.

The idea with Ardu...

raven canopy
#

so rebasing wasn't as seamless as i thought... still better than re-writing from scratch, though. ๐Ÿ˜„

manic glacierBOT
#

The bootloader was a copy-paste error on my part, I accidentally used the feather version first, but the leds didn't blink, so I discovered my error.
This is the INFO_UF2.TXT:

UF2 Bootloader v2.0.0-adafruit.5 SFHWRO
Model: Metro M4 Express
Board-ID: SAMD51J19A-Metro-v0

Wrt cables, I've used diferrent ones when switching between the Pi and a Windows computer.

I'm having problems getting the Arduino IDE up and running, I've followed these steps, but no Adafruit boards: https:/...

manic glacierBOT
timber mango
#

What microcontrollers use python?

#

(I know the RaspberryPi)

stuck elbow
#

Raspberry Pi is a computer, not a microcontroller

#

MicroPython is Python for microcontrollers, and it has been ported to many architectures: STM32, PIC32, ESP8266 and ESP32, NRF5x, SAMD and many more.

timber mango
#

Wow

#

Is it more reliable than AVR C?

stuck elbow
#

no

timber mango
#

More coder friendly?

#

@errant grail on small platforms I think of strings as 'media' (just like JPEGs and WAVs and other audio/video files that contain digitized imagery and sounds).

wrt your discussion about the string table with the gaps for your MIDI stuff.

stuck elbow
#

@timber mango easier, yes

timber mango
#

Ah

#

Sounds cool

stuck elbow
#

it doesn't run on AVRs, though

#

they have too little memory

timber mango
#

I figured.

#

How much memory is optimal for MP?

stuck elbow
#

really depends on your program

#

SAMD21 has 32kB and that's a bit tight for larger programs

manic glacierBOT
#

@notro can you retrieve the fuse settings from the board? I don't know how in gdb; I use Atmel Studio on Windows.

This is what my Metro M4 Beta looks like:

AC_BIAS0 = 0x00
ADC0_BIASCOMP = 0x00
ADC0_BIASREFBUF = 0x00
ADC0_BIASR2R = 0x00
ADC1_BIASCOMP = 0x00
ADC1_BIASREFBUF = 0x00
ADC1_BIASR2R = 0x00
USB_TRANSN = 0x00
USB_TRANSP = 0x00
USB_TRIM = 0x00
ROOM_TEMP_VAL_INT = 0x00
ROOM_TEMP_VAL_DEC = 0x00
HOT_TEMP_VAL_INT = 0x00
HOT_TEMP_VAL_DEC = 0x00
ROOM_INT1V_VAL = 0x0...
#

Some progress, but I can't break on supervisor_get_serial_connected():

(gdb) break _usart_async_set_irq_state
Breakpoint 4 at 0x2476c: file asf4/samd51/hpl/sercom/hpl_sercom.c, line 623.
(gdb) monitor reset
Resetting target
(gdb) continue
Continuing.

Breakpoint 4, _usart_async_set_irq_state (device=0xb, type=USART_ASYNC_BYTE_SENT, state=8) at asf4/samd51/hpl/sercom/hpl_sercom.c:623
623             if (USART_ASYNC_BYTE_SENT == type || USART_ASYNC_TX_DONE == type) {
(gdb) bt
#0...
#

@sommersoft AFAICT we got the same values. I tried your? Atmel Studio guide yesterday so I already had it installed. Really nice with these Adafruit guides, saves me from having to chase down all the details :-)

AC_BIAS0 = 0x00
ADC0_BIASCOMP = 0x00
ADC0_BIASREFBUF = 0x00
ADC0_BIASR2R = 0x00
ADC1_BIASCOMP = 0x00
ADC1_BIASREFBUF = 0x00
ADC1_BIASR2R = 0x00
USB_TRANSN = 0x00
USB_TRANSP = 0x00
USB_TRIM = 0x00
ROOM_TEMP_VAL_INT = 0x00
ROOM_TEMP_VAL_DEC = 0x00
HOT_TEMP_VAL_INT = 0x...
errant grail
#

@timber mango Yes -- it's a measured trade-off between using default data handlers (arrays, lists, dictionaries) and indexing streams. Because I prefer to have verbose data attributes, it's fun to find ways to compress and expand the information, not unlike dealing with media streams through limited bandwidth. Dan and Scott gave me some excellent ideas to pursue.

manic glacierBOT
marble hornet
#

DS3231 HELP. hey, i'm having trouble import the ds3231 library. i downloaded the file and copied it into the lib folder. i tried in the repl: from adafruit_ds3231 import DS3231 but i got this error:

  File "<stdin>", line 1, in <module>
ImportError: cannot import name DS3231```

this isn't ive seen the 'can't import name error.'  my googleing of that error doesnt yeild results like when i google other errors.  

does anyone know what is causing this????
#

thank you

raven canopy
#

@marble hornet try just import adafruit_ds3231. DS3231 is the only defined class, with no additional inheritances which may be causing the error.

marble hornet
#

okay, thanks

#

will try

#

it worked, thank you @raven canopy

raven canopy
#

yw! i wish i could give a better explanation as to why/why not. i would just be regurgitating information from the pydocs...

marble hornet
#

wait

#

@raven canopy dir(adafruit_ds3231.DS3231) says that adafruit_ds3231 doesn't have attribute DS3231

#

to me, it seems like the same problem

raven canopy
#

what does dir(adafruit_ds3231) output?

marble hornet
#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DS3231'```
raven canopy
#

hmm...

marble hornet
#

that is after: import adafruit_ds3231

raven canopy
#

i'm looking right at in the repo... ๐Ÿ˜„

#

give me a sec, and let me get a board running the latest libraries.

marble hornet
#

ill try re-downloading

raven canopy
#

yeah, something may have gone wonky. here is what i get:

>>> import adafruit_ds3231

>>> dir(adafruit_ds3231)
['__repo__', 'i2c_bcd_datetime', '__name__', 'i2c_bcd_alarm', 'DS3231', 'i2c_bit', 'I2CDevice', '__version__']

>>> dir(adafruit_ds3231.DS3231)
['__module__', 'alarm1_status', '__qualname__', 'alarm1_interrupt', 'alarm2', 'alarm2_interrupt', 'datetime', '__init__', 'alarm1', 'disable_oscillator', 'datetime_register', 'alarm2_status', 'lost_power']
#

and this:

>>> from adafruit_ds3231 import DS3231
>>> dir(DS3231)
['__module__', 'alarm1_status', '__qualname__', 'alarm1_interrupt', 'alarm2', 'alarm2_interrupt', 'datetime', '__init__', 'alarm1', 'disable_oscillator', 'datetime_register', 'alarm2_status', 'lost_power']

so the single class thing i said earlier: doesn't make a difference after all. i understand less python than i let on. ๐Ÿ˜„

marble hornet
#

๐Ÿ˜† me at school! thanks for the help

#

ill try replacing the python version

manic glacierBOT
marble hornet
#

@raven canopy its working now!!! must have been a bad download

#

thanks for the help

raven canopy
#

yay! and not sure i helped all that much. hehe

marble hornet
#

@raven canopy it's the thought that counted, do you know if extended ram is supported yet in alpha ? or beta ?

raven canopy
#

extended RAM? as in, the new heap management (yes)? or using an external source for RAM (don't know that will ever happen)?

stuck elbow
#

esp32 can use external ram, but samd doesn't have such possibilities

manic glacierBOT
marble hornet
#

hi! how does one get info out of a time_struct ? thanks for help either way!

raven canopy
#

@marble hornet time_struct is a named tuple. this is from the ds3231_simpletest.py on github:

while True:
    t = rtc.datetime
    #print(t)     # uncomment for debugging
    print("The date is {} {}/{}/{}".format(days[int(t.tm_wday)], t.tm_mday, t.tm_mon, t.tm_year))
    print("The time is {}:{:02}:{:02}".format(t.tm_hour, t.tm_min, t.tm_sec))
    time.sleep(1) # wait a second
marble hornet
#

@raven canopy thank you, and sorry. i didn't think to check there. my bad.

raven canopy
#

and no worries! i'm used to looking everything up, so its become second nature. ๐Ÿ˜„

marble hornet
#

WHOO!! i just got threading of tasks working on circuit python based on assigned priority !!!!!!!!! yay

#

also, when you have been coding for so long in cir-py you do ctrl s instead of enter to send literally this

raven canopy
#

heh. yeah, i type Markdown all over the place now, thanks to GitHub and Discord... _ instead of ctrl+i.

marble hornet
#

markdown?

#

@raven canopy

#

also #running_out_of_memory oh yay!

#

another question:

#

what would happen if i put main.py in the frozen modules ?

idle owl
#

The planet would implode.

cunning crypt
#

We wouldn't recommend it. Un-imploding the planet is a bit difficult, as you may imagine.

stuck elbow
#
cunning crypt
#

I learned a new word: Geocide

marble hornet
#

hahahah

#

but seriously, lets you you finished a product(this is just an example)

idle owl
#

So you did it?

#

What happens if there's one in the frozen modules and also one locally, which one does it prefer?

#

That's entirely curiosity, not that I'm implying an issue.

cunning crypt
#

So, having a frozen main.py could potentially create conflicts.

#

Having a non-frozen one lets you ensure that the user doesn't accidentally cause issues.

tulip sleet
#

@marble hornet instead of freezing main.py itself, you could just have it import a module and then call a function in that module (or just have the import actually run the program). In other words you have added your own privately library.Then you don't usurp main.py. Or if you are using existing Adafruit libraries that are large, you can freeze those to save RAM. They are much less likely to change than your own program, so freeze them first.

marble hornet
#

@tulip sleet wait what! frozen modules save ram! is that b/c they are .mpys ?

tulip sleet
#

.mpy's from the file system still need to be copied into RAM to be used. But frozen .mpy's are already in the address space (in flash) so they don't need to be copied. The objects they create of course live in RAM, but the code itself stays in flash, which can be a real RAM saver.

marble hornet
#

what! thank you

astral vessel
#

Hmm, maybe I'm being blind here. I'm connected to a trinket M0 using screen and the print() command running in main.py works fine. But I want to send data the other way, I want to type into my screen session and for those characters to be saved to a variable by the main.py script. So something like uart.read() but for data coming over the usb connection. (To be clear I am not, and do not want to be, using the REPL)

#

I'm assuming it's something simple I'm missing

marble hornet
#

here:

#

my_var = input("my input string")

astral vessel
#

Why would I type my string into the function? It should be polling the usb connection and getting whatever characters I type there.

#

ah, I see, that's gets printed

marble hornet
#

sorry @astral vessel i should have used a better string

astral vessel
tulip sleet
astral vessel
#

ah, well fortunately I can work around that

idle owl
#

@tulip sleet My sound_level code is still hanging the filesystem. But it all imports ok and play_sound works separate from sound_level. I'm freezing it into a custom build to see if it works from there or not.

#

That's a new one. ```-332 bytes free in flash out of 253440 bytes ( 247.5 kb ).
4084 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Too little flash!!!```

#

No idea what to do with that.

astral vessel
#

New question: I have an esp connected to the uart and am reading in the data from the esp when it lists the available networks and printing that data back to my computer, but it's too slow and misses data. Suggestions?

while True:
    data = uart.read(32)
    if data is not None: 
        data_string = ''.join([chr(b) for b in data])
        print(data_string,end="")
marble hornet
#

I have a weird problem

#

a really weird problem

#

im running this:

#
class thread_list():

    def __init__(self, length = 3):
        self.thread_list = [[]]*(length+1)
        
    def add_task(self,func, arg_tup, priority):
        self.thread_list[priority].append(task(func, arg_tup))

    def chug(self):
        for cur_list in self.thread_list:
            while len(cur_list):
                cur_list[0].perform()
                cur_list.pop(0)
#

    
    def __init__(self,func, arg_tup):
        self.func = func
        # set arg_tup as a tup whether or not inputed as tup or not
        if type(arg_tup) == tuple:
            self.arg_tup = arg_tup
        else:
            self.arg_tup = (arg_tup,)

    def perform(self):
        self.func(*(self.arg_tup))```
#

and when i make a thread_list object and add_task to it the newly created task is added to all the lists inside of the thread_list object. anyone know why, am i missing something ?

#

ahhhhhhhhhh

#

ANY help is greatly appreciated

#

here is some tested code:

#
>>> from tg_modules.tasking import thread_list
>>> foo = thread_list()
>>> foo.add_task(print,('this peice of text was added first'),3)
>>> foo.add_task(print,('this one was added second'),1)
>>> print(foo.thread_list)
[[<task object at 20001440>, <task object at 20001470>], [<task object at 20001440>, <task object at 20001470>], [<task object at 20001440>, <task object at 20001470>], [<task object at 20001440>, <task object at 20001470>]]
>>> ```
#

why does any given task (say the one here: 20001440) appear more than once.? i'm assuming i made a mistake.

#

THANKS FOR LISTENING ! ANY AND ALL HELP IS MUCH APPRECIATED

#

@raven canopy ?

#

i will be back tomorrow too

raven canopy
#

@marble hornet the problem looks to be the empty list(s) at the start. I ran this in python3:

>>> foo = [[]]*4
>>> foo[0].append([0])
>>> foo
[[[0]], [[0]], [[0]], [[0]]]
>>> del foo

# set an item in the list before appending
>>> foo = [[]]*4
>>> foo[0] = [0,]
>>> foo
[[0], [], [], []]
>>> foo[0].append([1,2])
>>> foo
[[0, [1, 2]], [], [], []]
>>> foo[1].append((0,1,2))
>>> foo
[[0, [1, 2]], [(0, 1, 2)], [(0, 1, 2)], [(0, 1, 2)]]

I didn't see anything in the pydocs that would explain it, but i didn't look beyond the mutable sequences page...

#

it seems like a slightly kludgey workaround, but i changed add_task to this:

def add_task(self,func, arg_tup, priority):
    if self.thread_list[priority]:  # edit: dropped use of len(), which is less pythonic
        self.thread_list[priority].append(task(func, arg_tup))
    else:
        self.thread_list[priority] = [task(func, arg_tup)]

and it worked, like this:

>>> import tg_thread_test
>>> foo = tg_thread_test.thread_list()
>>> foo.thread_list
[[], [], [], []]
>>> foo.add_task(print, ('test1'), 0)
>>> foo.thread_list
[[<tg_thread_test.task object at 0x000002166C24A208>], [], [], []]
>>> foo.add_task(print, ('test2'), 1)
>>> foo.thread_list
[[<tg_thread_test.task object at 0x000002166C24A208>], [<tg_thread_test.task object at 0x000002166C24A240>], [], []]
>>> foo.add_task(print, ('test3'), 0)
>>> foo.thread_list
[[<tg_thread_test.task object at 0x000002166C24A208>, <tg_thread_test.task object at 0x000002166C1D0A90>], [<tg_thread_test.task object at 0x000002166C24A240>], [], []]
>>> 
raven canopy
#

@slender iron I won't be able to make it to the meeting tomorrow. My "out Thursday" turned into "out Thursday+Friday, and Mon-Wed" with 30+ hours of combined driving and hotel life for 5 days. My brain is mushy. ๐Ÿ˜ต Here are my hugs-n-status.

Hugs: @slender iron for making the SAMD peripheral functions more modular; really opens up some future growth. @tulip sleet for the myriad of troubleshooting on GitHub & Discord (and probably the forums, too) this week. @errant grail for the MIDI boards and exploration; its inspirational to see that stuff pop up. And a group hug for all the things my exhausted mind can't conjure up right now.

Status: didn't get much further on FrequencyIn. Did manage to rebase to current master with the peripheral function changes. That was my mushy brain limit. Will re-attack when I get back later this week.

#

totally didn't want that to ping everyone... ugh.

slender iron
#

@raven canopy thanks! added to my notes

#

<@&356864093652516868> and everyone else. Our meeting will happen as normal tomorrow here on Discord. It'll be 11am Pacific / 2pm Eastern.

manic glacierBOT
marble hornet
#

@raven canopy your altered add_task method worked perfectly. thank you. i'm not 100% sure that that difference makes it better but i see how it could be used again. i would like to give you a line of credit in the code, what should i put for your name?

umbral dagger
#

@marble hornet When you make the list and give it an initial element value, youโ€™re saying โ€œCreate a list that long and put this object in each cellโ€. In your case โ€œthis objectโ€ was an empty list, so each cell got the same empty list object. So when you appended to one, since they were all the same list, it showed up in each place. @raven canopy โ€˜s code will create a new sublist each time one is emptied and a new task is added. Might not be a problem but worth being aware of.

#

@slender iron Back from vacation (with a cold ๐Ÿ˜ฆ ) and with a growing focus on CP. Will aim to make the meeting today!

solar whale
#

Does anyone have an example for using the "non-blocking" read_pulses in the Ciircuitpython adafruit_irremote library?

tulip sleet
#

@idle owl @slender iron do you understand why this travis build is failing? https://travis-ci.org/adafruit/Adafruit_CircuitPython_CircuitPlayground/builds/387798697?utm_source=github_status&utm_medium=notification

$ circuitpython-build-bundles --filename_prefix adafruit-circuitpython-circuitplayground --library_location .
Traceback (most recent call last):
  ...
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/circuitpython_build_tools/build.py", line 157, in library
    shutil.copyfile(temp_file.name, output_file)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'build-adafruit-circuitpython-circuitplayground-py-0b681c3.zip/lib/adafruit_circuitplayground/express.py'

Is it because I removed __init__.py? I thought that file was superfluous if it's empty.

raven canopy
#

@marble hornet no need for attribution, but thank you for the consideration. @umbral dagger thanks for explaining the details. I was thinking along those lines, but couldn't explain it well enough.

stuck elbow
#

@tulip sleet wouldn't that be ImportError and not FileNotFountError?

tulip sleet
#

right, so I don't think that's the problem. It's like the expected zip file name is wrong

#

well maybe not zip file name, but it's very odd

onyx hinge
#

@tulip sleet in normal python anyway, __init__.py must be present to indicate that the directory is a Python package. I don't know about circuitpython specifically, though.

stuck elbow
#

@onyx hinge in "normal python" yes, in Python3 no

onyx hinge
#

apparently I'm not up to date @stuck elbow

stuck elbow
#

it's hard to keep up with what they change

prime flower
#

huh, MS acquired github today

stuck elbow
#

ayup

#

Microsoftยฎ Githubโ„ข

prime flower
#

woah, that's a large sum of money...

ruby atlas
#

doubt it's all cash

stuck elbow
#

yeah, half is paid in juicero subscriptions

prime flower
#

@stuck elbow if we're going on their naming schemes you mean - Microsoft Sharepoint Code Revision R1 V24.4, Patch 3?

stuck elbow
#

could have been worse, could be Oracle...

#

actually, the bootloader we are using on the samd boards is by Microsoft too

#

they've been doing some good stuff with the embedded electronics

ruby atlas
#

Microsoft has been reinventing itself lately.

stuck elbow
#

I still have a hard time trusting them โ€” you know, most of the same people are still there in the management positions

#

it will take a generation or two

prime flower
#

didnt want to get into MS politics (there's a few employees on this discord), just express interest that the platform circuitpython is on got acquired

stuck elbow
#

sorry

#

not that we can't move the repos at a moment's notice

#

the automation would take some work to rebuild, though

onyx hinge
#

gitlab has CI but I've never used it

ruby atlas
#

works great.

stuck elbow
#

I wonder how many times this has to happen before people understand how to use a distributed version control system :)

manic glacierBOT
onyx hinge
#

Yes, but the pull request model as implemented on github is decidedly centralized. and arguably it is the key feature of github that made it sensible for so many projects to centralize there.

slender iron
#

@tulip sleet that error should be reproducible locally. its something with the build script

idle owl
#

@solar whale Not that I know of.

solar whale
#

@idle owl thanks - it definitely behaves "differently" trying to make sense of it.

idle owl
#

It came out of a project I did - that's when we realised the IR code itself was blocking and nothing I did in my code could change that without changing the lib. I haven't looked at it since it changed though.

solar whale
#

If you enable it - simpletest and your example both don't work

#

its fine as long as blocking=True

idle owl
#

Good to know.

solar whale
#

I like the Neopixel control you did for the Ikea lamp demo - works nicely.

idle owl
#

Thank you ๐Ÿ˜ƒ

marble hornet
#

thank you @umbral dagger

solar whale
#

I was thinking of a basic robot control for a CPX/Crickit using IR to control, but need it to be non blocking.

idle owl
#

Ah. So you're sorting through how to do that

solar whale
#

yes - I am making some progress, but was wondering how anyone has actually made the non-blocking work. Especially with the mini-remote

#

Having a lot of fun with the crickit

#

I also discovered that my monitor is a nasty source of IR noise! -- it went away when I disabled "energy saving" ๐Ÿ˜ฆ

marble hornet
#

@umbral dagger ohhh it's a pointer thing !

#

?

umbral dagger
#

@marble hornet Basically, yes. Only one object gets created, and put into each cell in the list.

marble hornet
#

thanks, it makes sense now

tidal kiln
#

anyone run cookiecutter lately? (for starting new cp lib)

#
  File "./LICENSE", line 3, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'now'.
  File "./LICENSE", line 3
    Copyright (c) {% now 'utc', '%Y' %} {{ cookiecutter.author }}{% if cookiecutter.company %} for {{ cookiecutter.company }}{% endif %}
slender iron
#

@tidal kiln did you try updating cookiecutter? looks like its in jinja2-time dependency

tidal kiln
#

hmmm. actually. i just installed it. it wasn't on this box for some reason.

#

ah. hold on. i apt installed it...

#

@slender iron works with pip version. my bad. thanks.

slender iron
#

cool cool. no worries

wraith tiger
#

That looks like Postscript code.

tulip sleet
#

@slender iron what repo is the circuitpython-build-tools script in? I thought it was, uh, the circuitpython-build-tools repo, but apparently not.

slender iron
#

its running build bundles

#

its just been pip packaged

tulip sleet
#

ah, ok, got it tnx

slender iron
#

<@&356864093652516868> meeting in a few minutes!

fluid helm
#

Hey @slender iron won't be able to make it tonight. Sorry ๐Ÿ™

slender iron
#

no worries @fluid helm

raven canopy
#

I'm late getting on the road, thinking to myself "I could just listen in..." Haha ๐Ÿ˜„

hollow ingot
#

Group hug and hugs to all the PyPI, Thonny and other maintainers (Punyforth, Espressif) for the work they've done and for patiently and capably handling issues.

raven canopy
#

Actually yeah. I'll be a fly on the wall. Force the kid to listen...

errant grail
#

Group hug and thanks to Dan and Scott for giving some suggestions for how to work with some memory limitations. Thank you!

wraith tiger
#

Just my standard: General kudos to all (group hug).

hollow ingot
hollow ingot
#

Built landscape and double-landscape Hackintosh and Windows 10 images for testing of cross-platform tools.

Built https://vgkits.org/blog/connecting-intro/ information - cross platform instructions for getting started (fairly generic to any ESP8266).

Built cross-platform vgkits-vanguard package to deliver command line tools to adopters of Vanguard, cutting the install steps and complexity opening up use of Circuitpython, Espruino, Adafruit_Blinka, and even Punyforth to a single command and a <20 second flashing routine.

See https://pypi.org/project/vgkits-vanguard/ for my first ever tool published to PyPI! It works too ๐Ÿ˜ƒ

errant grail
#

Besides pushing memory limits due to some large string arrays and trying to use OLED and TFT display libraries for text, been predominately heads-down revising some PCB designs. Reached my limit for hand-soldering and needed to make some adjustments. (Met my hand-soldering nemeses: SOT-723 and SOT23-5.) Still need to experiment with CPy memory management approaches but Iโ€™m enjoying the learning process.
Will complete the CPy-based DSP-G1 MIDI synth this week. Also plan to send the next batch of four โ€œRoverโ€ PCBs to OSH Park in a couple of days.
Off topic: my bandโ€™s final gig is Saturday. A great 15-year run with my brothers from another mother. Mixed emotions.

#

... and bring back Carl and Jerry?

prime flower
#

(banned & muted)

slender iron
#

thanks!

hollow ingot
#

Sorry this is the best landing page for connecting to Vanguard (or any other CircuitPython/Micropython ESP8266 assuming you have the drivers) over USB using vgkits-vanguard https://vgkits.org/blog/vanguard-usb-howto/ welcome feedback and issues if this can be of use to anyone else. All the other links I shared are not so useful.

tulip sleet
#

@hollow ingot I took a peek at your pip3 guide. A lot of people end up doing sudo pip3 install because they get complaints about file permissions otherwise, but the sudo is usually a bad idea. pip3 install --user ... is the antidote to that, which might be good to mention if you think it would make sense.

umbral dagger
#

Awesome board. 2 wings on a metro

hollow ingot
#

Thanks @tulip sleet ! I forget to be explicit since on Debian/Ubuntu --user is the default.

idle owl
wraith tiger
#

I just did a bit of reading/research last week. This week I'm going to concentrate on working my way through the micro:bit micropython documentation and trying as many of the examples as I have the ability to try. I've found a few things to recommend documentation improvements for.
After getting through the documentation I'll check out bitio. Then I'll figure out what to do next.

ruby atlas
#

have to hop off

hollow ingot
#

Soon --user might be the pip default. Fingers crossed. However, there is debate about what the antonym should be. Debian went with --system, --global is now favoured I think. When that's in, they can consider --user as default cross-platform.

errant grail
#

We enjoy background ambience.

#

CCL is pretty cool.

tulip sleet
#

@hollow ingot yeah I think it's not actually the default, or may not have been in 16.04.

wraith tiger
#

๐Ÿ‘‹

errant grail
#

Thanks everyone!

umbral dagger
#

cool. later

prime flower
#

have an ultrawide - don't snap, too much space that still doesn't get used up

hollow ingot
#

@tulip sleet this is what the page should have read (including the --user flag) https://vgkits.org/blog/vanguard-tools-howto/ Sorry old page linked from step 3 was the wrong one (still pointed to the crazy complicated version which was eliminated by our PyPI package). This is the super simple one.

idle owl
#

@tulip sleet I'm looking at your PR on the CPX lib. That all works and doesn't create the touch object until you need it? I don't know of a way to test the backend stuff on CPX so I'm asking (I assume it functions for touch, I'm talking about whether it works for the reason we did all that nonsense in the first place to make it so it wouldn't init the pins and keep them in case you wanted to use touch with some external peripheral on one of the pins)

hollow ingot
#

@slender iron do you want to email me at cefn@cefn.com so I can CC you on the conversation with Phil on use of names?

tulip sleet
#

@idle owl right, it still doesn't create the object until you call .touch_A2 or whatever. When you do that it look in ._touches(2), and sees whether there's a Pin object at the position or a TouchIn object. If there's a Pin object, it replaces it with a TouchIn(that pin) object.

idle owl
#

Ok keen.

tulip sleet
#

i'm working on why travis is failing. It is because there's no __init__.py, but there's something weird about the build.py script that's causing the error.

idle owl
#

Oh ok right

slender iron
idle owl
#

I can't merge it yet anyway, forgot travis failed.

slender iron
#

@hollow ingot and I should add www. support. it works without it

hollow ingot
#

Github seems to have added www for you ๐Ÿ˜ƒ

#

I blame microsoft!

slender iron
#

no need to blame them

hollow ingot
#

Teehee

idle owl
#

@tulip sleet Can we also remove the two LIS3DH try/except blocks at this point? The ones that say you need to be running 2.2.0+. I feel like that should be a given at this point. Even the ones that shipped with it shipped higher.

#

I also had another question about how we're checking compatibility and whether one way is more efficient than the other.

#

(I told myself to write this stuff down, and I didn't, nearly forgot.)

tulip sleet
#

is that for ustruct vs struct and collections vs ucollections??

idle owl
#

Neither, it was because there was no shake functionality in the older version.

#

Or tap.

#

Had nothing to do with struct or collections.

tulip sleet
#

oh, oh, you mean in Express. I was looking in the LIS3DH library.

idle owl
#

Oh, sorry. Yes.

#

I meant they were in LIS3DH blocks in the Express class, sorry

#

That would get rid of 8 lines of code and however many characters they have.

ruby atlas
#

wow the price diff for 3 vs 10 boards isn't very big at oshpark

idle owl
#

Oh and I think we can remove it from detect_taps too, I think that's why there's a try/except in there as well.

tulip sleet
#

@idle owl I think that's fine. It's still an error, and we can cover any issues in the forum. It will save yet more space. I'll make another commit with that.

idle owl
#

@ruby atlas I think they price by area, so it all depends on what you're requesting.

#

@tulip sleet Ok good.

ruby atlas
#

oh, yeah, looks like a medium run is smaller than that board's area x 10 ๐Ÿ˜ƒ

idle owl
#

@tulip sleet II have one more question too, but it's a little more complicated to type I think

tulip sleet
#

do you want to a/v chat? and should we meet with Scott

#

I just had "lunch"

idle owl
#

We can. So did I, heh

#

I think maybe what I just suggested fixes my next question. But it's worth having the answer anyway.

#

I'll brb. Then we can chat.

idle owl
#

Ok

slender iron
idle owl
#

@tulip sleet Ooh. So I added *tone() code to the sound_level code and it works! (While the code is still running anyway). I can use loud_sound() to trigger a tone and there's no issues. So the PDMIn fix must have resolved that.

tulip sleet
#

aah, so maybe it's still timing related somehow

#

since it fails without tone, right?

idle owl
#

Correct, it fails simply printing the sound_level to the serial console.

tulip sleet
#

๐Ÿ˜ฆ

idle owl
#

It eventually hangs with the extra code added too, but it's hanging the same way without anything else in it, so it's not related to running tone and mic at the same time. It's still the same hang.

#

(So cool though, I can blow on it and it'll play a tone for the duration of the breath and stop when I stop.)

#

I keep jumping into the REPL to stop it from getting to the point of hanging.

#

Have to jump into the REPL to edit the code too or it'll hang while trying to edit the code and then the code doesn't save.

marble hornet
#

@tulip sleet and @idle owl may i ask why the 'u's as added to some of the name. and do you know where uheap went in 2.3.1?

idle owl
#

It's when it's a carryover from MicroPython - u is shorthand for mu, which is the symbol for micro.

tulip sleet
#

The us came from MicroPython's versions of these modules. They made u versions for a number of standard regular Python modules. We are trying to go back to the original names, and make our versions be subsets of the original functionality, so you can move the code over to regular Python easily. The MicroPython versions were not necessarily proper subsets.

#

uheap is a debug module -- I don't think it's turned on in general. You have to enable it in the build.

marble hornet
#

ah, thanks!

tulip sleet
#

and kattni is pointing out the origin of why they choose "u" as the prefix

marble hornet
#

ฮผ?

idle owl
#

Correct

marble hornet
#

like ฮผfarrad or ฮผtesla

#

?

tulip sleet
#

ya

marble hornet
#

thanks

prime flower
#

or ฮผCenter (Microcenter) if you're retail-inclined

tulip sleet
#

ฮผPython

marble hornet
#

is there a way to check the amount of unfilled memory?

idle owl
#
gc.mem_free()```
#

If you're asking what I think you're asking.

wraith tiger
#

...and ฮผflash, though it's written uflash, it's pronounced "microflash."

marble hornet
#

thank you ( i can't wait for my samd51 pcb comes in!!)

#

@idle owl @tulip sleet thank you

tulip sleet
#

@idle owl is this also 2.2.0 protection?

        try:
            if value == 1:
                self._lis3dh.set_tap(value, 90, time_limit=4, time_latency=50, time_window=255)
            if value == 2:
                self._lis3dh.set_tap(value, 60, time_limit=10, time_latency=50, time_window=255)
        except AttributeError:
            pass
idle owl
#

Yes.

tulip sleet
#

got it will remove the try-execpt wrapper

idle owl
#

Because there was no tap, so it failed trying to set tap.

#

Ok excellent

tulip sleet
#

removing the try's saves another 264 bytes, for a total of 628

idle owl
#

Nice!!

#

@tulip sleet I'm going to test it before merging.

tulip sleet
#

tnx - worth it

tidal kiln
#

@slender iron in process of setting up new repo for lib work..got to step on setting up readthedoc service for the repo on github -> there's a warning banner saying "Services" are being deprecated. (your guide shows this process)

idle owl
#

@tulip sleet Ok tested. Merging. Do you want to do the release?

tulip sleet
#

sure

surreal saffron
manic glacierBOT
rigid path
tidal kiln
marble hornet
#

are ```"""
many line comments"""

tidal kiln
#

uses the logger feather wing, but general idea would be the same

#

@marble hornet i think so

rigid path
#

@tidal kiln -Thank you, I will check it out.

marble hornet
#

@tidal kiln thank you

#

aren't they strings?

tidal kiln
#

yes. multiline string literals. but when used as comments, they aren't being assigned to anything.

#
>>> g = "hello"
>>> g
'hello'
>>> g = """hello
... world"""
>>> g
'hello\nworld'
>>> "hello"
'hello'
>>> """hello
... world"""
'hello\nworld'
>>> 
#

but when used in certain locations, they are considered docstrings

slender iron
#

@tidal kiln does it have a link to more info?

surreal saffron
#

What does this do in a repl?
class Foo: 'docstring'
Foo.doc

#

What does this do in a repl?
class Foo: 'docstring'
Foo.doc

#

... what's code mode? ๐Ÿ˜‚

#

test

idle owl
#

@surreal saffron It's three backticks on either side for a code block or one on either side for inline code. The backtick is in the upper left hand corner of a US keyboard.

tidal kiln
#

```python

code goes here

#

or like this `#code goes here`

surreal saffron
#

Thanks.

tidal kiln
surreal saffron
#

As I was saying...
What does this do in a repl?

class Foo: 'docstring'
Foo.__doc__

That'll tell you if docstrings are kept around.

reef seal
slender iron
#

@tidal kiln yup, I've been doing plain webhooks and the guide needs an update

#

@reef seal the commit the submodule includes should match the latest release from the sub-repo

idle owl
slender iron
#

@idle owl my guess is capitalization

idle owl
#

@slender iron Thank you I will try that.

reef seal
#

@slender iron OK gotcha

#

So basically need to add a new release tag on the submodule

slender iron
#

@reef seal yup, plus updating the PR to point to that commit

reef seal
#

If I tag the existing latest commit that's ok? Or I need to generate a new commit also?

#

As long as it's pointing to the latest release I think that's what you're asking for

slender iron
#

@reef seal existing commit is just fine. its the release that matters

#

our adabot process will automatically try and update it to the latest release

tidal kiln
#

@idle owl looks like it passed?

idle owl
#

@slender iron THANK YOU.

reef seal
#

cool

slender iron
#

๐Ÿ˜ƒ

tidal kiln
#

oh. it was the previous commit?

idle owl
#

I put in another commit on Scott's suggestion and it fixed it.

#

@slender iron For adding it to RTD, who am I supposed to be logged into RTD as? Because I'm in as me and it doesn't look right, there's not the list I think I'm supposed to be seeing.

slender iron
#

I do it as myself

idle owl
#

hmm ok

slender iron
#

there is an adabot account I add as admin too

#

I can't remember it exactly

idle owl
#

I have that in my notes.

slender iron
#

the other repos should have it

idle owl
#

@slender iron I'm adding the webhook, and I have in my notes to "select individual events" and then I have "create" and "push". I don't see one that is create, there's a bunch with create in the description of what they are, but I don't think that's right. What do I select when I'm adding the webhook URL to GitHub?

slender iron
#

they must have changed them

#

push is all you really need

idle owl
#

Ok.

#

Any idea what create was?

slender iron
#

I think for releases

idle owl
#

There is a "releases" check box

tidal kiln
#

@idle owl ha! i just went through this

idle owl
#

Should I add "Releases"?

tidal kiln
#

which side are you setting up? github or rtd?

idle owl
#

GitHub

tidal kiln
#

are you under repo -> Settings -> Webhooks?

idle owl
#

Yes, already clicked add new, pasted the URL, now I'm choosing the individual events on which to trigger the webhook

tidal kiln
idle owl
#

No.

#

So the answer is no, push is fine. And I don't need to select individual events, I can leave it on "just the push event" apparently?

tidal kiln
#

think so give it a try

#

i'm actually testing this right now for a repo i just created...

idle owl
#

Seems to work so far. Adding to CircuitPython now.

#

@tidal kiln The alias, does it have underscores in it, like adafruit_circuitpython_libname or is it without underscores

tidal kiln
#

alias where?

idle owl
#

When adding a subproject to CircuitPython

#

oh nm

#

I looked at another one.

#

it's just libname

tidal kiln
#

is this a submodule?

idle owl
#

it's a library. The subproject list in CircuitPython is the big list I remember seeing. It isn't that I was logged into RTD under the wrong login, it's that I hadn't gotten to that step yet.

#

@tidal kiln I requested your review on adding the lib to the bundle.

#

hmm.

#

Wait really? I thought it didn't care if there were multiple .py files in the examples folder. I thought it was only an issue in /

#
/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/matrixkeypad/examples
Multiple top level py files not allowed. Please put them in a package or combine them into a single file.```
#

Dinner is here. I'll be back in a bit.

tidal kiln
#

@idle owl added comments in PR for when you get back

marble hornet
#

@errant grail i'm also working on text libraries for circuit python, wanna chat. i'm curious how you are approaching it. mind chatting?

#

and i know it is late but:

tulip sleet
#

@idle owl

[submodule "libraries/drivers/stmpe610"]
     path = libraries/drivers/stmpe610         path = libraries/drivers/stmpe610
     url = https://github.com/adafruit/Adafruit_CircuitPython_STMPE610.git         url = https://github.com/adafruit/Adafruit_CircuitPython_STMPE610.git
+[submodule "libraries/matrixkeypad"]
+    path = libraries/matrixkeypad
+    url = https://github.com/adafruit/Adafruit_CircuitPython_MatrixKeypad

should libraries/drivers/matrixkeypad or libraries/helpers/matrixkeypad, I think

marble hornet
#

#hug_report @raven canopy , @tulip sleet , @solar whale, @slender iron , @stuck elbow, and all the other names that are escaping me. Thank you for answering my prodigious amount of questions. iv'e been able to make leaps not strides in my project. couldn't have done this without you.

tulip sleet
#

happy to help!

marble hornet
#

speaking of questions

#

...?

#

may i?

tulip sleet
#

ga

marble hornet
#

github

#

ah!

#

so;

#

when i'm making alterations to a cloned repo, and have been doing it for a while, how can i get the most recent updates to the master w/out overwriting my previous local edits ?

#

did i say that well enough?

tulip sleet
#

sure, so you're working on code in a repo, and meanwhile it's changing out from under you on master. So make a branch and commit your changes to the branch, or "stash them"

tidal kiln
tulip sleet
#

did you fork the repo?

#

or just clone it?

marble hornet
#

fork

#

for circuit python

tulip sleet
#

cater has the info, then

marble hornet
#

tnx

tulip sleet
#

work in a branch, and you can keep resyncing master, and merge or rebase the changes from master into your branch

manic glacierBOT
slender iron
#

@surreal saffron reviewing your PR now. Thanks for the patience!

manic glacierBOT
#

Simple test, on Metro M0 with a 3492 breakout. But you don't actually have a microphone connected to get the hang.

import audiobusio
import time
import board
import array

# Our microphone
mic = audiobusio.PDMIn(board.D1, board.D9, sample_rate=16000, bit_depth = 16)
samples = array.array('H', [0] * 200)

i = 0
while True:
    i += 1
    num_recorded = mic.record(samples, len(samples))
    print(i, num_recorded)

To provoke a hang, do something some filesystem operati...

idle owl
#

@tulip sleet ah bugger.

#

@tidal kiln I don't see comments from you.

tulip sleet
#

your bug is just another manifestation.

#

oh, i meant re PDMIn, not the bundle

tidal kiln
#

@idle owl ๐Ÿค” look now?

tulip sleet
#

yeah, the comments don't show until you submit a review

idle owl
#

Yah they're there now.

#

I followed the instructions in the "adding a library" in the readme for the bundle.

#

I don't know how to add the path, manually edit the file after doing the git submodule add ?

tidal kiln
#

forgot to click the submit review button

idle owl
#

oh wait.

tidal kiln
#

i think i've just manually edited the .gitmodules file in my fork, then PR'd that back

tulip sleet
#

Try git mv matrixkeypad drivers. I think they finally made that work in git. Try that and then check .gitmodules

idle owl
#

It added it this time.

#

I did the remove procedure and then readded it

tulip sleet
#

correct the bundle README?

idle owl
#

I'm not sure how to update it. I should have looked at the structure of the rest of the libs, I guess. (How as in what to update it to, not how as in the actual updating of it.)

tulip sleet
#

It says:

Determine the best location within libraries for the new library and then run:

#

So maybe just say "Determine the best location within libraries (libraries/drivers/ or libraries/helpers/) for the new library and then run:"

idle owl
#

Passed!

tidal kiln
#

passed

idle owl
#

@tidal kiln Do you have merge permissions on that repo?

tidal kiln
#

prolly

#

@tulip sleet do you know how critical the .git is at the end of the repo URL?

tulip sleet
#

it's not at all

idle owl
#

@tulip sleet Should I close the record/playback issue since it's fixed in master? The hanging isn't specific to that.

#

@tidal kiln Oh right I forgot to check that since it showed both of your review points as fixed when I added the different folder structure.

tulip sleet
#

i think it may be the same bug, or maybe not. You can close it in favor of keeping #879 open.

idle owl
#

ok.

tulip sleet
#

You can say either this bug is fixed or it's another manifestion of #879.

idle owl
#

Yah on it

manic glacierBOT
idle owl
#

@tidal kiln I can add it and push again

#

Actually there are others without it.

#

Found them scrolling down to get to the bottom.

#

AMG88xx and Seesaw

tidal kiln
#

are there? meh. then i'll get over it. don't worry about it.

idle owl
#

And Fingerprint.

#

๐Ÿ˜ƒ Ok

tidal kiln
#

want me to merge?

idle owl
#

Yes please

tidal kiln
#

done

manic glacierBOT
#

The symptom is that the loop around common-hal/audiobusio/PDMIn.c:397 (MICROPY_VM_HOOK_LOOP) never exits.

In the older 2.x code, this line is in start_dma():

    I2S->DATA[1].reg = I2S->DATA[1].reg;

Writing the register provokes the transfer to start, according to the datasheet.
If I add a similar line around the // Record line in PDMIn.c, but with the subscripts changed to [0], then I get a worse crash: I get a hard fault in the MSC code, and the ASF4 device struc...

tulip sleet
#

@slender iron are you willing to take look at #879 a bit? I wrote some more notes. Perhaps some fresh eyes would help. I'm happy to look at it some more but not tonight. tnx.

slender iron
#

I have a bit of time now @tulip sleet

idle owl
#

@tulip sleet What's the current status of ESP32? Still "we're not developing for it, but we'll pull it from MicroPython when dev there for it is complete. No ETA." ?

#

In terms of CircuitPython.

tulip sleet
#

@idle owl that's a good summary

#

it's not on the 4.0 horizon

idle owl
#

Ok thanks

#

The SPI flash on the Express boards is 2MB right?

tulip sleet
#

right

idle owl
#

Thank you

#

@tidal kiln Do the CP boards need to be placed in the bootloader to load an Arduino Sketch?

tidal kiln
#

can't remember.

idle owl
#

Oh

tidal kiln
#

but bootloader definitely works

idle owl
#

Ok.

#

I'll say that then.

tidal kiln
#

easy enough to test

idle owl
#

If you have Arduino installed, yes.

#

I never went through getting it all setup again after my other machine was stolen.

tidal kiln
#

i just do it so fast and often i'm not sure

idle owl
#

Ah

tidal kiln
#

so scenario is you've got a board running CP and want to program Arduino?

idle owl
#

Yes. The actual scenario is "How do I switch between CircuitPython and Arduino", but that is the part I'm answering right now is CP to Arduino

tidal kiln
#

let me check. the other detail i can't recall is if a main.py is running what happens.

idle owl
#

My answer was "If you're currently running CircuitPython, double-tap the reset button on the board to get the board into the bootloader, and then load your Arduino sketch."

tidal kiln
#

didn't need to reset

idle owl
#

Oh.

#

So literally just load the Arduino sketch?

tidal kiln
#

seems like. testing it various ways.

idle owl
#

Nice

#

Thank you

tidal kiln
#

i'm pretty sure it's meant to do that, but there may be some weird edge cases that may require a double reset.