#circuitpython-dev
1 messages ยท Page 123 of 1
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
ah mines 50mhz
this is my clock test code I added: https://github.com/tannewt/circuitpython/blob/check_usb_clocks/ports/atmel-samd/supervisor/port.c#L91
np
btw, did discord just lose all your "read" history? Mine reset to the beginning of time or august or something
nope, its been fine
weird, ok
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
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.
ah
btw, for ADC, this page was very helpful, if you have not seen it already (page 28): http://www.atmel.com/images/Atmel-42645-ADC-Configurations-with-Examples_ApplicationNote_AT11481.pdf#page=28
k thanks. I'm trying to do a straight port
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
yeah, its complicated but seems to work
are the peripherals similarly weird on other manufacturers' ARM chips? I haven't looked at any. OR maybe the Atmel ones are relatively sane.
I have a little experience with stm32 but not much more
they have some wizard software too
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
k, thanks @tulip sleet. I hope it gets better!
oof. yah. can't imagine intense chair sitting is good for that.
@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
was it a metrowing?
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
ah ok. yeah the metrowing was done by siddacious. I have pcbs but haven't assembled them
nice url on the silk 
k, I'm off. talk with you all tomorrow!
`>>> 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?
looks lik,e you skipped an underscore in "adafruit_ina219"
or whatever it should be
But it's not a space
is latest version of Wireshark with USBPcap safe to install in Win7Pro/64?
wha, where? i see _'s
oh heckie, it's an artifact on my screen. Yeah, they're there
do a dir(adafruit_ina219)
NameError: name 'adafruit_ina219' is not defined
import adafruit_ina219 again?
@idle owl do you have a minute?
just downloaded: https://github.com/adafruit/Adafruit_CircuitPython_INA219
and renamed the folder to adafruit_ina219 inside lib
>>> dir(adafruit_ina219) ['__name__', '__path__']
@hollow tartan Just a minute yeah. What's up?
@idle owl HI. I will be getting some M0 express soon. what do I need to install? testing and debugging wise?
@hollow tartan ๐ programming the same board right now ๐
@hollow tartan Congrats ๐
@tawny creek Cool.
What OS are you using?
@tawny creek Try putting adafruit_ina219.py directly into /lib/, rather than in a subfolder
oh win 7 pro 64
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.
`Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Feather M0 Express with samd21g18
import adafruit_ina219
dir(adafruit_ina219)
['name', 'path']
`
let me start up my CPX
@ kattni check^3
tyty!
Ok, I'm headed out. Good luck!
yep, Good Night.
Okay. I have replicated your problem, Cascade :v
:<
@tawny creek Are you downloading and installing premade .bin or rolling your own?
>>> dir(adafruit_ina219)
['__name__', '__path__']```
@hollow tartan premade ;3
@tawny creek That's fine. I like the header info on the CP startup. Tells all it knows.
good way to test builds ๐
reaaaly enjoying the experience so far :] aside from random ??'s like these that i stumble on
@tawny creek what are a few SW bugs between friends? LOL
thankfully not a school project or similar where timing matters
just gotta find something else to tinker with in the meantime xD
I'm still poking at it FYI
๐ฎ
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
so it works on Arduino IDE but not CircuitPython? Or it works on CircuitPython now?
I cannot make it chooch
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
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
im not sure for which version of CP the driver was designed with
maybe some sort of configuration somewhere -- above my head
It might be a 1.x module, or maybe a 3.x beta module
http://circuitpython.readthedocs.io/en/2.x/index.html doesn't list an INA219 driver
hm does 3x have a list
Where did you get the driver from?
the interweebs
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?
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
I build mine from the CP 2.x branch a couple days ago
I used the download https://github.com/adafruit/circuitpython/releases
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
so the adafruit_ina219 folder is in your root dir?
not a folder, just the adafruit_ina219.py file
I downloaded the zip of the ina219 repo, unzipped it and copied over the file
@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! ๐จ ๐ 
I just updated to the latest daily build and put the .py file in root, and import worked
aaaaah im trying to get repl to load
is the serial device showing up?
I just downgraded back to the major release, and the .py in root also loads
cool
having issues with the repl
What exactly is the problem?
trying to ctrl+D to try things out but it just hangs o-O
trying to exit out of autoreload
Ctrl+C then any key to exit the autorun program
Ctrl+D reloads the program
which version of the major release @glacial bronze
i'm on 2.1.0 with the .py on root
2.1.0 from the major release page
still getting __name / __path on dir(adafruit_ina219)
Make sure you don't have another copy of it somewhere
yep no other copy elsewhere
And you copied the lib directory from the bundle zip into CIRCUITPY?
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
unzip the zip you just mentioned and copy the lib directory to the CIRCUITPY
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']`
so when your done, your CIRCUITPY should look like
~$ ls /Volumes/CIRCUITPY/
adafruit_ina219.py boot_out.txt lib
I just did the raw UF2, which came with a significant library
which one?
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
imma do it
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
kay just plopped that on, it remounted
should the directory be fresh again?
I still see the same files from before.
No, you should see the same files
`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
can you paste what's in your CIRCUITPY directory?
what is adafruit_ina219.__path__
ls /Volumes/CIRCUITPY/ System Volume Information code.py adafruit_ina219.py lib boot_out.txt
adafruit_ina219.path
'adafruit_ina219'
heck
it has _ _
_
`>>> import adafruit_ina219
dir(adafruit_ina219)
['name', 'path']
adafruit_ina219.path
'adafruit_ina219'`
where is the latest daily build
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
w00t
also os x noticed it is a usb HID device and prompted setup
which didnt happen previously
spiffy
do you want me to try switching back to 2.1.0
Thanks for helping, Sidd
no problemo
bows @pastel panther @glacial bronze
making a battery overlay for my retropie build btw
X)
how you get battery status?
cool. Let me know how it works. I had an eye on that current monitor for a LiPo project I'm working on
for sure! ๐
Hey @sick creek sorry got caught up with assembling this thing. What do you mean?
@tawny creek how you get battery data to battery overlay?
planning to actually use a modified : https://github.com/HoolyHoo/Mintybatterymonitor
cool
@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.
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
`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)
@tawny creek My idea would be to wait a month and use a M4 device. More of everything on an M4!
:p
can you import sub-library on something instead of the whole library?
thats what im not sure how to do rn :X
also trying to figure out how to use adafruit's seesaw with the joybonnet + with this: http://circuitpython.readthedocs.io/en/latest/shared-bindings/gamepad/GamePad.html
but i think im going to replace the joy featherwing with just standard io buttons at this rate :<
we'll seeee
@tawny creek have all the .py files been converted to .mpy?
@tawny creek that library won't work with seesaw, it assumes the buttons are connected directly to the pins
@solar whale nope, how do you do that? And @stuck elbow ๐ข๐ข
@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
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
no, I'm not sure its needed
I haven't looked into the seesaw API. Is it possible to miss button presses with it?
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
you don't need the gamepad library for the joy featherwing
@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!
@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?
@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
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
@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
all i did was replace adafruit_ina219.py with adafruit_ina219.mpy
nope it imports
`>>> import adafruit_ina219
`
for some reason micropython/circuitpython doesn't delete from sys.modules the modules that failed to import
did you look inside the file?
the adafruit_ina219.py
you said you tried both .mpy and .py?
yep
so the .py is not compiled
.py worked before i replaced it
now it doesnt work even though its the same file as before
ok, where did you get the .mpy from?
the .mpy i cross compiled with the latest version of the ina219.py file from here: https://github.com/adafruit/Adafruit_CircuitPython_INA219
ok, which version of the mpy-cross?
latest 2.1.0 https://github.com/adafruit/circuitpython/releases
for raspbian
should i try using the mac compiler instead?
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']`
interesting
@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 ....
@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)
i just replaced the regular .py adafruit_seesaw with the .mpy version and its loading fine
so IMHO stick with what we have an what is working, separate files on releases and separate bundles
@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
almost sounds like the version generated by the py mpy-cross is using more memory
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
@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?
by yeah for the ina219 import how big is the mpy file I wonder? is the one generated by py different size vs. mac?
@solar whale it doesn't, that's the funny part
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
@stuck elbow I had assumed itwas just letting the "defaults" be used and they were close enough for reasonable function.
Mac Version
@solar whale one very annoying thing about those sensors is that they don't have sane defaults
mpy-cross generates circuitpython bytecode binaries so it should be the same regardless of the platform used to build it
@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
@stuck elbow agreed, but I seem to get decent results. Still exploring why.
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
It will always use .py over .mpy, correct?
pi: 4056 vs, 16142 on the py*
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
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)
ah cool and yeah try the import adafruit_ina219 again
@timber lion just cloned repo and built mpy-cross on pi3. seems to run at least.
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
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
`>>> 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__
ah wow weird! ๐
i almost wonder if the file is getting corrupted in some way
that is very strange
do you mind sharing the pi generated .mpy here?
works now!
uploaded the latest release .uf2 file for my board
touched nothing else, and repeated steps
and now it is working
Is's a miracle ๐
@fading solstice can you make this an issue:
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/34
in the ADS1x15 repo:
https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15
Adds drivers for ADS1015 and ADS1115 ADC's.
wow strange!
built with mpy-cross 2.1.0 raspbian
thanks for walking me through this @timber lion cola @solar whale
@tawny creek sorry it was not cleaner, but glad it is working.
@solar whale it'll make the completion of this even sweeter ๐
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...
first time getting hands dirty with 1-wire. pretty neat how it works.
@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.
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
@tidal kiln That's really cool
@idle owl https://www.maximintegrated.com/en/products/1-wire/flash/overview/
slides 10-12
I ordered that temp sensor.
an evil hack might be to create a device that spoofs all 2^64 addresses. the scan would take a fair amount of time.
@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.
@lofty topaz even better. usb logic probes the size of a business card with software protocol analyzers.
@tidal kiln Exactly!!! Such cool equipment, er, uhm, tools.
I really hate protocols that are based on timing
a clock line makes everything so much more reliable
What about RS232?
trade offs
yeah, not a fan
Anybody showing anything tonight???
but I'm biased, because I don't like to put oscilators on my boards, and usually use the internal ones
@stuck elbow ๐
@stuck elbow I just ordered the parts to make a Blinka board!
seems like they gave the 1-wire spec plenty of head room to deal with timing variance
@stuck elbow Noted. I have the first version.
the second one has vcc and gnd shorted
do we have any example code for shake detection on CPX in CircuitPython?
@split ocean Not that I'm aware of.
@stuck elbow Did you get the first version to work, or also no?
very simple threshold based
@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
@stuck elbow Ok good to know
I'm away from all my tools now
thanks @tidal kiln I'll have a look
@tidal kiln Nice!
those blinka pcb's are just cool, even unpopulated
I know!
@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)
@tidal kiln I was just excited because I have a friend who can actually do the soldering.
actually the usb port is the only hard to solder part on it
@stuck elbow It was evidently difficult to find too. The majority are through-hole apparently.
I should make a part of the pcb stick out as a USB A plug
@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.
achievement unlocked: https://github.com/adafruit-adabot
@stuck elbow Yes, you should, I like those...
and make Blinka larger and put a coin battery on it...
@slender iron what does it do?
gonna start with auto-updating and releasing the bundle nightly
(only if there are updates of course)
@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... ><>
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.
Believe me, breaking the build was sacroligious. You just didn't do that.
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 that was you!? i remember those three days without email.
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
@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.
@tidal kiln it never made it to production. thats what continuous testing is for
I guess they are more laid back at large companies.
like @lofty topaz, it did prevent others from commiting. They just rolled back my breaking code. ๐
It's a kind of achievement anyways, as there are many checks before it merges
but of course there are ways ๐
yup ๐
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.
@tidal kiln thanks, that shake detection was just what I needed!
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
@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.
Broken? Sorry, but Microsofts C++ compiler is rock solid in my opinion.
@lofty topaz that's a tool, though
@split ocean also see this:
https://github.com/adafruit/circuitpython/issues/429
since it looks like i ran into that there. generally not an issue, just need to be aware of it.
I need to put shake into the API. It completely slipped my mind as a function.
@lofty topaz this is a great read on C++ imo: http://yosefk.com/c++fqa/
anybody object to me checking the toolchain .deb into circuitpython? it'll speed up travis and ensure the version is static
@stuck elbow Ya know, I remember seeing a similiar website about using crayons. ๐
@lofty topaz fair enough
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.
@slender iron did you agree to remove deprecated method read_into now?
yes please @fading solstice
ok
is glad he changed that
@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.
@stuck elbow Then why is English the universal language yet one of the hardest to learm??? There is a reason they call it "code".
hardest? haha
one of....
English got simplified a lot on the last 200 years
That's true, but computer languages 200 years ago were much harder as well. ๐
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.
@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++.
Python is written in C
details....
no, C++ is simply C with classes.
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
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.
ok
Because I know very little about it myself.
@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.
@umbral dagger forth!
@lofty topaz what @stuck elbow said.
@stuck elbow I never did enough with Forth that I feel comfortable commenting on it.
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.
what about linq
is that this sql thing?
I suppose 20 years of C++ doesn't account for much. @stuck elbow is right, I know very little about it.
๐
@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
This is a great conversation but I think it might be better suited to #general-chat ๐
sorry
Don't be sorry!
let's move there
my fault. I provoked it. ๐
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!
I just don't like people badmouthing C++. That's all. I will defend it.
It fed my family for years.
Circuit your Python
I did
i need create new tag/release for the following repos: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice https://github.com/adafruit/Adafruit_CircuitPython_BME280 https://github.com/adafruit/Adafruit_CircuitPython_BME680 https://github.com/adafruit/Adafruit_CircuitPython_BNO055 https://github.com/adafruit/Adafruit_CircuitPython_CCS811 https://github.com/adafruit/Adafruit_CircuitPython_DS3231 https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 https://github.com/adafruit/Adafruit_CircuitPython_MPR121 https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 https://github.com/adafruit/Adafruit_CircuitPython_Register https://github.com/adafruit/Adafruit_CircuitPython_SI7021
Adafruit_CircuitPython_BusDevice - Two helper classes that handle transaction related state for I2C and SPI including locks.
@lofty topaz I have no problem using a language and at the same time seeing its disadvantages.
anyways, #general-chat
@fading solstice Do you want some help with it?
hey you Circuitpython collobrators here is update to vscode https://code.visualstudio.com/blogs/2017/11/15/live-share
@idle owl interesting offer. do you know what i up to?
@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.
@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.
Ok, so I had the right idea. Is Travis setup on them?
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
travis is CI
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.
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.
read that link @fading solstice
@slender iron Am I right that the bundle will create .mpys on it's own even if they're not in the repo release?
All the libraries are released and configured in the bundle.
Ok, then it should be fine
thank @sick creek
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...
@idle owl correct
Thanks!
The only issue is including my chagnes in new releases of the dozen libraries
Oh hmm. I have to be a contributer to create a release it looks like.
we would be learning together!
Oh excellent!
i just asked for the rights to create a release for myself. do you have those right already?
oops
I have it on other repos, not the ones you listed
well, not the first one I checked anyway
@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?
nope, I'm happy to add you
and kattni?
@slender iron That would be great! I'd like to help with creating the releases
k, I'll make a team to make it easier
Excellent thank you
good thinking there scott
@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.
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?
That was suggested by scott
This is the readinto change right?
yes, chaanged read_into to readint. a thankless change
But crucial!
there may have been other changes as well. probably not but possible
by other people.
Ah ok. Yeah, we'll just call out your change then.
ok
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.
did you see smoke?
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.
Same. I'm going to watch the live streams as well.
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...
@tidal kiln Hey a dictionary! (in your dice code)
@bronze geyser correct, and probably very low priority.
@idle owl yep. here's an even better one:
https://github.com/caternuson/CircuitPython-Demos/blob/master/simple_simon.py#L25
(a dictionary of dictionaries!)
@tidal kiln thank you. (wow - did you hear that? It sounded just like the air being taken out of a balloon...that deflating sound...)
@tidal kiln Oh man. So very dictionary.
@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.
@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?
@bronze geyser what @tidal kiln said. you could create an issue for RFM support detailing what it needs to be able to do
OK. Dumb ? @slender iron - how do i create an issue?
@slender iron thank you.
@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
@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...
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...
Will the changes to bus_device regarding read_into vs readinto impact the 2.1.0 Bundle or just the 3.0 Bundle?
it'll change all bundles because its independent of the circuitpython version
OK - thanks
np
just verified ๐ works
ugh, my rosie raspberry pi keeps crashing
@slender iron 'rosie'?
its a raspberry pi thats supposed to test circuitpython on hardware
RMF97/69 support would be cool but ISRs in general would be great to have.
If they're not currently supported, this page is slightly misleading: ISR page on readthedocs
I'm guessing that it's automatically rendered from micropython code that isn't used but that certainly isn't clear if thats the case.
@slender iron if it's SD card again ... I put a USB external drive on the RPi and it worked fine. https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
Silly rosie.
@tulip sleet It boots up again fine after I unplug it and replug it
gonna go shop then I'll be back
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.
yeah. might also be some kind of force flag for the loadbin. but erase should work.
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.
now do loadbin a 2nd time. should get that message again?
Already disconnected and flashed CircuitPython. ๐
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.
Yeah
it doesn't ask 'do you really want to' 2 times when you do erase
Agreed. I reconnected it three times before posting here, thinking it was an issue on my end.
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!
Nice!
Sha-weet
This includes working on my first learning guide.
I'm taking an hour to focus on eating my way to he bottom of ths bowl of salsa
@umbral dagger That's great!
@idle owl why did you want to reflash the bootloader?
@tulip sleet I corrupted it earlier when my breadboard power connection came loose and flickered some.
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?
Yeah after it finally came back up, it mounted as NO_NAME and reflashing CircuitPython didn't fix it.
the NO_NAME is not the bootloader, that's CIRCUITPY being corrupted. If you double click, did you see METROM4BOOT?
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.
Oh, hmm.
do you have Scott's new bossac?
I haven't worked with bossac since I flashed the board in the first place, so I'm guessing no
I don't understand what that means
i have an easier way, but you need to update the bootloader. The UF2 bootloader that's on there now is actually a little defective and will only load the first 256k of flash. Here's a new one.
I can just flash that onto the bootloader drive?
Or do I need to use the jlink to do the update_bootloader.bin first?
That will update the bootloader, erase CPy, and then go back to METROM4BOOT.
Then use this to erase everything.
Oh nice
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
Ok
but you have to use the update-bootloader .uf2 first to fix the bootloader so the erase_m4.uf2 will work.
Got it
Yep, thanks!
and tell me if it doesn't work. you're the first guinea pig besides me!
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
@pastel panther what os?
OSX 10.10.5
@tulip sleet It worked exactly as described! Bootloader updated, METROM4BOOT mounted, waited, erased, came back up, allowed loading CPy.
and a clean empty CIRCUITPY?
@pastel panther this might be helpful: it's about a ghost network drive but it probably applies to you as well: https://superuser.com/questions/20879/how-to-remove-duplicate-ghost-network-drive-on-os-x
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?
just put something in CIRCUITPY like a folder or file, yeah, tnx
Np
@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
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)
My poor little jlink will be lonely now. ๐
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.
This does two major things:
- It stores the arm gcc in the repo. The download from the PPA was taking between 2 and 7 minutes.
- It splits each board into a separate job so they are built in parallel.
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.
it shouldn't show anything - if you go into the repl and type ctrl-d, does it say it's running main.py?
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.
yeah, I've seen it once
Ok.
Now it is blue hold, yellow hold, and cyan flashes 7 times. With main.py deleted after starting it.
type sync
Where?
while in the board directory? Or anywhere?
anywhere
No change then
I think its a bug ๐
Ok. ๐ Is it a file-it-bug or a going-to-happen-sometimes-deal-with-it-bug?
@idle owl go ahead a file it - that puts it on the to-do list and makes it a round tuit.
Ok.
The qemu and linux sub-jobs failed. Does the elapsed time per sub-job look better or worse than with the .deb in the repo?
restarting .10 and .11. The AWS fetches failed (?).
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 !
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?
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.
'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
no worries ! tyty
just trying to squeeze in as much as i can
And you are doing so much!
have a good evening !
Thanks, you too!
I think get_bus_voltage_V is part of the INA219 class
import get_bus_voltageV from adafruit_ina219.INA219 ?
I mean, give it a shot? But I get a feeling like it wouldn't work
the entire thing looks pretty interconnected
It's from library import item
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
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`
@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
@stuck elbow @tulip sleet thanks for the tips! will attempt ๐
@tawny creek the * will kill you everytime.
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`
@tawny creek would it help to only import what you need from board and busio instead of the whole module?
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...
@tawny creek have you tried changing import order?
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
do the hid imports first?
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
@tawny creek why are you importing adafruit_sewsaw? is it being used?
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
i've omitted all the seesaw code for now but the code is https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/master/examples/Joy_Featherwing.py
so you are out of memory and have not even configured the seesaw yet ๐ฆ I htink you are expecting too much from it.
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 ๐
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
@tawny creek you are very welcome.
@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...
It can control autoreload and the rgb status led.
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 ...
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!
@formal plover congratulations! I hope all is well. You can sleep again in about 18 years ๐
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...
Why do we need ISRs as opposed to polling? Concurrency such as ISRs is complex.
@siddacious I agree we should remove that ISR doc page.
Thsnk @solar whale! Haha I know right?
congrats again @formal plover !
@formal plover Glad everyone's doing well!
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.
Congrats @formal plover !๐ ๐ถ
๐ค
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!)
Thank you @bronze geyser! Haha she did well.
@solar whale if i switch to arduino how difficult would it be to revert back?
@tawny creek not difficult. Just reflash CircuitPython.
That sure is nice!
@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.
@tulip sleet your SPI issue is just a code thing right? Not a hardware bug correct?
@solar whale @slender iron officially excited for cp on m4 โค
@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.."
@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.
can you use SERCOM4 for the SPI header?
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
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
the first part is exactly what Limor and I came up with last night. DId you write this a while ago?
yeah, sep 29
ok!
just forwarded you the email chain
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.
right, I'm confused why you said there needs to be a hardware rev
aka, did I mess it up ealier
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.
k, it looks like there was a commit to switch to rev B but it must have missed some
are the second batch we have rev A or B?
so boards/metro_m4_express/pins.c is rev A or B
it's SCK PA12, MOSI PA13, MISO PA15
PA12 is pad 0 for SERCOM2, so that doesn't work for SCK
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?
i don't see a repo for them
will DM the link
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
awesome! I just noticed the status neopixel isn't turned on for the M0
Is there any arduino samples that need python equivalent examples made?
looking for ways to contribute.
@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
@tawny creek counter-intuitively, importing a whole module takes less ram
@tawny creek because it only needs one entry in the locals dict then
<
CircuitPython is missing "sys.maxsize" from the micropython libraries, as mentioned here: https://forums.adafruit.com/viewtopic.php?f=60&t=126615
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?
looks like that would involve implementing https://docs.python.org/2/library/traceback.html ?
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?
nope, I hear a connection sound but no drive. It shows up under the COM in device manager though
can you open that com port in a terminal program and see what it prints?
number scrolling really fast, couldn't break into the repl though
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
got it, 3rd time doing double reset did the trick
It's a tricky rhythm sometimes.
now, if I could just figure out how to get the repl in the visual studio code terminal...
you have to flash circuitpython on it first
I already did and added the latest libraries
ah, ok, no idea about visual studio then, I just use screen
I use putty which works fine except it is a different window
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
@idle owl what's wrong?
New CPX doesn't work with the sound meter code. ๐
with the new microphone sensor?
Yeah, looks like. Same markings on the back and the mic as the other board I have that doesn't work.
maybe it's broken too?
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. ๐
@idle owl did you get a saleae? Which one?
Logic 8
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
@opaque patrol what version of windows?
Windows 10
ok, no drivers needed; i came in late, is no drive showing up at all either double-clickign or with circuit python?
I think the only issue still left was getting the REPL into vs code
I think we sorted the rest of it
@pastel panther logic analyzer changes everything, you can finally see what's happening
that's what happens when there are three pages of chat and I think I'm on the last page instead of the first ๐
Discord messes with you, I swear.
the name is not a coincidence
Yeah, I got the metro to show up and working
hail Eris!
@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.
I initially used one of those $5 chinese clones of the first saleae
Especially when your teacher wife can get you the edu discount ๐
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
@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?
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)
Quick question: Is there something in CP similar to the Arduino elapsed time counter millis() ?
@idle owl thanks -- I'll check it out!
@tulip sleet What is the interface of the mic sensor on the CPX to the microcontroller? Trying to sort troubleshooting
@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
@pastel panther you can use it with sigrok
@idle owl it is I2S (not I2C), one pin to the mic and one back
@tulip sleet Thank you
@stuck elbow That's my point. Why use softwre you didn't support when there is a free alternative?
@pastel panther why use closed software if there is an open alternative anyways?
@stuck elbow also a good point.
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)
Eagle is great for that. I use it for inspection as much as making boards
@tulip sleet Is that schematic posted somewhere? I can't find it
I have an old (pre-cloud) install of eagle specially for that
It's linked from the product page
because not everything has pdfs
no, I downloaded the .brd and .sch from https://github.com/adafruit/Adafruit-Circuit-Playground-Express-PCB
which is a shame, because pdf is a bit easier to see for most people
agreed. I someone should perhaps generate pdfs from all the eagle files
I bet there could be a travis job for that ๐
or maybe not, as you can't install eagle
Probably. I believe you can run ULPs from the command line
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
Tested with BMP280 SPI on '21 and '51
needs corresponding ASF4 PR as well
@idle owl that was it! time.monotonic will make things much, much easier! ๐
@errant grail Excellent!!
@stuck elbow The one downside is the mountains of eagle files for adafruit and other boards
kicad also has its own format ๐ฆ
why can't everything just use svg like Fritzing does?
Because everyone has an opinion about the best way to do something
I don't envy the future historians trying to untangle any of this
@idle owl I have to go out for a while - Scott and/or I can talk later about this debugging
@tulip sleet Sounds good, thank you.
@stuck elbow Kicad nightly can read Eagle files
This change has two _peripherals.h files. Did you mean to merge them?
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.
@idle owl thats a good idea. can you file an issue?
I absolutely can.
thank you!
That was a rough one, lol ๐
Hi - peripherals.h includes either samd21_peripherals.h or samd51_peripherals.h. They are slightly different. Is that what you mean?
I don't see peripherals.h in the diff.
I added it in the previous PR when I did I2C. It hasn't changed: it's just conditional #includes.
Ah ok! You'll need to fix the build because CircuitPlayground is out of space.
@idle owl was that strictly a software diagnosis, or did you actually use the Saleae?
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.
does the mic have something different stamped on it to id it as different? Maybe I should order another one or two.
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.
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
My original board looks like Kv1 519. The other three are H016 7706.
ooo completely different
One ordered in the middle of September, the other two this week.
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
That would be perfect. It's MakeCode.
It's the CURRENT.UF2 that you see in CPLAYBOOT.
I see an Import button at https://makecode.adafruit.com. It takes a .uf2 to upload.
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.
at least though now you have a copy that you should be able to load some CPX in the future
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.
Oh, neat!
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.
Oh, yeah! Good point. For sure.
@tulip sleet That's AWESOME.
It's "obvious", but only in retrospect.
As things tend to be ๐
What happens with an Express board when you copy it?
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.
I wonder if there's a way to make it grab the SPI flash if it's there
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.
But 8k for the M0 is a larger portion than 16k for the M4
yup, and we dropped some non-vital things from the bootloader to make it fit
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.
@timber lion this is the arm gcc release schedule change announcement https://launchpad.net/gcc-arm-embedded/+announcement/14837
@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.)
yup, thats where the default comes from
changing it could break code though that relies on it
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.
the frequency=8000 should match the default. Adding a warning though would be good
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.
ah ok, yeah that'd be good ๐
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! ๐
oh hmm. Ok
just git remote add kattni <git url>
From inside the current local cp repo? Or does that matter
yeah, in the local repo
Hmm. fatal: remote kattni already exists This is inside the repo I've been using to build 3.0. Is that right?
what does git remote -v show?
Weird. kattni https://github.com/adafruit/circuitpython (fetch) kattni https://github.com/adafruit/circuitpython (push)
That's not my fork url obviously.
git remote rename kattni adafruit
Now I have 2 remotes, how do I use my fork and not branch the main repo?
you can set "upstream" for each individual branch you have
git push --set-upstream kattni <branch name> will push and remember
Oh neat. I thought upstream was repo-wide only.
I think its per branch
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?
a git submodule update should make those go away
Ok thank you
my first dance with Metro Express and no Driver. trying to get to REPL.
@hollow tartan you'll need one for Win 7, check the guide
files are visible on "flash" drive
Do you mean the guide that is talking about Arduino IDE?
Only one I found so far.
learn.adafruit.com here I come
the guid efor the metro m0 express
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.
they still show in git status?
they show after submodule update too?
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
I usually do it without
I tried it again without, no change
Still there except it doesn't have frozen/ before the file name.
Nice! ๐
if you change into that dir then you can do a git status for the submodule
I don't know how to do that if it's any different from git status
its not, it just depends on what directory you are in
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.
I expect you need submodule update every branch checkout
whats git status in Adafruit_CircuitPython_BusDevice show?
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.