#circuitpython-dev

1 messages ยท Page 123 of 1

slender iron
#

yeah, that was my plan too

#

could you read the jitter on 21 2.x too?

tulip sleet
#

I didn't try that - though that's a good idea. It took me a while to find '21 pins to feed GCLK0 to.

#

it's like 1.5-2MHz jitter

#

according to the Rigol scope

#

I have a 100 MHz scope

slender iron
#

ah mines 50mhz

tulip sleet
#

I just added stuff like lines 93-96 for '21; I should have looked further down.

#

tnx

slender iron
#

np

tulip sleet
#

btw, did discord just lose all your "read" history? Mine reset to the beginning of time or august or something

slender iron
#

nope, its been fine

tulip sleet
#

weird, ok

slender iron
#

its also interesting that multiple peripherals have a max clock speed of 100mhz

#

ADC is one of them and I think SERCOMs are that way too

tulip sleet
#

yeah, the BAUD settings for I2C were out of range on the'51 because it was assuming a 120MHz clock, or something. I can't remember exactly but I had to change it. It might have just been wrong in the config files. That's when I thought the algebra was wrong.

slender iron
#

ah

tulip sleet
slender iron
#

k thanks. I'm trying to do a straight port

tulip sleet
#

me too! your basic code is great - I'm just changing all the details. For instance, the pad stuff in SPI you coded up saved a lot of headache

slender iron
#

yeah, its complicated but seems to work

tulip sleet
#

are the peripherals similarly weird on other manufacturers' ARM chips? I haven't looked at any. OR maybe the Atmel ones are relatively sane.

slender iron
#

I have a little experience with stm32 but not much more

#

they have some wizard software too

tulip sleet
#

k - I need to take a break; I did not do my PT exercises yet. I hurt my back a bit a couple of weeks ago (it's better) and am doing strengthenign and posture stuff

slender iron
#

k, thanks @tulip sleet. I hope it gets better!

tidal kiln
#

oof. yah. can't imagine intense chair sitting is good for that.

tulip sleet
#

@tidal kiln it actually started from sleeping on a bad mattress when we away for a couple of days. I have a good chair. But I did a lot of soldering this morning (made an Arduino shield to Feather adapter for testing) and was hunched over

slender iron
#

was it a metrowing?

tulip sleet
#

yeah - it's metro to feather. I think siddacious or somebody has one of these on oshpark, but it isn't tested yet. I just used a proto shield and wires. Also made up an SPI connector/cable for the 6-pin connector on the metro since it has the easiest SPI pins to configure

slender iron
#

ah ok. yeah the metrowing was done by siddacious. I have pcbs but haven't assembled them

tulip sleet
tidal kiln
#

nice url on the silk adabot

slender iron
#

k, I'm off. talk with you all tomorrow!

tawny creek
#

`>>> from board import *

import busio
import Adafruit_seesaw
import time
from micropython import const
import adafruit_ina219
myI2C = busio.I2C(SCL, SDA)
ina219 = adafruit_ina219.INA219(myI2C)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'INA219'

`

#

can someone help me figure out where to go from here?

glacial bronze
#

looks lik,e you skipped an underscore in "adafruit_ina219"

#

or whatever it should be

#

But it's not a space

hollow tartan
#

is latest version of Wireshark with USBPcap safe to install in Win7Pro/64?

tawny creek
#

wha, where? i see _'s

glacial bronze
#

oh heckie, it's an artifact on my screen. Yeah, they're there

#

do a dir(adafruit_ina219)

tawny creek
#

NameError: name 'adafruit_ina219' is not defined

glacial bronze
#

import adafruit_ina219 again?

hollow tartan
#

@idle owl do you have a minute?

tawny creek
#

>>> dir(adafruit_ina219) ['__name__', '__path__']

idle owl
#

@hollow tartan Just a minute yeah. What's up?

hollow tartan
#

@idle owl HI. I will be getting some M0 express soon. what do I need to install? testing and debugging wise?

tawny creek
#

@hollow tartan ๐Ÿ˜ƒ programming the same board right now ๐Ÿ˜„

idle owl
#

@hollow tartan Congrats ๐Ÿ˜ƒ

hollow tartan
#

@tawny creek Cool.

idle owl
#

What OS are you using?

glacial bronze
#

@tawny creek Try putting adafruit_ina219.py directly into /lib/, rather than in a subfolder

hollow tartan
#

oh win 7 pro 64

tawny creek
#

just that on it's own? without the rest?

#

one momento sir!

#

same thing~

idle owl
#

For the most part you need an editor, and a terminal program that allows a screen type connection. That's what I use for degbugging almost exclusively. I use Atom for my editor, and I'm on a Mac, so I'm using iTerm. On Windows Atom will work, and I use Putty for establishing a serial connection and using the REPL.

tawny creek
#

`Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Feather M0 Express with samd21g18

import adafruit_ina219
dir(adafruit_ina219)
['name', 'path']
`

glacial bronze
#

let me start up my CPX

hollow tartan
#

@ kattni check^3

tawny creek
#

tyty!

idle owl
#

Ok, I'm headed out. Good luck!

hollow tartan
#

yep, Good Night.

glacial bronze
#

Okay. I have replicated your problem, Cascade :v

tawny creek
#

:<

hollow tartan
#

@tawny creek Are you downloading and installing premade .bin or rolling your own?

glacial bronze
#
>>> dir(adafruit_ina219)
['__name__', '__path__']```
tawny creek
#

@hollow tartan premade ;3

hollow tartan
#

@tawny creek That's fine. I like the header info on the CP startup. Tells all it knows.

tawny creek
#

good way to test builds ๐Ÿ˜„

#

reaaaly enjoying the experience so far :] aside from random ??'s like these that i stumble on

hollow tartan
#

@tawny creek what are a few SW bugs between friends? LOL

tawny creek
#

thankfully not a school project or similar where timing matters

#

just gotta find something else to tinker with in the meantime xD

glacial bronze
#

I'm still poking at it FYI

tawny creek
#

๐Ÿ˜ฎ

#

same, im googling

#

thanks for looking at it @glacial bronze -- just soldered up the connections and all xD , tested it with same component with an arduino to test it first xD

glacial bronze
#

so it works on Arduino IDE but not CircuitPython? Or it works on CircuitPython now?

#

I cannot make it chooch

tawny creek
#

let me rephrase: using another ina219 module and arduino - i was able to test out the module's behaviour and use --

#

so i was confident about soldering up the connections with my feather for CP

#

xD

glacial bronze
#

I don't even have a module. I just can't get the module to import correctly

#

It's like it imports a blank file

tawny creek
#

im not sure for which version of CP the driver was designed with

#

maybe some sort of configuration somewhere -- above my head

glacial bronze
#

It might be a 1.x module, or maybe a 3.x beta module

tawny creek
#

hm does 3x have a list

pastel panther
#

Where did you get the driver from?

tawny creek
#

the interweebs

pastel panther
#

I wasn't able to reproduce your issue on my metro m0:

Adafruit CircuitPython 2.1.0-13-gd183b66 on 2017-11-11; Adafruit Metro M0 Express with samd21g18
>>> import adafruit_ina219
>>> dir(adafruit_ina219)
['INA219_CONFIG_GAIN_4_160MV', 'INA219_CONFIG_GAIN_8_320MV', 'INA219_REG_SHUNTVOLTAGE', '__file__', 'const', 'INA219_REG_BUSVOLTAGE', 'INA219_CONFIG_MODE_POWERDOWN', 'INA219_REG_CONFIG', 'INA219_CONFIG_SADCRES_11BIT_1S_276US', 'INA219_CONFIG_BADCRES_10BIT', 'INA219_CONFIG_GAIN_MASK', 'INA219_CONFIG_BADCRES_MASK', 'INA219_CONFIG_MODE_SVOLT_TRIGGERED', 'INA219_CONFIG_SADCRES_10BIT_1S_148US', 'INA219_CONFIG_SADCRES_12BIT_128S_69MS', 'INA219_CONFIG_SADCRES_12BIT_64S_34MS', 'INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS', 'INA219_REG_POWER', 'INA219_REG_CURRENT', 'INA219_CONFIG_SADCRES_9BIT_1S_84US', 'INA219_READ', 'INA219_CONFIG_SADCRES_12BIT_1S_532US', 'I2CDevice', 'INA219_CONFIG_BVOLTAGERANGE_32V', 'INA219_CONFIG_BADCRES_11BIT', 'INA219_CONFIG_BVOLTAGERANGE_MASK', 'INA219_CONFIG_MODE_SVOLT_CONTINUOUS', 'INA219_CONFIG_MODE_BVOLT_CONTINUOUS', 'INA219_CONFIG_SADCRES_12BIT_32S_17MS', 'INA219_CONFIG_BADCRES_9BIT', 'INA219_REG_CALIBRATION', 'INA219_CONFIG_MODE_MASK', 'INA219_CONFIG_GAIN_1_40MV', 'INA219', 'INA219_CONFIG_SADCRES_12BIT_4S_2130US', 'INA219_CONFIG_SADCRES_12BIT_16S_8510US', 'INA219_CONFIG_MODE_SANDBVOLT_TRIGGERED', 'INA219_CONFIG_SADCRES_12BIT_2S_1060US', '__name__', 'INA219_CONFIG_BADCRES_12BIT', 'INA219_CONFIG_RESET', 'INA219_CONFIG_GAIN_2_80MV', 'INA219_CONFIG_BVOLTAGERANGE_16V', 'INA219_CONFIG_MODE_ADCOFF', 'INA219_CONFIG_SADCRES_12BIT_8S_4260US', 'INA219_CONFIG_SADCRES_MASK', 'INA219_CONFIG_MODE_BVOLT_TRIGGERED']
#

did you install the library and driver bundle?

tawny creek
#

i did

#

ill re-download

glacial bronze
#

I used a pre-baked image that included a bunch of stuff

#

but not ina219

#

Very slightly different and older build on mine Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18

pastel panther
#

I build mine from the CP 2.x branch a couple days ago

glacial bronze
tawny creek
pastel panther
#

For the above I downloaded the adafruit_ina219 library from git, copied it onto the metro in the root directory, then downloaded the bundle zip from the link above, unzipped it and copied the lib directory into the root of the CIRCUITPYTHON dir

tawny creek
#

so the adafruit_ina219 folder is in your root dir?

pastel panther
#

not a folder, just the adafruit_ina219.py file

#

I downloaded the zip of the ina219 repo, unzipped it and copied over the file

errant grail
#

@idle owl Thank you very much for recommending Atom. I've been looking for an intuitive CP code editor for my Win 10 machine. Atom is perfect for the job and was easy to learn. I was coding in less than 5 minutes tonight (including the download)! I have a new coding hammer now! ๐Ÿ”จ ๐Ÿ˜ƒ blinka

glacial bronze
#

I just updated to the latest daily build and put the .py file in root, and import worked

tawny creek
#

aaaaah im trying to get repl to load

pastel panther
#

is the serial device showing up?

glacial bronze
#

I just downgraded back to the major release, and the .py in root also loads

pastel panther
#

cool

tawny creek
#

having issues with the repl

pastel panther
#

What exactly is the problem?

tawny creek
#

trying to ctrl+D to try things out but it just hangs o-O

#

trying to exit out of autoreload

pastel panther
#

Ctrl+C then any key to exit the autorun program

tawny creek
pastel panther
#

Ctrl+D reloads the program

tawny creek
#

which version of the major release @glacial bronze

#

i'm on 2.1.0 with the .py on root

glacial bronze
#

2.1.0 from the major release page

tawny creek
#

still getting __name / __path on dir(adafruit_ina219)

glacial bronze
#

Make sure you don't have another copy of it somewhere

tawny creek
#

yep no other copy elsewhere

pastel panther
#

And you copied the lib directory from the bundle zip into CIRCUITPY?

tawny creek
#

adafruit-circuitpython-bundle-2.1.0-20171019.zip

#

yup

#

still the same thing. when you guys say bundle, did you mean the bundle linked here with a zip that only has a 'lib'

#

or

pastel panther
#

unzip the zip you just mentioned and copy the lib directory to the CIRCUITPY

tawny creek
#

did

#

deleted the old one and replaced it

#

`Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Feather M0 Express with samd21g18

import adafruit_ina219
dir(adafruit_ina219)
['name', 'path']`

pastel panther
#

so when your done, your CIRCUITPY should look like

 ~$ ls /Volumes/CIRCUITPY/
adafruit_ina219.py    boot_out.txt        lib
glacial bronze
#

I just did the raw UF2, which came with a significant library

tawny creek
#

which one?

glacial bronze
#

Scroll down to Downloads

#

a .bin has to be flashed with a programmer or something?. A .uf2 can be dropped into the storage after double-tapping the reset button

tawny creek
#

imma do it

pastel panther
#

depending on your bootloader you might be able to use bossac otherwise you'll need a jlink or something similar. The .uf2 should work though

tawny creek
#

kay just plopped that on, it remounted

#

should the directory be fresh again?

#

I still see the same files from before.

pastel panther
#

No, you should see the same files

tawny creek
#

`Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Feather M0 Express with samd21g18

import adafruit_ina219
dir(adafruit_ina219)
['name', 'path']

`

#

used the uf2

pastel panther
#

can you paste what's in your CIRCUITPY directory?

glacial bronze
#

what is adafruit_ina219.__path__

tawny creek
#

ls /Volumes/CIRCUITPY/ System Volume Information code.py adafruit_ina219.py lib boot_out.txt

#

adafruit_ina219.path
'adafruit_ina219'

glacial bronze
#

heck

tawny creek
#

it has _ _

#

_

#

`>>> import adafruit_ina219

dir(adafruit_ina219)
['name', 'path']
adafruit_ina219.path
'adafruit_ina219'`

#

where is the latest daily build

glacial bronze
#

pick board, pick a uf2

#

newest at the top

tawny creek
#

ill try this one

#

ty for the patience guis ><

#

tada

#

`>>> import adafruit_ina219

dir(adafruit_ina219)
['INA219_CONFIG_GAIN_4_160MV', 'INA219_CONFIG_GAIN_8_320MV', --

#

yay

pastel panther
#

w00t

tawny creek
#

also os x noticed it is a usb HID device and prompted setup

#

which didnt happen previously

glacial bronze
#

spiffy

tawny creek
#

do you want me to try switching back to 2.1.0

glacial bronze
#

blows a raspberry

#

It works, that's fine

tawny creek
#

yeeeey ๐Ÿ˜„

#

i can finally -- continueeee

glacial bronze
#

Thanks for helping, Sidd

pastel panther
#

no problemo

tawny creek
#

bows @pastel panther @glacial bronze

#

making a battery overlay for my retropie build btw

#

X)

sick creek
#

how you get battery status?

pastel panther
#

cool. Let me know how it works. I had an eye on that current monitor for a LiPo project I'm working on

tawny creek
#

for sure! ๐Ÿ˜„

tawny creek
#

Hey @sick creek sorry got caught up with assembling this thing. What do you mean?

sick creek
#

@tawny creek how you get battery data to battery overlay?

tawny creek
sick creek
#

cool

hollow tartan
#

@slender iron I was looking at the Segger JLINK EDU and wanted to know what IDE is being used to debug CP? breakpoints, register inspection, etc. blinka Wait, I found a CLUE: ~$ arm-none-eabi-gdb /home/sheep/dev/circuitpython/uf2-samd/build/metro_m4/update-bootloader.elf GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 7.12.1.20170417-git Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later Segger Jlink Manual states IDE GDB Debug support YES Flash download YES Flash breakpoints YES Trace support NO SWO support NO

tawny creek
#

`Adafruit CircuitPython 2.1.0-14-g065a319 on 2017-11-14; Adafruit Feather M0 Express with samd21g18

from board import *
import time
import busio
import gamepad
import Adafruit_seesaw
from micropython import const
import digitalio
import adafruit_ina219
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 768 bytes`

argh! is there a way i could make this fit? I only need to measure the voltage on the ina219 x)

