#circuitpython-dev
1 messages ยท Page 172 of 1
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. ๐ฆ
did you try my suggestion yet?
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. ๐
not exactly because pulsein uses an interrupt every edge
I'm suggesting using the TC to count pulses
(TC.EVACT = COUNT)
so use the COUNT, instead of it's internal... yeah.
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
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. ๐
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.
right, thats why I think dividing down is the way to go
i can definitely attempt it. alright i'm off. lunch and the punishment of golf awaits us... ๐ ๐
byeee!
Looks like the nrf52 build is failing due to missing the mp state singleton definition.
I will add that. And the esp8266 too.
Then again, I'm not sure it makes sense, since they don't have the tick required for the gamepad to work. I think I need to add an ifdef.
Actually the nrf port has the system tick and supports gamepad, that's cool!
CPy MIDI sniffer mod for OLED wing. Work in progress. https://youtu.be/U_K38mXqN60
Initial test of CircuitPython OLED Sniffer
Sniffing MIDI data?
Yes. The version that sends output to the REPL or terminal window works nicely, but the OLED wing version occasionally blocks incoming data.
Interesting. That's super neat though!
Needed it to learn more about the MIDI protocol stack. I now know enough to be musically dangerous.
An excellent thing to be
@tulip sleet I'm trying to follow the same process we're asking of everyone else. Can you approve this for me? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/204
PSA: The SAMD51 datasheet was updated last month. Make sure you are using it.
@tulip sleet Thank you
Sorry, I commited some files that shouldn't go there by mistake, and had to do some rebasing to fix it.
@slender iron - they didn't change the dates on the datasheet page ๐ Errata is also updated. (I submitted a website bug report.)
datasheet page with obsolete dates: http://www.microchip.com/design-centers/32-bit/sam-32-bit-mcus/sam-d-mcus#mchp-Data Sheet
@slender iron @raven canopy In this new revB version of the samd51 datasheet:
@slender iron do you have time for a quick consult before the mtg? could be in mtg video or discord. re event system
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...
@tulip sleet sorry, was prepping for the meeting
@slender iron @tulip sleet thanks for the heads up on updated sheet. I may get a chance to peek at it tonight..
1897ce4 restore I2C and UART. Don't do port.c resets an... - dhalbert
c37b69e Make the gamepad singleton long-lived - deshipu
b219ce6 Add gamepad_singleton to root pointers - deshipu
d02899f Add gamepad_singleto to root pointers for the n... - deshipu
6479cb0 Merge pull request #868 from pewpew-game/gamepa... - tannewt
@rhooper That sounds amazing! I've been thinking we should factor out a bunch of the code shared between the RGB strip classes. On the non-express boards we'll still have size trouble though it'd be worth it given the speedups.
I think the audio stuff will get some attention along with the upcoming gaming handheld in the long term.
In the short term, could you try clearing second_buffer here as well? https://github.com/adafruit/circuitpython/blob/master/shared-module/audioio/WaveFile.c#L116 No need to keep it around if the object is deinited but still in a namespace.
My thoughts on how to handle low memory boards is to keep the logic in neopixel and dotstar, but also check if CircuitPython has the pixelbuf helpers present. If present, it'll use the fast implementation, if not, it'll use the pure python.
This will let us exclude the code from boards where it's not useful or doesn't fit.
@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.
I'll have a look this afternoon
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
@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!
Text to screen write speed test using CircuitPython and TFT FeatherWing
@stuck elbow Appreciate the I2C clock speed default suggestion for the OLED. I'll give it a try.
could you help @slender iron ? i used the JLink_MacOSX.pkg but it only installed the drivers. i think
@marble hornet have you seen this guide I did? https://learn.adafruit.com/debugging-the-samd21-with-gdb?view=all#jlink-plus-metro-m0-express
its the same process for the 51, you just change the device id
Sounds good. We can play around with it. Thanks!
@slender iron no i did not! thanks
np ๐
CircuitPython badge, latest prototype.
<@&356864093652516868> anyone around to voice chat about error messages?
Sure
There's some previous discussion on this on: https://forums.adafruit.com/viewtopic.php?f=60&t=125609&p=630394#p630394
As mentioned, I ended up breaking the encapsulation and writing directly to the array for a bit more speed. I didn't feel too dirty as it was toy code but it's not ideal!
@slender iron Sure, if channel is still going on this topic?
ya
hello
Hello @simple pulsar
I have a quick question re: instructables.com - is there a preferred category for Adafruit / CircuitPython?
I have no idea, I haven't dealt with instructables. Are you writing one up and wanted to know how to categorise it?
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?
Not that I'm aware of, but that doesn't mean it hasn't been ๐
Ok, if you spot anything you can add a reply to my recent post on https://forums.adafruit.com/viewtopic.php?f=60&t=136358 which mentions it, thanks.
Ok!
thank you for the help!
thanks for letting me listen in
np
You're welcome @slender iron ๐
@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
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```
adafruit_circuitplayground.express.__version__
@tulip sleet looks like it works way better. thanks!
@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?
@idle owl I think so
I grepped for all calls that needed changes from frequency to sample_rate
Ok.... I thought I forgot doing it, and was entirely confused...
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. ๐
I changed mono to channel_count as well
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!
@idle owl hello - me again - qq on neopixels
Is https://learn.adafruit.com/circuitpython-essentials/circuitpython-internal-rgb-led complete wrt import statements for when the neopixel library is used? Would it not need the import line changed to import neopixel?
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.
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/
Nope. Good catch!
keeps finding bugs
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)
@simple pulsar Give the guide a refresh, and see if that works better for you.
@tulip sleet Thank you!
@tough ridge do you need both halves? You can delete half the list with del l[0:length//2]
it's pretty obscure!
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
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.
@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.
weird
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
The peripheral helpers have been reorganized to separate them out. Over time hopefully they can grow into a more useful library that doesn't depend on ASF4 or MicroPython.
This also makes ticks more atomic which should reduce errors with DHT sensors. @jerryneedell you may want to confirm.
@tulip sleet Sorry... there's another one https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/209
@tulip sleet Thank you
@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.
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?
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...
Off-by-1 error here for channels >= 8 (I had noticed this while debugging PDMIn. If, say, channel == 8, it will shift the channel number by 1 instead of by 0.
Change to:
if (channel >= 8) {
uint8_t value = 1 << (channel - 8);
Same issue at lines 156-157 and lines 171-172, but I can't leave comments there.
Deinitialises -> Deinitializes
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.
@surreal saffron How much space does it free? Ideally we'd find something with a larger payoff.
.oO( we have lzw compression implemented... )
implemented where?
for upip
at the least
and I'm thinking displaying an error message doesn't have to be fast
yeah totally
I have an issue for it
nice
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...
@slender iron ok, made a rotaryio PR on your own PR, via your personal repo
I think it would be convenient if IncrementalEncoder.position was also settable, so you could reset it to zero or whatever.
I did a rough count of how many characters are used for exception strings:
g -l 'raise.*"' |egrep 'ports/atmel-samd|py/|shared-' | xargs egrep -h 'raise.*"' | grep -v // | sed -E 's/.*"(.*)".*/\1/' | sort -u | wc
264 1293 7727
If I run compress (uses LZW) on the strings, it shrinks from 7727 bytes to 4183.
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...
@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??
requesting a code review: https://github.com/adafruit/CircuitPython_Community_Bundle/pull/9 . @slender iron @idle owl
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"
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).
@errant grail Do you need these strings to show on a display or something else human-readable?
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.
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
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.
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
I also found that an unused entry in the table doesn't need a tuple.
but lots of strings just takes space, period
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.
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.
Oh, that would help, indeed. There's a lot of repetition in the control codes table.
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.
@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
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.
Does the CircuitPython atmel-samd port use lwip or axtls?
Great
@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!
@errant grail you could also skip the tuples and index [2*x] instead
Can you share an example of that? I'm still a neophyte...
like in two separate lists?
are tuples memory hogs?
How about libffi? atmel-samd use that?
@errant grail your example would be:
['NRPN_LSB', 'Value',
'NRPN_MSB', 'Value',
'RPN_LSB', 'Value',
'RPN_MSB', 'Value',
``` etc
@slender iron ah, got it.
then the first value is foo[2*code] and the second is foo[2*code + 1]
@surreal saffron I don't think so
very comma-delimited-like
@surreal saffron just checked no
why are you asking? we have no network support in the atmel-samd ports
only in esp8266 port
Double checking my assumptions.
@slender iron also lends itself to Dan's suggestion to keep the verbose descriptions in a file.
nrf port (in progress) uses libffi
The uerrno module lets ports define what errnos they can raise. I want to prune that list for atmel-samd
Okay off to the rabbit hole. Thanks again!
@surreal saffron makes sense - thanks for looking at that!
I've had it half finished since PyCon, heh...
@slender iron have to be out for half an hour or so back soon
kk, I'm code size hunting
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
ยฏ_(ใ)_/ยฏ
if you need a break you could look at another issue
the pdm one should be fixed by 3.0 but we have time
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?
@rigid path I don't think so since they'll both try to power it.
@slender iron - I figured that might happen. Looks like I need to pick up an Adalogger feather wing. Not such a bad thing. ๐
๐
Is lib/berkeley-db-1.xx linked in on atmel-samd?
If not, I think we'll never raise EPERM...
@surreal saffron it's used on the esp8266 port. It's used if MICROPY_PY_BTREE is 1
why do we even have the database stuff enabled
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.
can you make it conditional on the same variable?
no, not really...
I'm running into some basic issues with mpy files on my metro m0. Is it alright if I ask them here?
Yep, ask away! Someone will answer when they can
@stuck elbow actually scratch that, i can - though it's a bit ugly to do so...
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
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?
hmm I pulled from here https://github.com/micropython/micropython
will extmod/machine_i2c.c be linked into the atmel-samd port? (How can I figure this out myself? :D)
@faint summit Ok that might be the problem. You need to use mpy-cross from CircuitPython with CircuitPython
@tulip sleet my local build of pirkey is out of space as well
@slender iron I'm not seeing that, but I will reclone your repo and try again
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)
@idle owl d'oh I see. I'm running on the 3.0.0 beta but it looks like the mpy-cross is behind? (https://github.com/adafruit/circuitpython/tree/master/mpy-cross) Should I just go back to 2.x?
@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?
macos high sierra
@surreal saffron you can just look in the ports/atmel-samd Makefile and/or grep for that file in the atmel-samd tree.
cool - wasn't sure if just the Makefile was enough or there were other places to check...
@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
it shouldn't be and I couldn't find it in the map
the busio constructors take a bunch of space
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
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
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
k
@idle owl Alright, thanks so much! Sorry for making you spoon feed me
@faint summit Don't be sorry! We all started somewhere. When you're ready, I can show you how to build it yourself ๐
is TouchIO incl'd in the crickit CPX build?
Ok, updated as requested. I return early from busio.I2C to save space on pIRkey. Raising NotImplementedError should align with a more correct and expansive solution to this in the future.
Thanks to @sommersoft for spotting the error.
Fixes #850
Can't merge: Conflicting files:
ports/atmel-samd/samd51_clocks.c
ports/atmel-samd/supervisor/port.c
It's always clocks.
today is clock day too ๐
Just don't get ticked at them.
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
Being a CP Code of Conduct, would it replace #code-of-conduct or no?
Just so we're perfectly clear
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.
So submit a review for consideration ๐
The wording is a bit awkward in general because it's a Code of Conduct.
Oh, yeah
But I have to finish reading the whole thing before making any sort of review
That's fair
Rebased and will wait for Travis to verify all boards compile.
@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?
@idle owl instructions for adding something to the bundle is here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle#adding-a-library
do need to know more?
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.
@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
We already discussed that. The Adafruit Be Excellent policy already covers Adafruit spaces. This is being written for CircuitPython spaces.
I just like unified systems, so like to cover everything with as few things as possible
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.
Entirely fair.
#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]
...
@idle owl There, did the review. Mostly pedantic stuff, if I'm being entirely honest
@idle owl Hopefully I get there quick enough ๐
@idle owl I actually have another question if you don't mind
@faint summit Just go ahead and ask the question. Kattni can answer it when she can, or someone else might have an answer quicker.
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.
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.
as a variable type. I'm using lists of ~100 entries, and I definitely need much larger ones
@cunning crypt sweet! a partner in pedanticizing on the CoC! ๐
@faint summit Metro M0 Express, right?
@cunning crypt yep! Ok, maybe not that large, but is it feasible for me to get something like 1000>
The M0 has 32k of RAM.
That's... 32768 bytes
Not counting what Circuit Python uses by itself
or the overhead of each python object
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
Ok, then what are some steps I can do to maximise the list size I can use?
what are you storing in it?
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.
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
Each string has an end character, correct?
So that's an extra character per string
just a lot of floats
(insert "Whatever floats your boat" joke here)
the goal was to get lots of readings so I can take a reliable fft
You probably don't need that many.
@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
@faint summit Don't use a list, use an array - http://circuitpython.readthedocs.io/en/2.x/docs/library/array.html
without any doubt, the maximum number of floats you can fit in memory will be a single array of floats.
@cunning crypt fair enough, I did some quick testing and realised that I need >400 readings.
@faint summit If you can't fit everything into the M0
The Metro M4 has 6 times as much RAM
@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.)
@idle owl I did what was the most obvious and seemed right. I'm not familiar with GIT reviews at all.
@cunning crypt Would you like to learn?
That's a silly question. Of course!
๐
@cunning crypt that looks promising. Do you think this is a realistic fix to this problem?
@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.
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.
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".
Ooh, got it!
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.
@idle owl Done
Beautiful, thank you!
can anyone more familiar with CircuitPython's tests tell me what the heck https://travis-ci.org/adafruit/circuitpython/jobs/386912838 is trying to tell me?
it looks like it failed to find the expected test output - so that's weird.
@surreal saffron expand the "Building Adafruit binaries" section. quite a few errors.. looks like mostly "first use"
aha.
that's probably just a header that needed to be included and wasn't, i'm guessing.
thanks
yeah, with that many, i would start there too. you're welcome!
Also, re-enable calibration storage for CircuitPlayground Express.
Tested with a 500hz PWMOut on Metro M0 with Saleae:
- with crystal 500hz
- with usb 500hz +- 0.1hz
- without either 487hz += 0.1hz
SAMD51 is skipped due to DFLL errata and the fact it defaults to a
factory calibrated 48mhz that works fine for USB.
Fixes #648
@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.
Adafruit_CircuitPython_MatrixKeypad
Oh under Environment Variables?
yeah, so it looks like it hasn't added it
I didn't run it. So I guess that would make sense.
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
I clone the repo and run that inside the repo?
oh thats right, new comp
Yeah... :/
yeah, thats the start. then you need to copy and edit the env.sh template to include your permissions keys
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?
that sounds accurate
I feel like I remember that part of the discussion.
Because you said later sometimes it asks for them
right
Do you want to do that again or no
I don't know. I'm busy poking rosie and am about to peace out for the weekend. can we do it monday?
Yeah, sorry about it trying to get to it so late.
np
@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.
I hadn't seen it. I'll look monday
kk - I'll look at reducing library sizes in a more orderly way.
ideally we'd leave some extra space so we're not always fighting it
@notro Thaks - We encountered the CPX overflow last night and are working on shrinking things. I reduced the size of the one of the frozen libraries by several hundred bytes.
git continues to amaze me. i'm rebasing WIP with the updated SAMD peripherals file/function setup, and its going pretty seamlessly. ๐ ๐
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...
Anyone working on or know of someone that is working on: a CircuitPython driver for L3GD20 Triple Axis Gyroscope.
Version 2
I accidentally commited my hack to remove execution of basics/gen_stack_overflow.py.
@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.
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.
thx
Thanks for looking into it!
I will attempt to convert Adafruit_L3GD20 -> Adafruit_CircuitPython_L3GD20.
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...
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...
Also updates HID to 3.1.2 and seesaw to 1.1.6.
This should make PR #892 build successfully again (CPX build did not quite fit).
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.
Can you load Blink on it via the Arduino IDE? You'll need the latest Adafruit SAMD board support package, version 1.2.0? (And also the Arduino SAMD BSP.)
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
@idle owl would you be willing to approve https://github.com/adafruit/circuitpython/pull/895?
@stoic gazelle it's the same as on the Metro M0 and the Arduino. I'll look for a picture for you.
@tulip sleet I was going to ask if it was something I could do. I'll look at it.
@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!
Ah ok thanks, I am connecting the m4 to a project I started with a feather on a tripler(and a doubler)
forgot to push this in LIS3DH update
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
Tried putting the GPS antenna by the window but it is cloudy out so I'll try again later
@stoic gazelle clouds don't affect GPS signals in any significant way
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?
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
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
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
Oh I'll try that first
if you're using a feather doubler/tripler then the wiring is automatically correct from feather to GPS featherwing
I switched the wires and get the same results, ah okay I'll switch back :)
From the guide https://learn.adafruit.com/adafruit-ultimate-gps-featherwing/overview: The LED blinks at about 1Hz while it's searching for satellites and blinks once every 15 seconds when a fix is found to conserve power.
that's the LED on the GPS featherwing
After switching the wires back to how they were I now have GPS output!
maybe they were just loose or something
congrats!
Thanks to @idle owl for suggesting to switch to the m4!
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...
@tulip sleet If you have a minute, could you approve this for me please? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/211
Could you try this with the absolute latest 3.0 code? @tannewt fixed some stuff with interrupts in #887, and I can no longer duplicate the PDMIn problem in #879 after I update to the tip of master (which is a good thing!).
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...
Use the bt (backtrace) command to get a stack trace to see what's calling _usart_async_set_irq_state.
Did you try Arduino blink?
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...
Oops, oops:
I used update-bootloader-feather_m4-v2.0.0-adafruit.5.uf2
You need to use update-bootloader-metro_m4-v2.0.0-adafruit.5.uf2. There are many pin differences between the two boards
Nice catch @dhalbert. I was about to ask/suggest using different USB cables. The messages and print *device output looked like it was a hardware problem to me. Incorrect pins would definitely manifest the same way...
so rebasing wasn't as seamless as i thought... still better than re-writing from scratch, though. ๐
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:/...
Well, good to know that correct bootloader and cables can be ruled out. I think. ๐
I just loaded Arduino IDE. Had to update my BSP to 1.2.0. I did get the "Warning: non trusted" message after the update ran. Closed the IDE, re-opened (normal, non-admin), and the M4 boards showed up for me. Also on Win10, with the Windows Store version of the IDE.

Didn't attempt an uploa...
Finally the Arduino IDE showed me the M4 and the blink sketch is indeed working.
Next I tried adafruit-circuitpython-metro_m4_express-3.0.0-beta.0.uf2 once more, but no luck.
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.
there is an incomplete list of boards on the wiki: https://github.com/micropython/micropython/wiki/Boards-Summary
no
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.
@timber mango easier, yes
really depends on your program
SAMD21 has 32kB and that's a bit tight for larger programs
@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...
Yeah, looks identical to me.
Do you have a code.py/main.py running on the board? runtime.serial_connected/supervisor_get_serial_connected shouldn't be called, otherwise. To the best of my knowledge, at least.
I just ran it on the current tip of master, and I get no errors.
@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.
Here is a Metro M4 build that puts CIRCUITPY on the internal flash instead of the external SPI flash chip, to rule that in or out.
mm4-internal-flash-beta.0.uf2.zip.
Also, did you try https://github.com/adafruit/circuitpython/releases/download/3.0.0-alpha.6/adafruit-circuitpython-metro_m4_express-3.0.0-alpha.6.uf2 yet?
I would also try another USB cable, even if that one seems OK.
That gave me an idea, I commented out the maybe_run_list() code in start_mp() and now I have access to the REPL and CIRCUITPY drive. I deleted code.py and restored start_mp() and voila, bak in business!
Thanks @sommersoft and @dhalbert for your help!
This means that the flash eraser I used didn't actually work.
This is the offending code.py, it's tests/basics/fun_error2.py:
# test errors f...
Hmm, yes, the flash eraser was never tested on the M4, and probably won't work because it's QSPI and various other reasons. So perhaps we should have some way of forcing safe mode in case of really broken main.py/code.py or boot.py.
Glad you/we solved this! Thanks @sommersoft!
Hmm, yes, the flash eraser was never tested on the M4, and probably won't work because it's QSP
I used a M4 QSPI eraser, see the first post.
And now I know why I had to flash erase the Feather M0 Express sometimes when I ran the tests working on #893, it was probably the test I was running in code.py that crashed it.
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
@marble hornet try just import adafruit_ds3231. DS3231 is the only defined class, with no additional inheritances which may be causing the error.
yw! i wish i could give a better explanation as to why/why not. i would just be regurgitating information from the pydocs...
wait
@raven canopy dir(adafruit_ds3231.DS3231) says that adafruit_ds3231 doesn't have attribute DS3231
to me, it seems like the same problem
what does dir(adafruit_ds3231) output?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DS3231'```
hmm...
that is after: import adafruit_ds3231
i'm looking right at in the repo... ๐
give me a sec, and let me get a board running the latest libraries.
ill try re-downloading
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. ๐
I tested the tip of Adafruit_SPIFlash on the Metro M4, and it does indeed not work. I'll submit an issue about this and/or try to fix it.
@raven canopy its working now!!! must have been a bad download
thanks for the help
yay! and not sure i helped all that much. hehe
@raven canopy it's the thought that counted, do you know if extended ram is supported yet in alpha ? or beta ?
extended RAM? as in, the new heap management (yes)? or using an external source for RAM (don't know that will ever happen)?
esp32 can use external ram, but samd doesn't have such possibilities
Lesson learned from #894 is that running tests using code.py can lock the board up so a flash erase or custom firmware is the only way out.
@dhalbert:
So perhaps we should have some way of forcing safe mode in case of really broken main.py/code.py or boot.py.
hi! how does one get info out of a time_struct ? thanks for help either way!
@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
@raven canopy thank you, and sorry. i didn't think to check there. my bad.
here is the parameter list: https://circuitpython.readthedocs.io/en/latest/shared-bindings/time/__init__.html#time.struct_time
and no worries! i'm used to looking everything up, so its become second nature. ๐
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
heh. yeah, i type Markdown all over the place now, thanks to GitHub and Discord... _ instead of ctrl+i.
markdown?
@raven canopy
also #running_out_of_memory oh yay!
another question:
what would happen if i put main.py in the frozen modules ?
The planet would implode.
We wouldn't recommend it. Un-imploding the planet is a bit difficult, as you may imagine.
too late: https://qntm.org/board
The International Earth Destruction Advisory Board (IEDAB) is an independent scientific institution which monitors the current status of the Earth and the number of times it has been destroyed. In the event of the Earth being destroyed it will be the IEDAB's job to relay this...
I learned a new word: Geocide
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.
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.
@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.
@tulip sleet wait what! frozen modules save ram! is that b/c they are .mpys ?
.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.
what! thank you
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
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
sorry @astral vessel i should have used a better string
Now if I'm in the main while loop, input() is going to block until it receives a newline. That's not very useful behavior. Is there a way to check for data in a buffer or something and act on it when there is? Like the behavior in the UART example here: https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial
@astral vessel That is a deficiency we've discussed but not solved yet: https://github.com/adafruit/circuitpython/issues/231
ah, well fortunately I can work around that
@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.
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="")
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
@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>], [], []]
>>>
@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.
@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.
@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?
@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!
Does anyone have an example for using the "non-blocking" read_pulses in the Ciircuitpython adafruit_irremote library?
@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.
@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.
@tulip sleet wouldn't that be ImportError and not FileNotFountError?
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
@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.
@onyx hinge in "normal python" yes, in Python3 no
apparently I'm not up to date @stuck elbow
it's hard to keep up with what they change
huh, MS acquired github today
woah, that's a large sum of money...
doubt it's all cash
yeah, half is paid in juicero subscriptions
@stuck elbow if we're going on their naming schemes you mean - Microsoft Sharepoint Code Revision R1 V24.4, Patch 3?
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
Microsoft has been reinventing itself lately.
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
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
sorry
not that we can't move the repos at a moment's notice
the automation would take some work to rebuild, though
gitlab has CI but I've never used it
works great.
I wonder how many times this has to happen before people understand how to use a distributed version control system :)
Modified the CCS and SGP30 guides to match the naming consistencies.
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.
@tulip sleet that error should be reproducible locally. its something with the build script
@solar whale Not that I know of.
@idle owl thanks - it definitely behaves "differently" trying to make sense of it.
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.
If you enable it - simpletest and your example both don't work
its fine as long as blocking=True
Good to know.
I like the Neopixel control you did for the Ikea lamp demo - works nicely.
Thank you ๐
thank you @umbral dagger
I was thinking of a basic robot control for a CPX/Crickit using IR to control, but need it to be non blocking.
Ah. So you're sorting through how to do that
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 Basically, yes. Only one object gets created, and put into each cell in the list.
thanks, it makes sense now
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 %}
@tidal kiln did you try updating cookiecutter? looks like its in jinja2-time dependency
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.
cool cool. no worries
That looks like Postscript code.
@slender iron what repo is the circuitpython-build-tools script in? I thought it was, uh, the circuitpython-build-tools repo, but apparently not.
ah, ok, got it tnx
<@&356864093652516868> meeting in a few minutes!
Hey @slender iron won't be able to make it tonight. Sorry ๐
no worries @fluid helm
I'm late getting on the road, thinking to myself "I could just listen in..." Haha ๐
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.
Actually yeah. I'll be a fly on the wall. Force the kid to listen...
Group hug and thanks to Dan and Scott for giving some suggestions for how to work with some memory limitations. Thank you!
Just my standard: General kudos to all (group hug).
Just knocking out a few dents.
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 ๐
Started just trying to build out the pre-steps to https://vgkits.org/blog/connecting-with-miniterm/ and as the steps to get there became more and more insane had to solve it via building my own PyPI package.
As an alternative to the Vanguard Tools, we can useย minitermย directly toย make the connection from our terminal emulator to the Vanguard board. The command
Installing pip3 means you can install python packages to your machine using a single command line from a terminalย like... pip3 install pyserial See our i
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?
(banned & muted)
thanks!
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.
You can connect over WiFiย to the Vanguard board's python shell, but connecting over USB is useful as your development work becomes more advanced. Find out mor
@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.
Awesome board. 2 wings on a metro
Thanks @tulip sleet ! I forget to be explicit since on Debian/Ubuntu --user is the default.
@ruby atlas https://oshpark.com/shared_projects/VHkoUs2Z
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.
have to hop off
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.
@hollow ingot yeah I think it's not actually the default, or may not have been in 16.04.
๐
Thanks everyone!
cool. later
have an ultrawide - don't snap, too much space that still doesn't get used up
@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.
@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)
@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?
BTW http://www.tannewt.org/ doesn't resolve to an IP address from here.
@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.
Ok keen.
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.
Oh ok right
@hollow ingot I'm scott@adafruit.com
I can't merge it yet anyway, forgot travis failed.
@hollow ingot and I should add www. support. it works without it
Github seems to have added www for you ๐
I blame microsoft!
no need to blame them
Teehee
@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.)
is that for ustruct vs struct and collections vs ucollections??
Neither, it was because there was no shake functionality in the older version.
Or tap.
Had nothing to do with struct or collections.
oh, oh, you mean in Express. I was looking in the LIS3DH library.
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.
wow the price diff for 3 vs 10 boards isn't very big at oshpark
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.
@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.
@ruby atlas I think they price by area, so it all depends on what you're requesting.
@tulip sleet Ok good.
oh, yeah, looks like a medium run is smaller than that board's area x 10 ๐
@tulip sleet II have one more question too, but it's a little more complicated to type I think
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.
Ok
<@&356864093652516868> Here is the recording from today's meeting: https://youtu.be/QTwU0tLXZm4
Notes with timecodes are available here: https://gist.github.com/tannewt/4d83201b46796ae8a784e7aa411243fe Join here for the chat all week: http://adafru.it/...
@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.
Correct, it fails simply printing the sound_level to the serial console.
๐ฆ
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.
@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?
It's when it's a carryover from MicroPython - u is shorthand for mu, which is the symbol for micro.
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.
ah, thanks!
and kattni is pointing out the origin of why they choose "u" as the prefix
ฮผ?
Correct
ya
thanks
or ฮผCenter (Microcenter) if you're retail-inclined
ฮผPython
is there a way to check the amount of unfilled memory?
...and ฮผflash, though it's written uflash, it's pronounced "microflash."
thank you ( i can't wait for my samd51 pcb comes in!!)
@idle owl @tulip sleet thank you
@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
Yes.
got it will remove the try-execpt wrapper
removing the try's saves another 264 bytes, for a total of 628
tnx - worth it
@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)
@tulip sleet Ok tested. Merging. Do you want to do the release?
sure
Any feedback on https://github.com/adafruit/circuitpython/pull/891 ? 
Currently working through this.
I've begun working on this. I will be pinging various people for help with their suggestions if needed.
Is there a guide out there for getting an M0 Adalogger Feather setup for Circuit Python use? I found a start guide but I only see Arduino info, (https://learn.adafruit.com/adafruit-feather-m0-adalogger/) or am I just not reading this correctly?
@rigid path check this one: https://learn.adafruit.com/data-logging-with-feather-and-circuitpython/overview
are ```"""
many line comments"""
uses the logger feather wing, but general idea would be the same
@marble hornet i think so
@tidal kiln -Thank you, I will check it out.
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
@tidal kiln does it have a link to more info?
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
@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.
Thanks.
@slender iron yep. this looks like the one with the deets: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
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.
@slender iron Could you give me more info on your comment: https://github.com/adafruit/CircuitPython_Community_Bundle/pull/9
Not sure what you're asking for
@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
Sphinx is failing on the first line and I'm not sure why. It's obviously something not entered right but I'm looking at other libs and they all start that way. By first line I mean 23. First line of the docstring. https://github.com/adafruit/Adafruit_CircuitPython_MatrixKeypad/blob/master/adafruit_matrixkeypad.py
@idle owl my guess is capitalization
@slender iron Thank you I will try that.
@reef seal yup, plus updating the PR to point to that commit
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
@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
@idle owl looks like it passed?
@slender iron THANK YOU.
cool
๐
oh. it was the previous commit?
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.
I do it as myself
hmm ok
I have that in my notes.
the other repos should have it
@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?
I think for releases
There is a "releases" check box
@idle owl ha! i just went through this
Should I add "Releases"?
which side are you setting up? github or rtd?
GitHub
are you under repo -> Settings -> Webhooks?
Yes, already clicked add new, pasted the URL, now I'm choosing the individual events on which to trigger the webhook
do you have this link in your notes?
https://docs.readthedocs.io/en/latest/webhooks.html#github
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?
think so give it a try
i'm actually testing this right now for a repo i just created...
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
alias where?
When adding a subproject to CircuitPython
oh nm
I looked at another one.
it's just libname
is this a submodule?
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.
That's what gets it to cp.rtd.io/projects/libraryname
@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.
@idle owl added comments in PR for when you get back
@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:
@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
#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.
happy to help!
ga
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?
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"
@marble hornet i think you're asking this: https://help.github.com/articles/syncing-a-fork/ maybe?
cater has the info, then
tnx
work in a branch, and you can keep resyncing master, and merge or rebase the changes from master into your branch
This is no longer an issue right?
@surreal saffron reviewing your PR now. Thanks for the patience!
Unfortunately, still is. I can provoke a hang by doing a filesystem operation.
1c35dbf Provide mp_errno_to_str even without uerrno - Matt Wozniski
e798b67 Begin a custom list of errnos for atmel-samd - Matt Wozniski
22f4438 Prune atmel-samd errno list - Matt Wozniski
d0e6bb2 Use the system errno's on nrf - Matt Wozniski
0c7c082 Merge pull request #891 from godlygeek/low_flas... - tannewt
@jepler Please create a new PR when changes are upstream. Thanks!
Has anyone figured out why the test is so bad? This is what I was hitting with Rosie as well! We should definitely fix for 3.0.0.
@notro mind filing an issue for the test failure itself? Thanks!
e37d562 tools: Add cpboard.py - notro
d08cc2a tests: Point pyboard.py to tools/cpboard.py - notro
52cc3ed Merge pull request #893 from notro/cpboard - tannewt
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 ๐ค look now?
yeah, the comments don't show until you submit a review
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 ?
forgot to click the submit review button
oh wait.
i think i've just manually edited the .gitmodules file in my fork, then PR'd that back
Try git mv matrixkeypad drivers. I think they finally made that work in git. Try that and then check .gitmodules
correct the bundle README?
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.)
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:"
Passed!
passed
@tidal kiln Do you have merge permissions on that repo?
it's not at all
@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.
i think it may be the same bug, or maybe not. You can close it in favor of keeping #879 open.
ok.
You can say either this bug is fixed or it's another manifestion of #879.
Yah on it
I am able to use sound_level, loud_sound, start/stop_tone and play_tone in the same code with the latest build of 3.0. sound_level stops printing while it's playing something, but it doesn't crash and continues to work.
The sound_level code eventually hangs. The hanging has been identified as potentially the same issue as in #879. Closing this issue in favor of that one.
@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
are there? meh. then i'll get over it. don't worry about it.
want me to merge?
Yes please
done
All required steps have been completed: travis, RTD, added to bundle. Ready to go!
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...
@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.
I have a bit of time now @tulip sleet
@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.
right
Thank you
@tidal kiln Do the CP boards need to be placed in the bootloader to load an Arduino Sketch?
can't remember.
Oh
but bootloader definitely works
easy enough to test
If you have Arduino installed, yes.
I never went through getting it all setup again after my other machine was stolen.
i just do it so fast and often i'm not sure
Ah
so scenario is you've got a board running CP and want to program Arduino?
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
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."
didn't need to reset
seems like. testing it various ways.
i'm pretty sure it's meant to do that, but there may be some weird edge cases that may require a double reset.