hollow tartan
#

@tawny creek My idea would be to wait a month and use a M4 device. More of everything on an M4!

tawny creek
#

:p

hollow tartan
#

can you import sub-library on something instead of the whole library?

tawny creek
#

thats what im not sure how to do rn :X

#

we'll seeee

solar whale
#

@tawny creek have all the .py files been converted to .mpy?

stuck elbow
#

@tawny creek that library won't work with seesaw, it assumes the buttons are connected directly to the pins

tawny creek
#

@solar whale nope, how do you do that? And @stuck elbow ๐Ÿ˜ข๐Ÿ˜ข

solar whale
#

@tawny creek get teh mpy-cross tool from https://github.com/adafruit/circuitpython/releases then mpy-cross file.py this will create file.mpy -- this reduced the amount of RAM needed to load the script. It does not reduce the amount of memeory it actually uses. Replace the .py file on your board with the .mpy. I am assuming you are not building your own circuitpython images. If you are, then you already have mpy-cross.

#

since you are running out of memory importing the adafruit_ina219.py that would be the one to convert.

#

it looks like there is a .mpy version of seesaw in the repo. if you are able to use it

slender iron
#

@hollow tartan I use jlink as a debugger when I need it

#

and by jlink I mean gdb

tawny creek
#

thanks @solar whale going to try this now

#

are there plans to make/is it possible to have the feather joywing/seesaw supported by the gamepad hid library? @slender iron

slender iron
#

no, I'm not sure its needed

#

I haven't looked into the seesaw API. Is it possible to miss button presses with it?

tawny creek
#

tried to get the gamepad library working last night but couldnt figure out what to pass for the pins on the seesaw -- i think the joy featherwing does a bunch of bulk_digitalread

slender iron
#

you don't need the gamepad library for the joy featherwing

idle owl
#

@errant grail You're welcome! That's why I started with Atom - programming was already daunting, I didn't need learning an editor to be another barrier. I'm so glad it worked for you!

fading solstice
#

@slender iron With respect to tagging bundle libraries: It's seems easy enough to create a new tag for each of the libraries. But there seems to be a extra .zip file containing the .mpy. To be complete, that .zip file should contain a 1.0 and a 2.1 version of the .mpy file. Maybe we should just have a link to the bundle releases and not have the this extra file? What do you think?

slender iron
#

@fading solstice yeah, thats been tricky. either we should do that or have the travis auto-build build them all. @timber lion would have an opinion on it

stuck elbow
#

I would love if we could somehow name those files differently, and make different versions of circuitpython automatically pick the correct one

#

and fall back to .mpy

tawny creek
#

@solar whale
`>>> ina219 = adafruit_ina219.INA219(myI2C)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'INA219'

dir(adafruit_ina219)
['name', 'file']

`

#

was having this issue last night and i thought i just fixed it o_O

stuck elbow
#

looks like it failed to import?

#

what's in the file?

slender iron
#

@tawny creek did it fail to import previously?

#

by it I mean adafruit_ina219

tawny creek
#

all i did was replace adafruit_ina219.py with adafruit_ina219.mpy

#

nope it imports

#

`>>> import adafruit_ina219

`

stuck elbow
#

for some reason micropython/circuitpython doesn't delete from sys.modules the modules that failed to import

tawny creek
#

tried replacing it with the regular ol' .py version

#

same thing

stuck elbow
#

did you look inside the file?

tawny creek
#

which file, the .mpy file or the code.py file?

stuck elbow
#

the adafruit_ina219.py

tawny creek
#

its all compiled

#

since im using .mpy

stuck elbow
#

you said you tried both .mpy and .py?

tawny creek
#

yep

stuck elbow
#

so the .py is not compiled

tawny creek
#

.py worked before i replaced it

#

now it doesnt work even though its the same file as before

stuck elbow
#

ok, where did you get the .mpy from?

tawny creek
stuck elbow
#

ok, which version of the mpy-cross?

tawny creek
#

should i try using the mac compiler instead?

stuck elbow
#

that could work

#

I don't have a pi handy to try that

tawny creek
#

copied the adafruit_ina219 from my mac & replaced the one made by my raspberry pi . opened repl and import adafruit_ina219 returns no errors

`>>> import adafruit_ina219

dir(adafruit_ina219)
['name', 'file']`

stuck elbow
#

interesting

solar whale
#

@stuck elbow a while ago - we played witht the VL53L0x on micorpython and CP. You might find this forum thread of interest https://forums.adafruit.com/viewtopic.php?f=19&t=126516 after you converted the pololu library, I tried using the much shorter one by Popunder and it worked, but I never understood why. In response to a request, I started using it again and have it running on a trinket_M0! I'm still not sure why it works ....

timber lion
#

@fading solstice @slender iron ah interesting idea personally i wouldn't bundle all the different versions in a single zip as it's just a temp state for people to be going from old to new versions. i'm thinking it would be confusing for people to see multiple mpy files and they'd have to be separated by directories or people would have to know to rename (or even uglier they'd write code against 'import adafruit_ina219_201' which would be really bad)

tawny creek
#

i just replaced the regular .py adafruit_seesaw with the .mpy version and its loading fine

timber lion
#

so IMHO stick with what we have an what is working, separate files on releases and separate bundles

stuck elbow
#

@solar whale yeah, I've heard that that shorter library works especially well after you use the sensor with the arduino one, so that it calibrates it

timber lion
#

almost sounds like the version generated by the py mpy-cross is using more memory

stuck elbow
#

@timber lion how about .mpy1 .mpy2 etc.?

#

or something similar

timber lion
#

i dunno is it worth solving the problem is my question ๐Ÿ˜ƒ

#

are we having trouble with 2 versions on downloads today? that's probably the big q to answer first before engineering solutions

#

and do we expect someone to be in a state where their FS should work with old and new versions of code

#

that seems kinda odd to me, can't think of a reason for it to be more than a temp state for someone

#

er old and new versions of python firmware that is

solar whale
#

@stuck elbow ah - interesting. But I tried it with a new sensor lat noght and it worked as well. At least I think it was new. Does the sensor have NVRAM that stores calibration informatiion if it has been used?

timber lion
#

by yeah for the ina219 import how big is the mpy file I wonder? is the one generated by py different size vs. mac?

tawny creek
#

one momento @timber lion

#

from 16KB to 4KB

stuck elbow
#

@solar whale it doesn't, that's the funny part

timber lion
#

personally i don't think we should distribute mpy-cross binaries.. it's really hard to distribute binaries for different platforms. if you clone the circuitpython repo and run make in the mpy-cross dir on a pi i'd be curious if its generated binary works or doesn't either

#

woah there's the problem

#

something is seriously up with the pi version if it's generating a 16kb mpy

#

that definitely won't be parsed

tawny creek
#

wait, this one's the mac version

#

let me check the pi version

solar whale
#

@stuck elbow I had assumed itwas just letting the "defaults" be used and they were close enough for reasonable function.

tawny creek
stuck elbow
#

@solar whale one very annoying thing about those sensors is that they don't have sane defaults

slender iron
#

mpy-cross generates circuitpython bytecode binaries so it should be the same regardless of the platform used to build it

stuck elbow
#

@solar whale you have to actually read some data out of them, compute the defaults, and set them โ€” that's why there is so much code

#

bbl

solar whale
#

@stuck elbow agreed, but I seem to get decent results. Still exploring why.

timber lion
#

ah cool yeah that makes sense if the .py version is 16kb

#

one thing, could it be that you accidentally still had the .py file on the FS when trying to use the pi built mpy?

#

perhaps it was preferring the .py version which i could see not fitting in memory

#

and after copying and changing the FS, even deleting files do a soft or hard reset

#

just to be sure the board reloads the FS and reads it fresh

#

vs. seeing old cached files potentially

solar whale
#

It will always use .py over .mpy, correct?

tawny creek
#

pi: 4056 vs, 16142 on the py*

timber lion
#

ah perfect so the pi version mpy seems to be exactly the same bytes as mac

#

can you try again with the pi .mpy version and be double sure you removed the .py version from the board's filesystem? unplug and replug the board or press its reset button too to make sure it's loading everything fresh again

tawny creek
#

yeah the .py file is nowhere and i also cleared up code.py

timber lion
#

there should only be a 'adafruit_ina219.mpy' in the root for example.. check inside the lib folder too just in case to make sure nothing is there (or just delete it to help make a good control case)

tawny creek
#

light is fading in borg green

#

rgr!

timber lion
#

ah cool and yeah try the import adafruit_ina219 again

tidal kiln
#

@timber lion just cloned repo and built mpy-cross on pi3. seems to run at least.

tawny creek
#

now it's
`>>> dir(adafruit_ina219)
['name']

`

#

lost one xD

#

also double checked the lib folder and root directory, only one adafruit_ina219.mpy file

#

im going to try and uploading the uf2 file again like last night

timber lion
#

is the lib not working though?

#

what if you try to use it?

#

i've seen dir doesn't always return everything

#

for complex nested classes.. for a module, yeah kinda weird it doesn't show more

#

but i'd try using it to be sure

tawny creek
#

`>>> ina219 = adafruit_ina219.INA219(myI2C)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'INA219'

`

#

it used to list __name__ and __file__

timber lion
#

ah wow weird! ๐Ÿ˜ƒ

#

i almost wonder if the file is getting corrupted in some way

#

that is very strange

manic glacierBOT
timber lion
#

do you mind sharing the pi generated .mpy here?

tawny creek
#

works now!

#

uploaded the latest release .uf2 file for my board

#

touched nothing else, and repeated steps

#

and now it is working

solar whale
#

Is's a miracle ๐Ÿ˜€

tidal kiln
timber lion
#

wow strange!

tawny creek
#

thanks for walking me through this @timber lion cola @solar whale

solar whale
#

@tawny creek sorry it was not cleaner, but glad it is working.

tawny creek
#

@solar whale it'll make the completion of this even sweeter ๐Ÿ˜„

manic glacierBOT
#

Some questions:

  • Since this just bit bangs a digital port, not sure what the set up and tear down should be for the context manager. Currently, there is nothing.
  • This is a simple modification from the previous code which wasn't really designed with the concept of representing a 'device'. Should the constructor also take in the device address? Then you wouldn't have to pass it in like is being done here:
    https://github.com/ada...
tidal kiln
#

first time getting hands dirty with 1-wire. pretty neat how it works.

lofty topaz
#

@tidal kiln It is isn't it. I had it working on a project about a year ago. Seemed pretty reliable back then. Worked fine.

tidal kiln
#

and by getting hands dirty i mean reading the specs and looking at scope traces all morning. the process for scanning and device discovery is....interesting.

#

the way you chip away at the 64bit addresses

idle owl
#

@tidal kiln That's really cool

tidal kiln
idle owl
#

I ordered that temp sensor.

tidal kiln
#

an evil hack might be to create a device that spoofs all 2^64 addresses. the scan would take a fair amount of time.

lofty topaz
#

@tidal kiln I read the specs, got some books on the subject, wired up some hardware, hacked away at some tutorial code and got it working. Quite nicely I might add. Scope traces are cool, especially storage scopes. Well, now I suppose everything has storage to freeze the trace. But I am surprised 1-wire hasn't seemed to take off the way I thought it would.

tidal kiln
#

@lofty topaz even better. usb logic probes the size of a business card with software protocol analyzers.

lofty topaz
#

@tidal kiln Exactly!!! Such cool equipment, er, uhm, tools.

stuck elbow
#

I really hate protocols that are based on timing

#

a clock line makes everything so much more reliable

lofty topaz
#

What about RS232?

manic glacierBOT
tidal kiln
#

trade offs

stuck elbow
#

yeah, not a fan

lofty topaz
#

Anybody showing anything tonight???

stuck elbow
#

but I'm biased, because I don't like to put oscilators on my boards, and usually use the internal ones

lofty topaz
#

@stuck elbow ๐Ÿ˜ƒ

idle owl
#

@stuck elbow I just ordered the parts to make a Blinka board!

stuck elbow
#

@idle owl careful, I didn't get it to work yet ๐Ÿ˜ฆ

#

there may be hardware bugs

tidal kiln
#

seems like they gave the 1-wire spec plenty of head room to deal with timing variance

idle owl
#

@stuck elbow Noted. I have the first version.

stuck elbow
#

the second one has vcc and gnd shorted

split ocean
#

do we have any example code for shake detection on CPX in CircuitPython?

idle owl
#

@split ocean Not that I'm aware of.

tidal kiln
idle owl
#

@stuck elbow Did you get the first version to work, or also no?

tidal kiln
#

very simple threshold based

stuck elbow
#

@idle owl no, but I used a recycled chip on it, so it may be because of that...

#

@idle owl then again, I never confirmed what was wrong

idle owl
#

@stuck elbow Ok good to know

stuck elbow
#

I'm away from all my tools now

split ocean
#

thanks @tidal kiln I'll have a look

idle owl
#

@tidal kiln Nice!

tidal kiln
#

those blinka pcb's are just cool, even unpopulated

idle owl
#

I know!

lofty topaz
#

@split ocean This will get you the accel x, y, and z. Simple code to make your own shake detector from these values.

from adafruit_circuitplayground.express import cpx
while True:
x, y, z = cpx.acceleration
print(x, y, z)

idle owl
#

@tidal kiln I was just excited because I have a friend who can actually do the soldering.

stuck elbow
#

actually the usb port is the only hard to solder part on it

idle owl
#

@stuck elbow It was evidently difficult to find too. The majority are through-hole apparently.

stuck elbow
#

I should make a part of the pcb stick out as a USB A plug

idle owl
#

@stuck elbow He does this sort of thing daily, so he'll be able to test it. I'll let you know what comes of it.

slender iron
lofty topaz
#

@stuck elbow Yes, you should, I like those...

stuck elbow
#

and make Blinka larger and put a coin battery on it...

#

@slender iron what does it do?

slender iron
#

gonna start with auto-updating and releasing the bundle nightly

#

(only if there are updates of course)

stuck elbow
#

nice

#

so basically travis, but saner

slender iron
#

yeah kinda

#

automation ftw

lofty topaz
#

@slender iron That's the way to do it. I would...
boot up - load IDE - "get latest" and walla, everything up-to-date. It was so nice.
Just hoped it would build. Otherwise, somebody would get fired.
ahhhh, the good old days... ><>

slender iron
#

they don't fire people for breaking the build now. I broke the gmail build three days in a row during the last week of my internship at google and still got hired on full-time.

lofty topaz
#

Believe me, breaking the build was sacroligious. You just didn't do that.

stuck elbow
#

we used to get t-shirts with "I broke Allegro" the first time you crashed the production stuff back when I worked at the local equivalent of ebay

slender iron
#

๐Ÿ˜ƒ

tidal kiln
#

@slender iron that was you!? i remember those three days without email.

stuck elbow
#

of course everything had 3 layers of caching anyways, so it had to stay broken for like 2 days for the users to actually notice

lofty topaz
#

@stuck elbow Ya, I've seen shirst with I Broke this and that. But when 7 contractors at $75/hr are sitting idle, the boss would get pee ooed something fierce.

slender iron
#

@tidal kiln it never made it to production. thats what continuous testing is for

stuck elbow
#

I guess they are more laid back at large companies.

slender iron
#

like @lofty topaz, it did prevent others from commiting. They just rolled back my breaking code. ๐Ÿ˜ƒ

stuck elbow
#

It's a kind of achievement anyways, as there are many checks before it merges

#

but of course there are ways ๐Ÿ˜‰

slender iron
#

yup ๐Ÿ˜ƒ

lofty topaz
#

The thing is, @slender iron is right, we would either roll back the code or fix it, but this is before Github, we either used clearcase, sourcecode, PVCS, or some other means of controlling the source. It was nuts back then.

#

Each one had there own way of doing things.

split ocean
#

@tidal kiln thanks, that shake detection was just what I needed!

stuck elbow
#

it's a bit funny how the tools have improved in the recent years, and how the languages themselves pretty much stayed as broken as they have always been

tidal kiln
#

@split ocean no prob. you could condense the code a bit if you wanted. it's intentionally overly explicit and verbose to try and be more readable and beginner friendly.

lofty topaz
#

Broken? Sorry, but Microsofts C++ compiler is rock solid in my opinion.

stuck elbow
#

@lofty topaz that's a tool, though

lofty topaz
#

I suppose.

#

The language was pretty well defined tho.

tidal kiln
idle owl
#

I need to put shake into the API. It completely slipped my mind as a function.

stuck elbow
slender iron
#

anybody object to me checking the toolchain .deb into circuitpython? it'll speed up travis and ensure the version is static

lofty topaz
#

@stuck elbow Ya know, I remember seeing a similiar website about using crayons. ๐Ÿ˜ƒ

stuck elbow
#

@lofty topaz fair enough

lofty topaz
#

Put it this way, as a profession, I loved using C++ for the same reason I loved being at places with a sign at the door which read "No Children Allowed". You better well know what your doing are you were gone.

fading solstice
#

@slender iron did you agree to remove deprecated method read_into now?

slender iron
#

yes please @fading solstice

fading solstice
#

ok

tidal kiln
#

is glad he changed that

stuck elbow
#

@lofty topaz I had too much of usability and user experience training over the years to be blaming users for all the mistakes. Human brain is built a certain way and if the language's design doesn't take that into account, it's the design that's inadequate, not the brain.

lofty topaz
#

@stuck elbow Then why is English the universal language yet one of the hardest to learm??? There is a reason they call it "code".

stuck elbow
#

hardest? haha

lofty topaz
#

one of....

stuck elbow
#

English got simplified a lot on the last 200 years

lofty topaz
#

That's true, but computer languages 200 years ago were much harder as well. ๐Ÿ˜ƒ

stuck elbow
#

I could argue that the first computer languages (COBOL and its family) were much, much simpler than today's popular languages โ€” but of course expressing complex problems that we solve today with them was difficult. Kinda as if you stretched the language metaphor to the "uuk" of the first hominid โ€” the language is simple, but it's hard to describe quantum physics in it.

#

So the best language is one that is good both for the human using it, and for the problem being solved. But while humans stay pretty much the same, the problems seem to be changing quite fast in the recent 50 years.

lofty topaz
#

@stuck elbow Is it that problems change? Or that problems are resolved so new one's can be dealt with? Would somebody write a list comprehension in C++ or Python? They are intrinsic to Python yet Python is written in C++.

stuck elbow
#

Python is written in C

lofty topaz
#

details....

stuck elbow
#

different language

#

of course there is also Python written in Python

lofty topaz
#

no, C++ is simply C with classes.

stuck elbow
#

that's not true

#

I can refer you to that FQA for an explanation why

#

C is a very slick and clean language, actually, considering its age

lofty topaz
#

And what if I were to say the difference between a structure and a class is that one defaults to public while the other defaults to private.

stuck elbow
#

I would say you know very little about how C++ works.

#

But let's not get into that.

lofty topaz
#

ok

stuck elbow
#

Because I know very little about it myself.

umbral dagger
#

@stuck elbow Iโ€™d argue that Scheme is very simple and yet can tackle anything we do today, better than most languages in use. I can say the same about Smalltalk.

stuck elbow
#

@umbral dagger forth!

umbral dagger
#

@lofty topaz what @stuck elbow said.

#

@stuck elbow I never did enough with Forth that I feel comfortable commenting on it.

stuck elbow
#

I never did much with lisp and its many cousins, but it seems to me that any dynamically typed language today looks a lot like a subset of lisp if you squint hard enough.

#

Minus the cool features, of course.

sick creek
#

what about linq

stuck elbow
#

is that this sql thing?

lofty topaz
#

I suppose 20 years of C++ doesn't account for much. @stuck elbow is right, I know very little about it.

#

๐Ÿ˜‰

stuck elbow
#

@lofty topaz C++ is a very large language and you only need to know a small subset of it to use it efficiently (yet you need to know much more to actually read and understand all the code that you might find out there)

#

it's like "the good parts" for JavaScript, except everyone pick different parts

idle owl
#

This is a great conversation but I think it might be better suited to #general-chat ๐Ÿ˜ƒ

stuck elbow
#

sorry

idle owl
#

Don't be sorry!

stuck elbow
#

let's move there

lofty topaz
#

my fault. I provoked it. ๐Ÿ˜‹

idle owl
#

Really there's no blame to be had, you guys just manage to make your conversations bigger than they started. It's not a bad thing!

lofty topaz
#

I just don't like people badmouthing C++. That's all. I will defend it.

#

It fed my family for years.

sick creek
#

Circuit your Python

lofty topaz
#

I did

stuck elbow
#

@lofty topaz I have no problem using a language and at the same time seeing its disadvantages.

idle owl
#

@fading solstice Do you want some help with it?

sick creek
fading solstice
#

@idle owl interesting offer. do you know what i up to?

idle owl
#

@fading solstice I do not. I assumed you were creating new releases for those repos. Regardless, if what you're up to is something I could get in line with, I'm up for helping.

fading solstice
#

@idle owl I recently made changes to a dozen library in the Adafruit_Circuitpython_Bundle. I need to create a release for each on them so that those changes are visible to the bundle.

idle owl
#

Ok, so I had the right idea. Is Travis setup on them?

fading solstice
#

once that is done then have dan or scott create a new bundle

#

i have to admit i do not know what travis is or what it does

sick creek
#

travis is CI

idle owl
#

Ok, I don't know how to set it up, or entirely what it does overall, but in terms of what it does for releases, is it creates the .mpy files automatically.

sick creek
idle owl
#

Some of the repos already have it setup, some don't. I think the bundle will make the .mpys automatically anyway, so it might not matter if you're not trying to link to the individual repos.

sick creek
#

read that link @fading solstice

idle owl
#

@slender iron Am I right that the bundle will create .mpys on it's own even if they're not in the repo release?

fading solstice
#

All the libraries are released and configured in the bundle.

idle owl
#

Ok, then it should be fine

fading solstice
#

thank @sick creek

idle owl
#

I've only created a release twice. But it was also already configured for the bundle, so I'm fairly sure the process would be the same...

slender iron
#

@idle owl correct

idle owl
#

Thanks!

fading solstice
#

The only issue is including my chagnes in new releases of the dozen libraries

idle owl
#

Oh hmm. I have to be a contributer to create a release it looks like.

fading solstice
#

we would be learning together!

idle owl
#

Oh excellent!

fading solstice
#

i just asked for the rights to create a release for myself. do you have those right already?

idle owl
#

I do not

#

That's what I was checking

fading solstice
#

oops

idle owl
#

I have it on other repos, not the ones you listed

#

well, not the first one I checked anyway

fading solstice
#

@slender iron is it much more trouble for you to allow two people rights to create a release as it is to allow one person?

slender iron
#

nope, I'm happy to add you

fading solstice
#

and kattni?

idle owl
#

@slender iron That would be great! I'd like to help with creating the releases

slender iron
#

k, I'll make a team to make it easier

idle owl
#

Excellent thank you

fading solstice
#

good thinking there scott

idle owl
#

@fading solstice This works even better because it means we can each create drafts on different ones and then review them for each other.

#

At least I think that's how I remember it working.

fading solstice
#

that sounds good

idle owl
#

Got it. I can do the second half if that works for you. lis3dh onward. I assume we're adding x.x.1 to the current release number?

fading solstice
#

That was suggested by scott

idle owl
#

This is the readinto change right?

fading solstice
#

yes, chaanged read_into to readint. a thankless change

idle owl
#

But crucial!

fading solstice
#

there may have been other changes as well. probably not but possible

#

by other people.

idle owl
#

Ah ok. Yeah, we'll just call out your change then.

fading solstice
#

ok

idle owl
#

My breadboard connections came loose on the M4 NeoPixel setup I had and corrupted the board. Nothing a little jlink can't fix, but wow was that a moment of panic. Laptop disabled all USB peripherals because it was "pulling too much power". And it wouldn't light up with the NeoPixels plugged in. I thought I had smoked it.

fading solstice
#

did you see smoke?

idle owl
#

I did not, but it made unhappy noises. It seems to be ok, it mounts as NO_NAME though

#

It was the noises followed by it not working and the computer having issues with it that had me panicky. It mounted once I unplugged everything from it. I haven't gotten the jlink out again yet, but I've recovered from this state before.

#

And I had my code backed up this time! So bonus there, lol.

fading solstice
#

ha

#

i will com back to this later after i get proper rights

idle owl
#

Same. I'm going to watch the live streams as well.

bronze geyser
#

Just want to clarify about ISRs. They are supported in micropython but not circuitpython. Correct? If this is correct, what is the priority for implementing into circuitpython? (i.e.: in next week's build, in a build six months from now...currently no plans...). Thanks. I'm asking because I'd like to have a LoRa CircuitPython lib. I was going to base it on Radio Head's Arduino lib...

idle owl
#

@tidal kiln Hey a dictionary! (in your dice code)

tidal kiln
#

@bronze geyser correct, and probably very low priority.

bronze geyser
#

@tidal kiln thank you. (wow - did you hear that? It sounded just like the air being taken out of a balloon...that deflating sound...)

idle owl
#

@tidal kiln Oh man. So very dictionary.

tidal kiln
#

@bronze geyser @slender iron would be able to provide a more in depth answer, but it's an advanced feature and the main focus of cp is on providing a good intro experience for beginners.

bronze geyser
#

@tidal kiln (me speaking as a crazy person...but...but...)... beginners should experience the joy of interruption. The joy of flinging packets at each other. This isn't advanced. it is well...it is....life....sure...pretty pretty neo pixels...they blink...but then what? Don't you want to fling a packet-oh-fun and get interrupted in the process?

manic glacierBOT
slender iron
#

@bronze geyser what @tidal kiln said. you could create an issue for RFM support detailing what it needs to be able to do

bronze geyser
#

OK. Dumb ? @slender iron - how do i create an issue?

slender iron
bronze geyser
#

@slender iron thank you.

tidal kiln
#

@bronze geyser also keep in mind we're not trying to replace all existing programming options with CP. once you're wanting to experience the joys of ISR's, maybe you're also ready to experience the joys of C

bronze geyser
#

@tidal kiln i could do C...the big bummer here is C is not prototype friendly. With CircuitPython, we can whip out a sophisticated prototype. Also, programming in C seems a tad anti-Adafruit from the perspective of building things and having fun while doing it. I do not see ISRs as an advanced feature. Rather a critical feature for hw builds that are inclusive of the breakout boards.

#

@tidal kiln here's the thing. The Huzzah - with it's quirky networking is supported. However, the other cool Feathers (RFM's come to mind) have their wings totally clipped...

manic glacierBOT
#

Feature request:
Awesome: send / receive RFM69 and RFM95 LoRa.
OK: send/receive RFM95 LoRa
Minimum: Support for ISRs so a person can build a library.
CircuitPython is awesome. Sadly, the Huzzah is the only Feather who can fly. This is ironic, since the simplicity of the RFM96 and RFM69 make it ideal for the beginner who wants to add wireless to their project. For example, the good 'ol "You've Got Mail" mailbox open detector that sends an RFM 95 LoRa into the excited circuitpythonis...

solar whale
#

Will the changes to bus_device regarding read_into vs readinto impact the 2.1.0 Bundle or just the 3.0 Bundle?

slender iron
#

it'll change all bundles because its independent of the circuitpython version

solar whale
#

OK - thanks

slender iron
#

np

solar whale
#

just verified ๐Ÿ˜‰ works

slender iron
#

ugh, my rosie raspberry pi keeps crashing

vague monolith
#

@slender iron 'rosie'?

slender iron
#

its a raspberry pi thats supposed to test circuitpython on hardware

manic glacierBOT
tulip sleet
idle owl
#

Silly rosie.

slender iron
#

@tulip sleet It boots up again fine after I unplug it and replug it

#

gonna go shop then I'll be back

idle owl
#

So this is a new result. The jlink isn't reflashing the bootloader because it thinks it's already fine.

#
Downloading file [/Applications/SEGGER/JLink_V620g/bootloader.bin]...
Comparing flash   [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
O.K.```
#

Oh right.

#

Erase.

tidal kiln
#

yeah. might also be some kind of force flag for the loadbin. but erase should work.

idle owl
#

I did a search back to the last time we talked about this and found erase. I never tried to flash bootloader over bootloader then, I did erase first, so I'd never seen that output before.

#

Yay! Good to go.

tidal kiln
#

now do loadbin a 2nd time. should get that message again?

idle owl
#

Already disconnected and flashed CircuitPython. ๐Ÿ˜„

tidal kiln
#

meh. no worries then.

#

imho, kind of weird default behavior for a low level tool like this. i'd prefer it to loadbin when i say loadbin.

idle owl
#

Yeah

tidal kiln
#

it doesn't ask 'do you really want to' 2 times when you do erase

idle owl
#

Agreed. I reconnected it three times before posting here, thinking it was an issue on my end.

umbral dagger
#

Bought a bunch of stuff from Adafruit... taking 2 weeks of vacation (starting monday) to focus on person projects. I.e. mostly hacking on stuff & working in/on CP. Should be fun!

idle owl
#

Nice!

pastel panther
#

Sha-weet

umbral dagger
#

This includes working on my first learning guide.

pastel panther
#

I'm taking an hour to focus on eating my way to he bottom of ths bowl of salsa

idle owl
#

@umbral dagger That's great!

tulip sleet
#

@idle owl why did you want to reflash the bootloader?

idle owl
#

@tulip sleet I corrupted it earlier when my breadboard power connection came loose and flickered some.

tulip sleet
#

before the jlink writes a section of flash it reads it to see if it's identical, to save wear and tear on the flash. so if it says it's identical, i don't think it's corrupted. but was it acting weird?

idle owl
#

Yeah after it finally came back up, it mounted as NO_NAME and reflashing CircuitPython didn't fix it.

tulip sleet
#

the NO_NAME is not the bootloader, that's CIRCUITPY being corrupted. If you double click, did you see METROM4BOOT?

idle owl
#

Yeah

#

Last time this happened I had to reflash the bootloader to fix it.

tulip sleet
#

so you just needed to erase the CIRCUITPY location. you can do that with bossac -e (the m4 version), or I happen to have made a handy-dandy .uf2 that erases everything.

idle owl
#

Oh, hmm.

tulip sleet
#

do you have Scott's new bossac?

idle owl
#

I haven't worked with bossac since I flashed the board in the first place, so I'm guessing no

tulip sleet
#

load it starting at 16384

idle owl
#

I don't understand what that means

tulip sleet
idle owl
#

I can just flash that onto the bootloader drive?

#

Or do I need to use the jlink to do the update_bootloader.bin first?

tulip sleet
#

That will update the bootloader, erase CPy, and then go back to METROM4BOOT.
Then use this to erase everything.

idle owl
#

Oh nice

tulip sleet
#

don't use the jlink. unplug its USB so you can upload in the normal way by double-clicking and then cp-ing or dragging/dropping

idle owl
#

Ok

tulip sleet
#

but you have to use the update-bootloader .uf2 first to fix the bootloader so the erase_m4.uf2 will work.

idle owl
#

Got it

tulip sleet
#

you'll have to reload CPy after erase_m4.uf2

#

of course

idle owl
#

Yep, thanks!

tulip sleet
#

and tell me if it doesn't work. you're the first guinea pig besides me!

pastel panther
#

Oh btw @tulip sleet , an older version of master from last week when you were asking for people to test some versions of 3.0 left me with a METROM4BOOT that won't go away.

When I put it into bootloader-upload mode it creates a METROM4BOOT 1 which works just fine and I can use to load the current master which has no issues. CIRCUITPY shows up fine, and the REPL works fine as well. I've rebooted several times and it's not going anywhere

tulip sleet
#

@pastel panther what os?

pastel panther
#

OSX 10.10.5

idle owl
#

@tulip sleet It worked exactly as described! Bootloader updated, METROM4BOOT mounted, waited, erased, came back up, allowed loading CPy.

tulip sleet
#

and a clean empty CIRCUITPY?

idle owl
#

Yeah, but I had already reflashed the bootloader and CPy earlier so there was nothing on it. Do you want me to load something and erase it again to test?

tulip sleet
#

just put something in CIRCUITPY like a folder or file, yeah, tnx

idle owl
#

Np

pastel panther
#

@tulip sleet ok, thanks

#

Hah, just delete it... of course

#

worked great

tulip sleet
#

@idle owl you shouldn't need to reflash the bootloader again or update it unless we make a better version. The eraser is all you should need

idle owl
#

Yeah thank you. I figured as much.

#

Yep! Clean, empty CPy

#

Nice!

tulip sleet
#

I wrote this up in the doc but I have to get everyone to update their bootloaders before the eraser will work (on the M4; the M0 is fine; I also have an erase_m0.uf2)

idle owl
#

My poor little jlink will be lonely now. ๐Ÿ˜„

tulip sleet
idle owl
#

So... here's something odd though.

#

I loaded a main.py that turns the onboard NeoPixel blue. Right now it's blue for a moment, then flashes the cyan/yellow error code for "line 11". Even though according to Finder, there's nothing on it.

#

That main.py is what I loaded to test the eraser.

manic glacierBOT
idle owl
#

Does it also show an error code when there's no main.py? Even if it does, that doesn't explain it being blue mixed in, I chose blue for my code because it's one of the colors not used in error codes.

tulip sleet
#

it shouldn't show anything - if you go into the repl and type ctrl-d, does it say it's running main.py?

idle owl
#

No

#

It's holds blue ~0.5sec, then holds yellow same, then flashes cyan. Repeat.

slender iron
#

@idle owl I think its a bug

#

its a bug that you get flashes when no main is present

idle owl
#

Ok. Noted. I wasn't sure if it was because it hadn't fully erased.

#

Which didn't make sense.

#

But weirder things have happened.

slender iron
#

yeah, I've seen it once

tulip sleet
#

try putting a main.py there and then starting it, and then deleting it

idle owl
#

Ok.

#

Now it is blue hold, yellow hold, and cyan flashes 7 times. With main.py deleted after starting it.

tulip sleet
#

type sync

idle owl
#

Where?

tulip sleet
#

in a terminal

#

not in the repl

idle owl
#

while in the board directory? Or anywhere?

tulip sleet
#

anywhere

idle owl
#

No change then

slender iron
#

I think its a bug ๐Ÿ˜ƒ

tulip sleet
#

i have not seen this, but I believe Scott

#

i am laughing

idle owl
#

Ok. ๐Ÿ˜„ Is it a file-it-bug or a going-to-happen-sometimes-deal-with-it-bug?

tulip sleet
#

@idle owl go ahead a file it - that puts it on the to-do list and makes it a round tuit.

idle owl
#

Ok.

manic glacierBOT
#

Well, the fetch is plenty fast:

Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.81.244
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.81.244|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65011116 (62M) [application/x-www-form-urlencoded]
Saving to: โ€˜gcc-arm-embedded_6-2017q2-2~trusty1_amd64.debโ€™
100%[======================================>] 65,011,116  23.2MB/s   in 2.7s   

2.7s !

tawny creek
#

hi guys :D! got a question: i'm currently only get_bus_voltage_V from the Circuitpython ina219 library-- how do i go about importing only the necessary bits for that method?

idle owl
#

Hmm. I'm not entirely sure whether I understand, so this may be wrong, but from library import onlythethingsyouneed? Or are you way past that to trying to extract deeper things from the library.

tawny creek
#

'INA219_CONFIG_GAIN_4_160MV' 'INA219_CONFIG_GAIN_8_320MV' 'INA219_REG_SHUNTVOLTAGE' 'INA219_REG_CURRENT' 'const' 'INA219_REG_BUSVOLTAGE' 'INA219_CONFIG_MODE_POWERDOWN' 'INA219_REG_CONFIG' 'INA219_CONFIG_SADCRES_11BIT_1S_276US' 'INA219_CONFIG_BADCRES_10BIT' 'INA219_CONFIG_GAIN_MASK' 'INA219_CONFIG_BADCRES_MASK' 'INA219_CONFIG_MODE_SVOLT_TRIGGERED' 'INA219_CONFIG_SADCRES_10BIT_1S_148US' 'INA219_CONFIG_SADCRES_12BIT_128S_69MS' 'INA219_CONFIG_SADCRES_12BIT_64S_34MS' 'INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS' 'INA219_REG_POWER' 'INA219_REG_CALIBRATION' 'INA219_CONFIG_SADCRES_9BIT_1S_84US' 'INA219_READ' 'INA219_CONFIG_SADCRES_12BIT_1S_532US' 'I2CDevice' 'INA219_CONFIG_BVOLTAGERANGE_32V' 'INA219_CONFIG_BADCRES_11BIT' 'INA219_CONFIG_BVOLTAGERANGE_MASK' 'INA219_CONFIG_MODE_SVOLT_CONTINUOUS' 'INA219_CONFIG_MODE_BVOLT_CONTINUOUS' 'INA219_CONFIG_SADCRES_12BIT_32S_17MS' 'INA219_CONFIG_BADCRES_9BIT' 'INA219' 'INA219_CONFIG_MODE_MASK' 'INA219_CONFIG_GAIN_1_40MV' 'INA219_CONFIG_SADCRES_12BIT_4S_2130US' 'INA219_CONFIG_SADCRES_12BIT_16S_8510US' 'INA219_CONFIG_MODE_SANDBVOLT_TRIGGERED' 'INA219_CONFIG_SADCRES_12BIT_2S_1060US' '__name__' 'INA219_CONFIG_BADCRES_12BIT' 'INA219_CONFIG_MODE_ADCOFF' 'INA219_CONFIG_RESET' 'INA219_CONFIG_GAIN_2_80MV' 'INA219_CONFIG_BVOLTAGERANGE_16V' 'INA219_CONFIG_SADCRES_12BIT_8S_4260US' 'INA219_CONFIG_SADCRES_MASK' 'INA219_CONFIG_MODE_BVOLT_TRIGGERED'

#

I would think it would be called soemthing like ``get_bus_voltage_V`

#

but i dont see anything like it o_O

idle owl
#

Hmm... I have no idea.

#

Also it's late here, I'm running on brain = 0. ๐Ÿ˜„

tawny creek
#

no worries ! tyty

idle owl
#

I think I'm heading out. I hope someone else has a better idea than I do.

#

Good luck!

tawny creek
#

just trying to squeeze in as much as i can

idle owl
#

And you are doing so much!

tawny creek
#

have a good evening !

idle owl
#

Thanks, you too!

glacial bronze
#

I think get_bus_voltage_V is part of the INA219 class

tawny creek
#

import get_bus_voltageV from adafruit_ina219.INA219 ?

glacial bronze
#

I mean, give it a shot? But I get a feeling like it wouldn't work

#

the entire thing looks pretty interconnected

idle owl
#

It's from library import item

tawny creek
#

yaaay

#

from adafruit_ina219 import INA219

#

does the trick ๐Ÿ˜„ tytyt

tawny creek
#

question: I have a lib folder that has the adafruit_hid folder with files ending in .mpy , keyboard.mpy, keycode.mpy etc.. but when i get this error, it refers to a .py file, how can i force/make it use the .mpy folder under lib instead?
Traceback (most recent call last): File "code.py", line 7, in <module> File "libraries/helpers/hid/adafruit_hid/keyboard.py", line 34, in <module>

#

/media/usb0/lib/adafruit_hid $ ls __init__.py keyboard_layout_us.mpy keyboard.mpy keycode.mpy mouse.mpy

manic glacierBOT
tawny creek
#

any suggestions on how i could get more memory ๐Ÿ˜–
`>>> import busio

from adafruit_ina219 import INA219
from digitalio import DigitalInOut, Direction, Pull
import board
from board import *
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import adafruit_seesaw
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 320 bytes`

stuck elbow
#

Drop that import *

#

Changing the order of imports can help

manic glacierBOT
tulip sleet
#

@tawny creek The File "libraries/helpers/hid/adafruit_hid/keyboard.py", line 34, in <module> in the backtrace just tells you what the line number would be in the .py file. It doesn't mean it actually imported a .py file.

If you don't need KeyboardLayoutUS, you can skip importing it. But you are getting to the hairy edge. If adafruit_seesaw is a .py try compiling it to .mpy

tawny creek
#

@stuck elbow @tulip sleet thanks for the tips! will attempt ๐Ÿ˜ƒ

vague monolith
#

@tawny creek the * will kill you everytime.

tawny creek
#

I'm getting this now
`>>> import board

import time
import busio
import adafruit_seesaw
from adafruit_ina219 import INA219
from digitalio import DigitalInOut, Direction, Pull
from adafruit_hid.keyboard import Keyboard
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "libraries/helpers/hid/adafruit_hid/keyboard.py", line 34, in <module>
MemoryError: memory allocation failed, allocating 320 bytes`

solar whale
#

@tawny creek would it help to only import what you need from board and busio instead of the whole module?

manic glacierBOT
#

What about building a docker image that's already setup with the PPAs and ARM GCC, etc. image for travis to use? More details here: https://docs.travis-ci.com/user/docker/ Build the docker image ahead of time and it can be populated and published to docker's universe with all the necessary build tools installed and no time waiting for Travis' servers to set it up. It could be faster and also has no cost from AWS (it's not huge but quick back of envelope is 60mb * 10 pulls a day * 20 days a...

tidal kiln
#

@tawny creek have you tried changing import order?

tawny creek
#

like this now
import time import adafruit_seesaw from busio import I2C from board import A0, A1, A2, A3, A4, A5, SDA, SCL from adafruit_ina219 import INA219 from digitalio import DigitalInOut, Direction, Pull from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode

#

Traceback (most recent call last): File "code.py", line 7, in <module> File "libraries/helpers/hid/adafruit_hid/keyboard.py", line 34, in <module> MemoryError: memory allocation failed, allocating 320 bytes

tidal kiln
#

do the hid imports first?

tawny creek
#

im trying to use the adafruit_seesaw library only to use it with the adafruit joy featherwing, would it matter if i do the import for that only to include the stuff i'll need with the featherwing? --

@tidal kiln - rgr, will attempt

#

@tidal kiln okay, imports in this order:
from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode from adafruit_ina219 import INA219 import adafruit_seesaw from time import monotonic, sleep from busio import I2C from board import A0, A1, A2, A3, A4, A5, SDA, SCL from digitalio import DigitalInOut, Direction, Pull

but crashes to a
code.py output: Buttons initiated INA219 initiated Traceback (most recent call last): File "code.py", line 41, in <module> MemoryError: memory allocation failed, allocating 296 bytes

https://gist.github.com/eighthree/14052bc4a44542ee96183b260e3879cb

solar whale
#

@tawny creek why are you importing adafruit_sewsaw? is it being used?

tawny creek
#

yeah

#

im using it with a joy featherwing

#

I have 6 buttons connected to A0-A5, an INA219 on the SCL/SDA and a Joy Featherwing

solar whale
#

so you are out of memory and have not even configured the seesaw yet ๐Ÿ˜ฆ I htink you are expecting too much from it.

tawny creek
#

yeeh

#

might add a trinket to handle other things instead

solar whale
#

or at the risk of blasphemy on this forum, have you considered using the Arduino IDE?

#

just until the M4'S are available, of course ๐Ÿ˜‰

tawny creek
#

have not considered but might!

#

I have some space in the enclosure for a trinket m0

#

just would be -1 usb port

#

thanks for your help sir! @solar whale

solar whale
#

@tawny creek you are very welcome.

manic glacierBOT
#

@tdicola I glanced at that Docker doc but don't have a lot of experience with Docker. I can't imagine it starts up faster than the Ubuntu VM.

I think the few dollar bandwidth cost per month is worth paying to have continuous testing for everyone. Having it run early on pull requests reduces our load of checking that it works later on. Also, if it became exorbitant we could use Travis' persist cache to persist it locally.

The ARM GCC PPA is also being requested as a whitelisted source fo...

#

Yeah totally agree it's worth having fast builds for good continuous integration tests. A docker or other pre-built image is handy because it can be used by anyone, i.e. both the CI system and users who want to build circuitpython. It becomes the canonical way to install and build circuitpython regardless of platform. In my testing docker is super fast to startup and definitely worth benchmarking vs. an ubuntu VM that's installing everything from scratch. Putting apt packages on AWS is a ...

formal plover
#

Hello <@&356864093652516868> and all! Been MIA for a little bit on account of having a baby. I'll be back/more active in a couple weeks. Just tag me if you want to get my attention until then. Have fun and be awesome!

solar whale
#

@formal plover congratulations! I hope all is well. You can sleep again in about 18 years ๐Ÿ˜‰

manic glacierBOT
#

This is a pull request, not an issue.

How about making another issue for adding ESP8266 build support to the CI
and mentioning that Docker may be a good way to do it?

On Thu, Nov 16, 2017 at 10:00 AM Tony DiCola notifications@github.com
wrote:

Yeah totally agree it's worth having fast builds for good continuous
integration tests. A docker or other pre-built image is handy because it
can be used by anyone, i.e. both the CI system and users who want to build
circuitpython. It becom...

formal plover
#

Thsnk @solar whale! Haha I know right?

slender iron
#

congrats again @formal plover !

idle owl
#

@formal plover Glad everyone's doing well!

manic glacierBOT
#

I think the context manager should manage one transaction. I believe in one wire that involves a scan to find the device first and nothing at the end.

It would be awesome if it represented one device. Anything not device specific can be top level functions.

I'd probably condense the read and write methods a bit to always operate on byte arrays.

pastel panther
#

Congrats @formal plover !๐Ÿ˜ƒ ๐Ÿ‘ถ blinka ๐Ÿค“

formal plover
#

Thanks @slender iron & @idle owl! ๐Ÿ˜ƒ

#

Thank you @pastel panther!! ๐Ÿค“ ๐Ÿ˜ƒ

bronze geyser
#

Hey @Kurt H a HUGE congrats! Wow - you had a baby. How was your wife in delivery while you had contractions ( as a mom of two ๐Ÿ˜ƒ ). My husband treated my contractions like a sports event.....big contraction brought OOOHHH! fist pump. (UGH!)

formal plover
#

Thank you @bronze geyser! Haha she did well.

tawny creek
#

@solar whale if i switch to arduino how difficult would it be to revert back?

solar whale
#

@tawny creek not difficult. Just reflash CircuitPython.

tawny creek
#

rgr ๐Ÿ˜„

#

ill miss being able to quickly ssh in and edit configs

solar whale
#

That sure is nice!

lofty topaz
#

@formal plover Just saw the news. Congratulations. That's wonderful. You now have a project for/of a lifetime.
And no, they don't come with an on/off switch.

slender iron
#

@tulip sleet your SPI issue is just a code thing right? Not a hardware bug correct?

tawny creek
#

@solar whale @slender iron officially excited for cp on m4 โค

cunning crypt
#

@formal plover Are you going to be on Show and Tell, then? "This is a project we've been working on for a few months. Still a WIP, but.."

tulip sleet
#

@slender iron my issue was code - it wasn't checking for valid clock_pad early enough. I've fixed that. It's also true that Limor will probably swap at least two pins on the next rev of Metro M4 to make it possible to use SERCOM2 for the 2x3 SPI header. There does appear to be a bug in the samd51 arduino core.

slender iron
#

can you use SERCOM4 for the SPI header?

tulip sleet
#

yes, it does now automatically try SERCOM2, which can't be configured, and then tries the alt SERCOM SERCOM4 for those pins. the arduino core was set up to use SERCOM4 for SPI flash, I think, which is why the pins should probably be swapped

slender iron
#

I looked at this earlier and designated it this way:

SPI Flash is SERCOM4
SPI Header is SERCOM2 once clock is on pad 1 and MOSI is pad 0. SCK and MOSI need to be flipped to make this happen. (This is DOPO=0x0.)
I2C is on SERCOM5
UART is on SERCOM3 (UART TX must be pad 0 and it is.)
#

thats relative to rev A

tulip sleet
#

the first part is exactly what Limor and I came up with last night. DId you write this a while ago?

slender iron
#

yeah, sep 29

tulip sleet
#

ok!

slender iron
#

just forwarded you the email chain

tulip sleet
#

the previous SPI.c code wasn't making sure the clock_pad was valid. I just moved that check into the SERCOM-checking loop and factored it out for SAMD21 vs 51. 51 is more strict, as I mentioned in the issue.

slender iron
#

right, I'm confused why you said there needs to be a hardware rev

#

aka, did I mess it up ealier

tulip sleet
#

I was just rediscovering what you did. I thought from Limor's conv she didn't know that yet but I guess she did. Dean's arduino core code still had rev A pin mappings, it appears.

slender iron
#

k, it looks like there was a commit to switch to rev B but it must have missed some

tulip sleet
#

are the second batch we have rev A or B?

slender iron
#

B

#

grr, my raspberry pi crashed again

tulip sleet
#

so boards/metro_m4_express/pins.c is rev A or B

slender iron
#

thats a good question ๐Ÿ˜ƒ

#

I may not have updated it

tulip sleet
#

it's SCK PA12, MOSI PA13, MISO PA15

#

PA12 is pad 0 for SERCOM2, so that doesn't work for SCK

slender iron
#

let me look

#

in rev B SCK is PA13 and MOSI is PA12

#

so pins.c is out of date

tulip sleet
#

that would explain why my SPI testing is not working. I just got back from PT and was going to move the Saleae to the M4 (M0 looked good). How a bout the A3/A5 swap?

slender iron
#

I probably missed that as well

#

do you have access to the pcb files?

tulip sleet
#

i don't see a repo for them

slender iron
#

will DM the link

tulip sleet
#

I'll fix pins.c as part of this SPI PR.
tnx

#

I hope to push non-DMA SPI today if I can get it to work

slender iron
#

awesome! I just noticed the status neopixel isn't turned on for the M0

tulip sleet
#

it comes on very bright for me

#

at least sometimes

vague monolith
#

Is there any arduino samples that need python equivalent examples made?

#

looking for ways to contribute.

tulip sleet
#

@vague monolith a lot of the learn guides are being rewritten and in the process the code is being updated. if you find one or more libraries you would like to convert let us know and we can tell you whether they're in process or not

stuck elbow
#

@tawny creek counter-intuitively, importing a whole module takes less ram

#

@tawny creek because it only needs one entry in the locals dict then

tawny creek
#

<

manic glacierBOT
stuck elbow
#

What would be the best way for me to display tracebacks on an LCD screen? Converting a caught exception to string only gives me the message. Can I somehow capture the serial output or otherwise get that info? Are there any plans for that in the future? Would it make sense to create an issue for this?

opal elk
stuck elbow
opaque patrol
#

I finally got my Metro m0 in the mail, but it isn't showing up as a drive. Will the Atmel WinUSB and LibUSB drivers interfere?

stuck elbow
#

what if you press reset twice?

#

maybe it didn't come with circuitpython on it

opaque patrol
#

nope, I hear a connection sound but no drive. It shows up under the COM in device manager though

stuck elbow
#

can you open that com port in a terminal program and see what it prints?

opaque patrol
#

number scrolling really fast, couldn't break into the repl though

stuck elbow
#

yeah, seems like it has some arduino program on it

#

I think there is a guide for flashing circuitpython on it, let me look for it

opaque patrol
#

got it, 3rd time doing double reset did the trick

idle owl
#

It's a tricky rhythm sometimes.

stuck elbow
#

yeah, you have to get the timing right

#

it's slower than a mouse double-click

opaque patrol
#

now, if I could just figure out how to get the repl in the visual studio code terminal...

stuck elbow
#

you have to flash circuitpython on it first

opaque patrol
#

I already did and added the latest libraries

stuck elbow
#

ah, ok, no idea about visual studio then, I just use screen

opaque patrol
#

I use putty which works fine except it is a different window

idle owl
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

stuck elbow
#

@idle owl what's wrong?

idle owl
#

New CPX doesn't work with the sound meter code. ๐Ÿ˜„

stuck elbow
#

with the new microphone sensor?

idle owl
#

Yeah, looks like. Same markings on the back and the mic as the other board I have that doesn't work.

stuck elbow
#

maybe it's broken too?

idle owl
#

That would be a mighty big coincidence, though not impossible. I also now have a logic analyser though. So I have more troubleshooting possibilities now. ๐Ÿ˜ƒ

pastel panther
#

@idle owl did you get a saleae? Which one?

idle owl
#

Logic 8

pastel panther
#

Cool, I got the same. It's a pretty great tool to have for things like figuring out why half your neopixel strip isn't working

tulip sleet
#

@opaque patrol what version of windows?

opaque patrol
#

Windows 10

tulip sleet
#

ok, no drivers needed; i came in late, is no drive showing up at all either double-clickign or with circuit python?

idle owl
#

I think the only issue still left was getting the REPL into vs code

#

I think we sorted the rest of it

stuck elbow
#

@pastel panther logic analyzer changes everything, you can finally see what's happening

tulip sleet
#

that's what happens when there are three pages of chat and I think I'm on the last page instead of the first ๐Ÿ˜

idle owl
#

Discord messes with you, I swear.

stuck elbow
#

the name is not a coincidence

opaque patrol
#

Yeah, I got the metro to show up and working

stuck elbow
#

hail Eris!

pastel panther
#

@stuck elbow totally. I was (and am still) going to get a Rigol 1054 but the logic 8 seemed like a lot of value for not a lot of cash.

stuck elbow
#

I initially used one of those $5 chinese clones of the first saleae

pastel panther
#

Especially when your teacher wife can get you the edu discount ๐Ÿ˜ƒ

stuck elbow
#

that is a lot of value ๐Ÿ˜ƒ

#

I later got the real thing for Christmas, but it's not such a huge improvement over the basic thing

#

I mean, sure, more of everything and analog channels, but somehow I don't use those features as much

#

you can also use a beaglebone as a logic analyzer

#

there is a ready image for it

vague monolith
#

@idle owl wherees the sound meter code? i'll test on my board. I think I only tested your recording code.

#

@idle owl is is the code from last Saturday 11:39PM?

idle owl
#

Give me a second, phone call.

#

(Yeah that's probably the right code, need to change the frequency to 16k if it's still 8k)

errant grail
#

Quick question: Is there something in CP similar to the Arduino elapsed time counter millis() ?

idle owl
#

time.monotonic

#

I think

errant grail
#

@idle owl thanks -- I'll check it out!

idle owl
#

@tulip sleet What is the interface of the mic sensor on the CPX to the microcontroller? Trying to sort troubleshooting

pastel panther
#

@stuck elbow I'm sure the basic analyzer is great and all but I would have a hard time justifying using their software without buying their hardware, especially since stuff like sigrok exist

stuck elbow
#

@pastel panther you can use it with sigrok

tulip sleet
#

@idle owl it is I2S (not I2C), one pin to the mic and one back

idle owl
#

@tulip sleet Thank you

pastel panther
#

@stuck elbow That's my point. Why use softwre you didn't support when there is a free alternative?

tulip sleet
stuck elbow
#

@pastel panther why use closed software if there is an open alternative anyways?

pastel panther
#

@stuck elbow also a good point.

tulip sleet
#

pin 15 out, pin 13 in. It' might be tough to get the the traces. I have not tried scraping off solder mask. You maybe could probe the samd21 pinout with a very thin probe, maybe a pin or needle attached to an alligator clip. You can download Eagle and examine the board layout and schematic (another thing to learn)

pastel panther
#

Eagle is great for that. I use it for inspection as much as making boards

idle owl
#

@tulip sleet Is that schematic posted somewhere? I can't find it

stuck elbow
#

I have an old (pre-cloud) install of eagle specially for that

pastel panther
#

It's linked from the product page

stuck elbow
#

because not everything has pdfs

tulip sleet
stuck elbow
#

which is a shame, because pdf is a bit easier to see for most people

pastel panther
#

agreed. I someone should perhaps generate pdfs from all the eagle files

stuck elbow
#

I bet there could be a travis job for that ๐Ÿ˜ƒ

#

or maybe not, as you can't install eagle

pastel panther
#

Probably. I believe you can run ULPs from the command line

stuck elbow
#

and nothing else reads eagle's format

#

the joys of closed software

pastel panther
#

There are some eagle readers but I don't know if they're any good

#

Yea, I'm quickly going to switch to KiCAD. It's just better! I saw a video of the newer router options and it's amazing

manic glacierBOT
errant grail
#

@idle owl that was it! time.monotonic will make things much, much easier! ๐Ÿ˜ƒ

idle owl
#

@errant grail Excellent!!

pastel panther
#

@stuck elbow The one downside is the mountains of eagle files for adafruit and other boards

stuck elbow
#

kicad also has its own format ๐Ÿ˜ฆ

#

why can't everything just use svg like Fritzing does?

pastel panther
#

Because everyone has an opinion about the best way to do something

stuck elbow
#

I don't envy the future historians trying to untangle any of this

tulip sleet
#

@idle owl I have to go out for a while - Scott and/or I can talk later about this debugging

idle owl
#

@tulip sleet Sounds good, thank you.

slender iron
#

@stuck elbow Kicad nightly can read Eagle files

manic glacierBOT
idle owl
#

So, it turns out the new mic sensor doesn't initialise as quickly as the older ones. So if you increase the buffer and sample a slice from the end of the increased buffer, it works with an obvious delay.

#

Apparently a resolution would be to alter audiobusio.PDMIn, or whatever it is that would do the following, to be running the clock constantly and only record data when requested, but that is evidently buried deep in the C code that I have no understanding of.

#

That's why the sound meter code doesn't work on the boards I have, but the recording code does.

slender iron
#

@idle owl thats a good idea. can you file an issue?

idle owl
#

I absolutely can.

slender iron
#

thank you!

idle owl
#

That was a rough one, lol ๐Ÿ˜„

manic glacierBOT
tulip sleet
#

@idle owl was that strictly a software diagnosis, or did you actually use the Saleae?

idle owl
#

Software. I would apparently have to be scraping things and then soldering wires to the board before I can use the Saleae to troubleshoot the mic specifically. My friend has the skills. But I wasn't super keen on potentially messing up the boards. It's definitely not something I could do on my own yet.

tulip sleet
#

does the mic have something different stamped on it to id it as different? Maybe I should order another one or two.

idle owl
#

Yes. It's the same as the other board I had that didn't work, and different from the one I have that did.

#

That was the other issue with trying to test, I only have 1 board that works, and 3 that look the same, 2 of which don't work. (I'm waiting to flash the third because I'm still trying to duplicate the demo code it ships with). So I only have one comparison board, which we'd also have to solder bits to.

#

Shouldn't say don't work. 2 of which work with the workaround.

tulip sleet
#

One of my mics says: KV1 519. Other is KV1 719. I thought maybe those were just date code differences. I had to use a strong magnifier to see.

#

I mean stamped on the physical metal can

idle owl
#

My original board looks like Kv1 519. The other three are H016 7706.

tulip sleet
#

ooo completely different

idle owl
#

One ordered in the middle of September, the other two this week.

manic glacierBOT
tulip sleet
#

the demo code: is that MakeCode or some Arduino program? I read that you can pull the .uf2 off the board from the ...BOOT drive, and it might contain the source of the MakeCode program.

#

you can load it back into makecode, I think

idle owl
#

That would be perfect. It's MakeCode.

tulip sleet
#

It's the CURRENT.UF2 that you see in CPLAYBOOT.

idle owl
#

Yeah... I've used that feature with my friend. I'm trying it now.

#

Doesn't seem to be playing nice. Trying it on a different browser. Then I'll try it in Windows if that doesn't work.

tulip sleet
#

at least though now you have a copy that you should be able to load some CPX in the future

idle owl
#

Thank you!

#

I tried it on another board and it worked! Awesome ๐Ÿ˜ƒ

tulip sleet
#

Oh, wow, I realized the CURRENT.UF2 is all of flash. I just cloned a Trinket with Cpy including the CIRCUITPY filesystem and all its files from one Trinket to another.

idle owl
#

Oh, neat!

tulip sleet
#

won't work with SPI flash, but will work with all the non-Express boards, and will work with 3.0 before we get SPI flash to work. Easy way to back up your board.

idle owl
#

Oh, yeah! Good point. For sure.

cunning crypt
#

@tulip sleet That's AWESOME.

tulip sleet
#

It's "obvious", but only in retrospect.

idle owl
#

As things tend to be ๐Ÿ˜„

cunning crypt
#

What happens with an Express board when you copy it?

tulip sleet
#

you just get the circuitpython uf2 back, and whatever was in the little nvm non-volatile storage. You don't get the filesystem. Still, if you're somewhere without Internet, you can copy CPy onto multiple boards if you have a starter one.

cunning crypt
#

I wonder if there's a way to make it grab the SPI flash if it's there

tulip sleet
#

we'd have to add that feature to the UF2 bootloader - interesting idea. maybe on M4 boards; the UF2 bootloader is already pretty big on M0 boards. We reserve 8k of flash for it on M0; 16k on M4.

cunning crypt
#

But 8k for the M0 is a larger portion than 16k for the M4

tulip sleet
#

yup, and we dropped some non-vital things from the bootloader to make it fit

cunning crypt
#

The hobbyist in me finds copying the SPI flash "Convenient" since it's not difficult to copy the contents manually. The business owner/board designer in me would find that EXTREMELY convenient for setting up a few hundred boards

#

Hmm. If you're using the UF2 bootloader with Arduino, does it copy the compiled Arduino code?

#

Yes.

#

Yes it does.

slender iron
idle owl
#

@slender iron Am I seeing correctly that this line https://github.com/adafruit/circuitpython/blob/2d0d1ef5f288afae3de97da4c094d3d0414da630/shared-bindings/audiobusio/PDMIn.c#L86 is what sets the default frequency to 8000? Instead of changing it in the examples, should we just update it here? (This is because of the mics needing to run at 1MHz, and 16k is the min frequency that keeps it there. Separate issue from mine, but we came to it from troubleshooting the same.)

slender iron
#

yup, thats where the default comes from

#

changing it could break code though that relies on it

idle owl
#

Yeah that's what I was about to say was that I don't know what else goes with it or how to test it if I changed it.

#

So in that case, can I update the docs (which appear to be above it) to include frequency=16000 in the parameters of the examples and a note to change it? The docs look different than the other ones I've dealt with but I think I could edit them correctly.

slender iron
#

the frequency=8000 should match the default. Adding a warning though would be good

idle owl
#

I didn't mean change it in the first part where it shows the default. I mean add it to the two examples in the documentation.

#

So if someone uses those examples, the increased frequency is already included.

slender iron
#

ah ok, yeah that'd be good ๐Ÿ˜ƒ

idle owl
#

Although it seems like most people end up using the code you have in the issue about the audio filter. I was going to post another response there with the updated info as well.

#

Ok keen.

#

I'll update that then.

#

Theoretically, lol. Haven't forked and branched anything this big yet. I assume it's all the same process. Time to find out! ๐Ÿ˜„

slender iron
#

yup! its the same

#

if you have the source already you don't need to re-clone it

idle owl
#

oh hmm. Ok

slender iron
#

just git remote add kattni <git url>

idle owl
#

From inside the current local cp repo? Or does that matter

slender iron
#

yeah, in the local repo

idle owl
#

Hmm. fatal: remote kattni already exists This is inside the repo I've been using to build 3.0. Is that right?

slender iron
#

what does git remote -v show?

idle owl
#

Weird. kattni https://github.com/adafruit/circuitpython (fetch) kattni https://github.com/adafruit/circuitpython (push)

#

That's not my fork url obviously.

slender iron
#

git remote rename kattni adafruit

idle owl
#

Oh nice!

#

The git remote add worked this time.

idle owl
#

Now I have 2 remotes, how do I use my fork and not branch the main repo?

slender iron
#

you can set "upstream" for each individual branch you have

#

git push --set-upstream kattni <branch name> will push and remember

idle owl
#

Oh neat. I thought upstream was repo-wide only.

slender iron
#

I think its per branch

idle owl
#

I've not seen any other dialogue before when creating a branch other than the "switched" bit: 1699 kattni@robocrepe:circuitpython [74m master *%= a9f75a71c]$ git checkout -b pdmin-freq-doc-update M frozen/Adafruit_CircuitPython_BusDevice M ports/atmel-samd/asf4 Switched to a new branch 'pdmin-freq-doc-update'Is this ok?

slender iron
#

a git submodule update should make those go away

idle owl
#

Ok thank you

hollow tartan
#

my first dance with Metro Express and no Driver. trying to get to REPL.

slender iron
#

@hollow tartan you'll need one for Win 7, check the guide

hollow tartan
#

files are visible on "flash" drive

#

Do you mean the guide that is talking about Arduino IDE?

#

Only one I found so far.

slender iron
#

the guid efor the metro m0 express

idle owl
#

I did the submodule update and they're still there. If it's ok, I don't mind, I was concerned I had done something wrong.

slender iron
#

they still show in git status?

idle owl
#

Yeah

#

Didn't know I could check that.

slender iron
#

they show after submodule update too?

idle owl
#

I can do it again, but I did it once with --init --recursive and once without already. Should I have left off the init recursive?

#

That's what I had in my history from doing it before building 3.0

#

brb

slender iron
#

I usually do it without

idle owl
#

I tried it again without, no change

slender iron
#

weird ok

#

try from within the frozen directory

idle owl
#

Still there except it doesn't have frozen/ before the file name.

slender iron
#

hrm

#

thats weird!

idle owl
#

Nice! ๐Ÿ˜„

slender iron
#

if you change into that dir then you can do a git status for the submodule

idle owl
#

I don't know how to do that if it's any different from git status

slender iron
#

its not, it just depends on what directory you are in

idle owl
#

Oh. ok

#
On branch master
Your branch is up-to-date with 'adafruit/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

    modified:   Adafruit_CircuitPython_BusDevice (untracked content)
    modified:   ../ports/atmel-samd/asf4 (untracked content)```
#

still there.

#

Same from my branch.

#

But I went back to master again in case that was it. I don't know git well enough to know whether it would matter. Apparently not.

#

And still when I check out my branch, they're listed.

slender iron
#

I expect you need submodule update every branch checkout

#

whats git status in Adafruit_CircuitPython_BusDevice show?

idle owl
#
HEAD detached at 39f28ed
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .DS_Store

nothing added to commit but untracked files present (use "git add" to track)``` The latter of which is obviously the silly Mac local stuff.
#

My prompt changes in that directory too I just noticed.

#

It was showing my branch name until I switched dirs.