Right now calcsize is being grouped with the doc above: https://circuitpython.readthedocs.io/en/latest/shared-bindings/struct/__init__.html
#circuitpython-dev
1 messages ยท Page 118 of 1
In reference to issue #388:
I tried a buffer size of 2963 and it breaks the same way, whereas a buffer of 1503 is fine?
Also any buffer size not divisible by 32 produces a warning:
length mismatch 1504 1503
(the buffer still fills)
@sturdy furnace please add that to the issue. its great investigation that will get lost on the chat unless someone is actively fixing it
I marked it for the next 2.x release
@hollow tartan how are things with you? I didn't talk with you in the meeting
I tested a bunch of buffer sizes.
A length of 1504 is fine, whereas a length of 2963 hard resets.
So simply increasing the buffer length doesn't seem to solve it.
thanks @sturdy furnace !
@slender iron Not real good. This adventure I have set out on is having a rough start.
yeah, dev on windows is particularly challenging
I am going to get my big win 8 laptop up and running again. I hope that will be the answer I am looking for.
is it newer and faster?
I think the audio filtering is ok for now. We can create a new issue if/when it needs more love.
it is an HP Envy . the biggest and best a few years ago.
@slender iron no worries! feel free to ping me for any work you're doing on the mic
I did try to install using the latest releases on my Lenovo Yoga and that was a failure too.
no it is not working now. very perplexing for me.
@hollow tartan if the older laptop is a spare then it might be worth trying to put ubuntu on it
The security certifications in the 3rd step would not be accepted at Hashicorp.
you mean a full linux installation of ubuntu.
I don't know what that means
yeah, if you don't have anything on the laptop you need
yeah that would be worth a try.
that would bring you more in line with the mac/linux workflow
ok, I will mark that down as a possible next step.
you folks seem to be pretty happy with the M4 progress.
good job on persisting through this! I know its not fun
ok, dinner time for me. night all!
toodles!
Sorry, but I'm going to be a pain in the you know what. Just for grins, I tried it.
๐
@lofty topaz well, we could put it in the library bundle ๐
@tulip sleet You'd have to ask Mr. Guido van Rossum about that. ๐
I think he would approve.
@lofty topaz if you want to know how much space that takes up after import, you can do
import gc gc.mem_free()
Just for kicks
@formal plover Heck no, space don't mean nuttin' to me anymore. But it looks like the ASCII alone is a couple hundred bytes. I was just pointing something out. It seems many Python books talk about "The Zen of Python" so if a newbie were to try it and got the CPX error, it might be confusing. That's all.
@lofty topaz ah gotcha.
@formal plover I'm a "Grumpy Old Man" so I gotta play the role. Some people call it "nit-pickin". I say, yup! ๐
@timber lion Hi. I am trying very hard to compile a micropython .bin for nodemcu esp8266.
I went to MicroPython.org Forum and found this insightful sharing of experience: https://forum.micropython.org/viewtopic.php?f=16&t=3987&p=22830&hilit=adafruit+esp8266#p22830
I would be interested in your view point. It seems to me that on Windows the versions of the components that make up the linux VM are hyper critical and specific guidance is not being provided. Would you be able to rectify that situation? Please. I am seeking specific version guidance to get a working VM on a Windows platform.
cc @slender iron
I actually have some of these shields and have loaded an Arduino IDE spawned code to sweep a Servo Motor arm back and forth. NOTED: Controversy about Motor shield for NodeMCU https://forum.micropython.org/viewtopic.php?f=16&t=3977
@chilly trail If I read the information correctly, the problem you are having with building micropython is due to having some "sharing" option enabled betewwn the Ubuntu VM and Windows? Is that some special configuration or one of the default settings? Does it build OK if you disable it? For my setup, as decribed in the guide, there is one shared folder "/vagrant" that allows me to easily copy my .bin file from the VM to my host file system. Nothing else is shared. Sorry you are still ahveing problems
An alternative to the Segger for jlink/swd, though more expensive than the edu-mini. https://store.oshpark.com/products/black-magic-probe-v2-1
I use that
but I didn't do anything yet, apart from connecting it
you can also use any of the cheap "blue pill" stm32 boards with the black magic probe firmware
then you can have your programmer for $2 ๐
@lofty topaz CP also doesn't support antigravity. (at least not yet)
I think that such easter eggs are cute when you have a lot of spare resources, but in this case, perhaps the cost is too much
of course having them as a separate library would be great
but then the surprise is kinda spoiled
@stuck elbow Which is why the comment about space in the image. It don't matter to me.
@tidal kiln Quick question. Doesn't the accelerometer work for MakeCode?
which accelerometer?
the CPX accelerometer.
@lofty topaz looks like it: https://learn.adafruit.com/sensors-in-makecode/accelerometer?view=all
@stuck elbow Right, but I don't think the code for CircuitPython has been ported yet. Which may be why @tidal kiln made his comment.
Seriously?
there is a number of those
there is "import this", there is "import antigravity", the micropython on the microbit has "import love" and there is also "from __future__ import braces"
I know about "this" but not the others, especially the "antigravity" one. Here I'm try to get my CPX to measure distance by rolling it across the table and it will work with MakeCode but not with CircuitPython.
interesting, what's the error?
So the antigravity comment threw me off.
There's no error because there's no driver for the accel on the CPX for CircuitPython at this time. At least as far as I can tell.
@tidal kiln Well shiver me timbers, I looked, I coded, I compiled. Veni, vidi, vici :)
from adafruit_circuitplayground.express import cpx
while True:
x, y, z = cpx.acceleration
print(x, y, z)
It works perfectly. Thanks a bunch.
np. thank @idle owl. her work.
hmmm, wonder why I was told it hadn't been ported yet. Oh well, Thanks @idle owl
you're in cutting edge terrain. this is all being actively developed.
That is going to break a lot of drivers.
@deshipu we would leave in a wrapper
@slender iron I wonder what would be the best way of keeping an out-of-tree C module for CircuitPython
The flag for this is MICROPY_CPYTHON_COMPAT, but the comment next to it says:
// These methods are superfluous in the presence of str() and bytes()
// constructors.
@stuck elbow ideally it'd be in-tree right?
I'm not sure it's generally useful
it's that sprite/tile engine of mine, I needed to rewrite parts of it in C for speed
I don't think it needs to be to be in the tree. it just needs to be clearly documented when its available
it only works with rgb spi displays
I'm open to having specialized modules in the circuitpython repo
guess we could just disable it by default
exactly
as long as its documented well when its available and goes through the PR process I'm not worried about it
this one doesn't need anything like that ticks() callback
yeah, I need to clean it up and document it, of course
is it structured with the shared-bindings/common-hal split?
that will take a while
weeeeelllll
right now everything is in shared-bindings ๐
does it use the common hal libraries itself? or is it atmel specific?
it uses the spi write function
๐ I'd want that changed
yeah, of course
it comes together with a python module that implements the higher-level bits
so I was thinking about calling that C module the same as the python one, but with _ in front
getting close!
is that a trinket m4?
@stuck elbow sounds perfect! I'm open to getting it checked in. sounds like it just needs to be cleaned up a bit
@meager fog ah! Leeks!!!
yeah, right now it's just a MVP
@meager fog so excited!
~leeks~
graveyard
just a field of usb plugs sticking out, and you can plug them as headstones
@stuck elbow Haha!
@mrmcwethy looks like readinto is already used in CPython: https://docs.python.org/3/search.html?q=readinto Thanks for taking this on!
I think i2c is read_into because it was originally readfrom_into and then I changed how the address was managed.
As @deshipu and @ladyada point out, please start out by leaving read_into with a warning that its deprecated. Then, if you like, go through and update drivers. We can remove it once they are all fixed.
@formal plover got any mini b versions?
@dhalbert I think this is a good candidate for using some of the space you freed. What do you think?
Anyone know what the code size cost of enabling this is?
@meager fog Trinket M0 with the 512Kbyte SPI flash, yes?
I can't see a flash chip footprint there
@tidal kiln that I don't.
ooh, next to the "USB" label, a really tiny chip?
oh no, now I will again have the urge to use trinkets for everyting
just as I convinced myself they are too small
But from that comment, wouldn't just str(my_bytes) and bytes(my_string) work in place of my_bytes.decode() and my_string.encode()?
the trinket m0 is just too cute
I just can't believe I can establish a serial connection and mess around in the repl with something so small
the journey so far...
@tidal kiln craziness
@formal plover will trade one on left for admission to museum ๐
๐
@stuck elbow great job on https://github.com/adafruit/micropython-adafruit-tcs34725/issues/2#issuecomment-340093363
I didn't do anything...
This looks good to me! Anything left to do?
@stuck elbow you asked them if they wanted to contribute, offered help and merged it in when they did. thats perfect
oh, I see, I though that's obvious
๐ I'm glad you think that. some folks do it themselves rather than encouraging someone else to help
@tidal kiln ah, actually it does but you must manage very High Freq/High Voltage if this gentleman is to be believed. Since before 1986 !!! https://www.youtube.com/watch?v=h9CAftwO1x8
Based on eye-witness accounts and insider information, This video takes the audience through a series of revelations as to how remarkable breakthrough techno...
I'm too lazy for that
@solar whale I am seeking specific version guidance to get a working VM on a Windows platform. I take it that your view is that the "default settings" build a functioning VM on Windows 7 and/or 8?
@hollow tartan I have no experience with Windows (since windows 3..1 ๐ All I can say is that following the guide works to build a micropython .bin for the esp8266 in a vagrant VM installed on my MacOS system.
@solar whale Thank You.
@hollow tartan Does the build fail on your windows system when you follow the guide instructions?
@hollow tartan I am curious if you are finding that the VM behaves differently uner Windows than under MacOS.
Turning on MICROPY_CPYTHON_COMPAT costs 792 bytes. Right now we have 3912 bytes free in the Gemma build (for example). But we are looking to add framebuf, and we don't know the storage budget needed for 3.0 yet.
@gpshead: is str(some_bytes, 'ascii') ok for you as a workaround?
(Note that str(b'abc') returns "b'abc'": you need the second argument to get 'abc'. However, the value of the second argument is actually ignored right now: no decoding is done.)
Current measurements say this costs 400 bytes. I guess I'd choose those over #384 (add .decode) if I had to choose just one because it's more awkward without it. As with #384, we need to consider our storage budget in future releases.
gen_usb_descriptor.py: error: argument output_file: can't open 'build-metro_m4_express/autogen_usb_descriptor.c': [Errno 2] No such file or directory: 'build-metro_m4_express/autogen_usb_descriptor.c <-- so I need to run something first?
ah, I have to create build-metro_m4_express directory
Otherwise it fails to create the file in that directory.
When running make in a clean checkout, it fails with:
gen_usb_descriptor.py: error: argument output_file: can't open 'build-metro_m4_express/autogen_usb_descriptor.c': [Errno 2] No such file or directory: 'build-metro_m4_express/autogen_usb_descriptor.c
Does git diff only work with untracked files?
git diff will diff files that have not yet been "added". Use git diff --cached for added files. To see diffs of files already committed, there are complicated syntaxes. gitk (install it if you don't have it), is a nice GUI tool that will show you changes at each commit.
Ah bugger. Ok. Should have waited a minute more. I have to do another commit/push. It didn't include the final changes.
Thanks ๐
If it's your private repo that you're pushing to, you can do git commit --amend to redo the most recent commit, and then do git push -f to do a force push (only safe if no one has pulled from that push).
I doubt they have, it was literally a minute ago onto my fork.
So an amend is easy and basically exactly what you want (amend a previous commit that was a little wrong).
Ok, so add it like normal, then do git commit --amend ?
exactly. You can include the add in the commit (git commit -a), but that's like git add --all, so only do that if you know what's going to be added (e.g., do a git status before that)
it's just a shortcut
@tulip sleet Nice! I did git commit --amend and then the push -f and it worked perfectly. Thank you!
@meager fog re the trinket.. nice!
@tidal kiln I started back into hardware/firmware hacking with the original trinket (and some neopixel rings). It's a great platform for simple projects. Even moreso using CP instead of C. And yet you have I2C on the pins so you can do non-trivial things.
@umbral dagger Are you going to find a way to supersize the Trinket M0 Express, too?
@cunning crypt Not with that flash chip package. Connections are all under the chip. No leads.
@cunning crypt Maybe if I had a rework station.
I'm sure you can do it somehow.
As they say, life, ah, finds a way
For some reason I thought you had one
@cunning crypt Though maybe the question is: when do I put out the $ for a rework station? ๐ I need a better/real workbench, though.
@umbral dagger Mee too.
Mine's a wobbly old table that's shoved into a corner so it won't wobble
Mine's a half-height bookcase with an old Warhammer/Citadel modeling/painting station with a sheet of heat resistant soldering mat on it.
@tulip sleet how is busio coming?
@slender iron I am working on i2c first because it's "easier" (sync, not dma), and to familiarize myself with ASF4. After that SPI should be straightforward. The API is ๐ Weird mix of high-level and low-level. I have to make up some data structures for values that aren't in tables, e.g. (SERCOMx_GCLK_ID_CORE, where x is 0-5, because I need to look them up dynamically, and their values are arbitrary (not sequential, for instance). Clock API is completely different on 21 v 51, as you know.
yup yup, sounds good!
I am finishing up _construct and the rest should be easier
yeah totally
I was thinking it'd be good to finish the 3.0 beta milestone before circling back on 2.x
I'm not working on 2.x except to comment on bugs. I carved a pumpkin and make some Adafruit blinky things to put in the window and in the pumpkin. Totally hacked up Arc Reactor to simplifiy and eliminate blue colors. Strandtest dotstar strip in the window.
it's not dark yet; maybe I will. these are not profound projects, but I feel a professional obligation ๐
one arduno and one cpx
cpx is CPy
@tulip sleet Profound or not, it's still fun and awesome
did @timber lion finish the asm timing thing? I though he might have
i don't believe so. @timber lion ?
@idle owl we don't get much kid traffic on our street, even though it's quiet. There's a nearby street that goes all out, so the kids mostly go over there
@tulip sleet I'd do it for me anyway ๐
i have to stop eating the candy
We didn't get a chance this year. The last few weeks have been crazy.
@tulip sleet I kept it in a drawer this year, so we kept forgetting it was even there. It worked! Haven't really touched it!
my wife put it in a bowl already; i was good before that
@slender iron I think in another day or two or less I will have something to test
I wonder if it would make sense to actually disable MICROPY_CPYTHON_COMPAT in the large build, so as to avoid code that only works on some platforms for no reason.
sounds great @tulip sleet I'll start picking off other things
it will suddenly be done; I will be surprised
๐
Still no power so no Circuit Python playing and not many trick or treaters braving our dark driveway!
@solar whale I grew up with a really long driveway, we had trick or treaters literally once. My mum had just made chocolate chip cookies and cider, so she invited them in (they had been driven up by their parents) and the whole family got cookies and cider.
We're deep in an apartment building with very few kids so nothign special halloweeny happenign here. Including no buckets of candy (I'm looking at you, @tulip sleet ). We did, however, drop by BulkBarn this afternoon & I got a large bag full of soft licorice... my downfall). Suzanne said I have a problem. I replied that it's only a problem if I don't have any on hand.
https://youtu.be/JnxQXLdxQB8 (replaced with HD version)
Circuit Playground Express in pumpkin running CircuitPython. https://www.adafruit.com/product/3333 https://www.adafruit.com/circuitpython DotStar strip in wi...
@tulip sleet That's great ๐
a screaming cauldon would have been nice - maybe next year!
Hey it's more than we did this year. I just turned on the porch light.
there's a real estate agent who lives in the neighborhood. he gave everyone pumpkins. last year was pies
Excellent use of pumpkin.
looks great @tulip sleet !
just one set of kids so far; the father was at a distance but kept looking back at the show
I saw this one earlier today on Twitter. Not a screaming cauldron, but still
The de-bug build has been de-bugged, obviously that's why it's in the non-debug build.
@slender iron You posted another bootloader last night, I think. Do I just load it with the jlink like I did the others or is there something specific about it? I was unclear on that and the questions asked by others at the time weren't enough to clarify.
I believe I posted a self-updater. it will work with jlink but I don't recommend using it if you have the uf2 bootloader with working neopixel already
I do. Ok, good to know.
the self-updater will enable boot protection
I don't know what that means.
it prevents code for accidentally erasing the bootloader but also makes it harder to load the bootloader directly with the jlink
Ah, thank you
I'm trying to flash the m4 with gdb, but it doesn't seem to be working, anybody has any idea what I'm doing wrong here? http://paste.openstack.org/raw/625173/
@stuck elbow I was just about to suggest bringing the question here. But you figured it out.
@slender iron just to clarify. I f we use the self-updating Bootloader the we also have to follow the instructions on the github site about how to reset the NVN to update via JLink either with gdb or a tool like ozone.
right, to upload via gdb you'll need to https://github.com/adafruit/uf2-samd21#samd51
@stuck elbow did you sort it out?
well
(gdb) set ((Nvmctrl *)0x41004000UL)->CTRLB.reg = (0xA5 << 8) | 0x1a
Cannot access memory at address 0x41004004
that shouldn't be needed if you are using an existing bootloader
thats only needed to unlock the boot protection
loading doesn't seem to do anything
(gdb) load ~/dev/circuitpython/uf2-samd/build/metro_m4/update-bootloader.elf
Loading section .text, size 0x4a1c lma 0x4000
Loading section .relocate, size 0x4 lma 0x8a1c
Start address 0x4000, load size 18976
Transfer rate: 48 KB/sec, 903 bytes/write.
(gdb) compare-sections
Section .text, range 0x4000 -- 0x8a1c: MIS-MATCHED!
Section .relocate, range 0x8a1c -- 0x8a20: MIS-MATCHED!
warning: One or more sections of the target image does not match
the loaded file
This costs 376 bytes on a Trinket M0 leaving 33412 bytes free.
Fixes #193
@stuck elbow have you tried with bossac? I don't have a black magic probe to test with
I have not, where do I get it from?
I need some new version, right?
I'm trying with stlinkv2 and openocd directly now, but getting:
> program /home/sheep/dev/circuitpython/uf2-samd/build/metro_m4/bootloader.bin verify reset
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
embedded:startup.tcl:476: Error:
in procedure 'program'
in procedure 'reset' called at file "embedded:startup.tcl", line 500
in procedure 'ocd_bouncer'
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 248
in procedure 'at91samd.cpu' called at file "embedded:startup.tcl", line 331
in procedure 'ocd_bouncer'
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 532
at file "embedded:startup.tcl", line 476
** Programming Started **
auto erase enabled
Couldn't find part corresponding to DID 60060005
auto_probe failed
embedded:startup.tcl:476: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 532
at file "embedded:startup.tcl", line 476
doesn't look like anyone has uploaded a linux version
but bossa requires me to see a serial device, right?
No device found on /dev/ttyACM0
yeah, did you double click to get into the bootloader?
(sorry I'm slow. I'm neopixeling)
double-clicking reset doesn't make any usb device appear
hmm, does the red led fade?
there is only green led shining
the neopixel is green?
it's off
I probably broke it with openocd
how would I do that?
please don't assume I know how to use gdb ๐
(gdb) print ((Nvmctrl *)0x41004000UL)->CTRLB.reg
No symbol table is loaded. Use the "file" command.
kk, p/x *0x41004000
ok so that worked
the boot protection bits are in here: https://github.com/adafruit/asf4/blob/1ca9e1f86921d99f0fbc907698f864a60caf675a/samd51/include/instance/nvmctrl.h#L41
have you looked over this? https://learn.adafruit.com/debugging-the-samd21-with-gdb/setup?view=all
doesn't help much without a config file for openocd for m4
I wonder what that "Couldn't find part corresponding to DID 60060005" means
when I try to program the bootloader with openocd
I have two jlink clones, neither works
google searches suggest that we are the only people in the world using those chips
yeah, its early
I suppose openocd simply doesn't have the support yet
thanks for the help
OK, so the black magic probe only supports writing flash to some of chips, because the commands for that are different for every chip
it does support samd21, but not 51 yet
I suppose it's similar with openocd
Even the jlink doesn't support every chip.
I need to bother Piotr to add support for it ๐
What is a use case for time.monotonic? I commented it out of some sample code I'm using, and there doesn't appear to be any change in functionality. And the description in RTD makes it seem superfluous.
Does importing specific things from libraries (i.e. from time import sleep instead of import time) save on memory?
@idle owl For ESP boards at least, it is the only way to access timing functions (i.e. millis()). I think I remember @slender iron saying something about that being the case in the rest of MP as well, but not sure if I have that exactly right though.
@floral dagger Ah ok. So time.sleep doesn't play nice with the ESP boards?
The description says monotonic returns an increasing value from an unknown reference point. It's the "unknown reference point" part that made me wonder.
It's ben a while sense I researched it, but I think it varies a bit from board to board. What it basically does is takes a reference point, and uses the clock cycles to return a sort of millisecond equivelant of elapsed time from that point
Ok that's what it looked like it did, but I couldn't figure out from what point it was choosing to start.
And the research indicated I wasn't going to find it ๐
Like I said, it's been a while so I could be misremembering this, but different chips use a different point, but regardless, the end result will be the same.
Ah ok
@solar whale I am sorry but I cannot say anything about the VM under MacOS. Other than I am glad that it works.
@idle owl re monotonic - it's not guaranteed from where it starts, but the differences are useful to time intervals, and the monotonic is helpful. In CPy, it starts from 0 at power-up. But that's an implementation detail. On something like a PC, it could be wall-clock time.
Ok that makes a lot more sense. Time intervals.
So just printing it isn't terribly useful, but comparing it to previous points is.
righto
@idle owl >Does importing specific things from libraries (i.e. from time import sleep instead of import time) save on memory?
... doing an experiment taking longer than I thought
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> import gc,micropython
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 304, free: 19664
No. of 1-blocks: 3, 2-blocks: 3, max blk sz: 4, max free sz: 1214
>>> import board
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 368, free: 19600
No. of 1-blocks: 4, 2-blocks: 3, max blk sz: 4, max free sz: 1205
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> import gc,micropython
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 304, free: 19664
No. of 1-blocks: 3, 2-blocks: 3, max blk sz: 4, max free sz: 1214
>>> from board import *
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 736, free: 19232
No. of 1-blocks: 3, 2-blocks: 3, max blk sz: 24, max free sz: 1171
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>>
>>> import gc,micropython
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 304, free: 19664
No. of 1-blocks: 3, 2-blocks: 3, max blk sz: 4, max free sz: 1214
>>> from board import A1
>>> gc.collect();micropython.mem_info()
stack: 512 out of 5956
GC: total: 19968, used: 384, free: 19584
No. of 1-blocks: 3, 2-blocks: 4, max blk sz: 4, max free sz: 1205
look at the used: number in each case.
So does import board not actually import anything until it's called, and from board import * imports it all regardless?
I think that what might be happening is that import board uses the existing dictionary in board. from board import * adds all the names to the top-level dict to make the names visible there (so it increases a lot). from board import A1 adds just one name to the top-level dictionary.
it's not that import board delays, it's just that it doesn't have to make any new entries
Ah ok
import board adds board to the top-level dictionary, but not board.A1, etc.
Thank you so much! That's super interesting
but board.A1 is slower than A1, because it has to do two lookups. But not much to worry about
I see
This link talks about using a local variable when you're worried about time (usually in some loop): http://circuitpython.readthedocs.io/en/2.x/docs/reference/speed_python.html?highlight=performance#caching-object-references . Other things on that page may be interesting.
I was trying to figure out how to maximise available memory for a buffer, and this came up as a question.
yeah -just don't import things you don't need (e.g. not from x import *)
Yeah, noted. That was significant.
ok, sleep time!
Goodnight!
gn
ok, found a good snowglobe, check it out @slender iron
(and everyone else)
let it show with circuitpython
yay
@hollow tartan Iโm just trying to understand what problem you are having. Does the micro python build still fail for you?
looks awesome @river quest !
For the record: I said last week I wanted to start contributing example projects for CircuitPython. I'm gonna have to put that on hold; my "home community" on the web got blasted by a hacker and I've been putting my spare time into the rebuilding effort. But I still intend to contribute once that's settled a bit!
oh no @glacial bronze ! I hope the recovery goes well
The SSH keys on the automatic backup changed in 2014 and nobody noticed ๐
Which is why it's an effort rather than a single shell command!
eesh
I'll look tomorrow. Thanks!
Add neopixel support, neopixel status led and tx/rx led support. Removed one infinite loop too.
oh wow neat globe @river quest try filling it with glass beads / vase filler to diffuse the light. it's what i did for techno tiki and this halloween spin on it last week: https://twitter.com/tdicola/status/923430994425741312
Challenge accepted #hackapumpkin @YoungSciProbs @RobotMakerGirl :) Modern, minimal jack-o-lantern w/ @adafruit Circuit Playground Express. https://t.co/nMuICDRkQC
Hi, where I can find source code for framebuf module which is used in SAMD CircuitPython? I tried to use OLED screen with ESP CP and as framebuf is not included in this version of CP I used this module: https://github.com/adafruit/micropython-adafruit-framebuf/blob/master/framebuf.py The problem is that in this version of module text method is not implemented, while in SAMD version it is.
OK, so I found that it is made on purpose due to the memory limitations on some boards, but is it the case also for ESP8266, i.e. Feather HUZZAH?
@stiff mural It appears taht the "internal " implmentation of framebuf is not enabled for the ESP8266 build. You can write text via bitmapfont - see the guide https://learn.adafruit.com/micropython-displays-drawing-text/software?view=all It is written for micropythoin but if I racall correctly the bitmapfont implmentation works on circuitpython as well. I can't verify this now since I don't have power at my home - hopefully later today!
@solar whale Thank you for the response. Still I would like to know if that framebuf from SAMD CP can't be used with ESP8266. The problem is that I can't find it in source files.
@stiff mural If oyu build your own circuit python binary you can enable including the complete framebuf as a "builtin" module by setting #define MICROPY_PY_FRAMEBUF (1) that is change the current 0 to a 1. That is how it is implmented for the SAMD "express" boards. Othere than that, there is no python module that implements the full framebuf functionality. If it is not built in to the executalbe circuitpython image, then only the limited framebuf.py iis available at this time.
OK, that makes sense. But I just checked and in MicroPython port for ESP8266 it is set to (1), so included.. I will try to look on GitHub why and when that was changed for CircuitPython port.
@stiff mural That is my recollection as well - perhaps @tulip sleet or @slender iron can comment on why/when it was removed from the default CP build.
@stiff mural from github - it looks like it was removed to make spce on March 10 , 2017.
d023879 atmel-samd: Update and enable neopixel_write fo... - tdicola
3177e10 atmel-samd: Add samd21 neopixel support. - tannewt
54f2b69 atmel-samd: remove infinite loop if USB MSC rea... - tannewt
f4c8256 atmel-samd: Add TX/RX led support for Metro M4. - tannewt
0076a3c Merge pull request #393 from tannewt/m4_neopixel - dhalbert
@solar whale Can't find that commit. At what file are you looking? I checked /ports/ESP8266/mpconfigport.h and there is no such change, at least not in History.
@stiff mural in he 2.x branch - https://github.com/adafruit/circuitpython/commit/07ea2abcb09aef3b933386669be4802f8c0aba1d#diff-f9629ed2905ce1ed029b1653266a41d3
@solar whale Right, thank you.
you are welcome
@stiff mural @solar whale I turned it on and it didn't seem to overflow flash. Feel free to submit an issue to turn it back on. ladyada is interested in doing some work on framebuf in the future to clean it up, choose a better font, etc. so it may be a moving target
Local flash storage will have to be reduced to ~92KB assuming the following:
- 12KB Master Boot Record
- 48KB Serial Bootloader
- 140KB SoftDevice S132v5
- 28KB NFFS-based internal config memory (bonding data, etc.)
- 192KB CircuitPython Code
Remaining Space: 512KB - 420KB = 92KB local flash storage
@chilly trail I was finally able to come up with a Windows 10 machine and I installed Virtual Box, Vagrant 2.0.0 and Git - then followed the guide instructions. After some confusion with the corrct path sttings, I was finally able to build the micropython .bin file in the VM. I did have to check and fix the $PATH setting in my .profile to make sure its started with /home/vagrant/esp-open-sdk/xtensa-lx106-elf/bin - once I did this I was able to make axtls and make to create the .bin. The intiial setting for the $PATH were not correct. I'm not sure ifit was because I did something out of order or not but once I fixed the $PATH it all worked fine.
@chilly trail one other thing to note is that after modifying the .profile - I exited the vagrant VM and restarted vagrant ssh
@hollow tartan This is the corrected .profile on my system ```# ~/.profile: executed by the command interpreter for login shells.
This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
exists.
see /usr/share/doc/bash/examples/startup-files for examples.
the files are located in the bash-doc package.
the default umask is set in /etc/profile; for setting the umask
for ssh logins, install and configure the libpam-umask package.
#umask 022
if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
PATH=/home/vagrant/esp-open-sdk/xtensa-lx106-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Not from me. Once your PR (thanks) gets merged I take it the code is good. Then it's just a matter of this PR to get it in the bundle?
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/32
sounds fine to me - thats enough to get people going. our final design will have external SPI flash :)
A couple naive questions from me:
- Why is the MBR 12k? Here its only 4k.
- Why is the bootloader 48k? Bossac and UF2 are only ~8k.
- Can we combine the NFFS filesystem with the file system for CircuitPython? Without USB we can use NFFS but we'll want FATFS for the USB version.
@tidal kiln can you review https://github.com/adafruit/Adafruit_CircuitPython_TSL2561/pull/4 ?
@slender iron done
I am running circuitpython on a Huzzah. I want to use the spi_device library. The instructions for "install" state: Copy the unzipped adafruit_bus_device to the lib directory on the CIRCUITPY or MICROPYTHON drive. okidok....pardon my lack of knowledge...WHAT CIRCUITPY drive on the Huzzah? And Do I just copy the .mpy there?
@bronze geyser what instructions are you reading?
Those sound like instructions for something that has the UF2 bootloader
You'll need to use Ampy to make a lib directory and to put that library in that directory/folder
ooh. That makes some sense. I'll give it a twirl. Thank you.
@bronze geyser yup, just copy it using ampy
@bronze geyser you're welcome!
I am grateful for your very quick help. Thank you.
...I also appreciate that you didn't rub my face in the fact I should have figured this out for myself :-). Wow. Kinder, gentler people. Thank you.
no worries!
@formal plover I'll drink to that! ๐ธ hicup.... ><>
@bronze geyser We all miss things! I put Scott through an hour and a half of troubleshooting because I forgot to plug in my LED strip. Then I spent another 45 minutes with it because I forgot to plug the other end of the adapter in the wall.
wait, i thought it was be excellent. i've been doing it wrong.
Not knowing to use ampy isn't even all that obvious if you've never done it before.
@tidal kiln Come on, get with the program here.
@idle owl FundeMENTALS will get you every time. ๐
@tidal kiln hahaha you are correct. Excellent *
thanks @idle owl ... I grew up when the dinosaurs used to tell me almost daily RTFM...
of course, then they all died because they wouldn't stop smoking cigarettes. They seemed to have taken their manuals with them.
@bronze geyser Haha we do throw around RTFM once in a while. But it's more like when someone asks a question and there's a good guide for what they are asking
And we're nice about it
yah - you're the generation of "just google it..." kinda the same thing...
Even Googling means you have to have the correct terms to begin with. So teamwork helps there too.
of course, now i'll probably be able to say "Alexa, get that dang python library to work on my huzzah"
@bronze geyser let us know if you run into any problems with the library, we'd be happy to help
268bf6f atmel-samd: Fix non-DEBUG USB cdc. - tannewt
9db321d atmel-samd: Enable longints for M4 builds. - tannewt
cfbb74f atmel-samd: Reorder mpconfigport.mk and mpconfi... - tannewt
3b17980 Merge pull request #391 from tannewt/longint_us... - dhalbert
@bronze geyser Well, 5 years ago roughly, I asked my son what micro he used in at UofI. He told me to Google Arduino but to be carefull because it's a very deep rabbit hole. I googled it and have been in the hole ever since. I love google. Best site ever.
Yay - Power is back on! I can resume playing with CIrcuitpython tonight!
@solar whale Nice!
wew
Ahh! I have a NeoPixel on my M4!
Not yet, I just loaded the newest build of CP.
Hm. I thought it was working? Maybe I'm not very observant
I'm not sure, I meant I hadn't gotten that far yet, not that it wasn't working.
You just got your M4 working? I thought I was the last to get mine going
I've had it working for a while. The NeoPixel update to CircuitPython was recent, I hadn't loaded that version yet. The NeoPixel update to the bootloader was a while ago. That's not what I was referring to.
I'm pretty sure I'm explaining badly here.
Either way: yay!
I'm staring intently at the m0 trinket board trying to imagine how I would fit a m4 on there
@idle owl I have a bugfix for neopixel incoming
That's good because I was having problems. ๐
did it freeze up on you?
Kind of. It's not mounting right and I had to reset it. I don't know if it's related though, could be something I'm doing.
kk, let me do a PR for this fix
@pastel panther 5mm (M0 21E) vs 7mm (M4 51G) square....might be possible?
There are some caps that would probably have to move and some vias but there is a bit of space where the adafruit flower is
Of course that would be too easy so I was thinking about wedging in one of those teeny tiny SPI flash chips ladyada found. That is questionable
so the gap between colors in rainbow cycle drops from ~70ms on the M0 to ~26ms on the M4
@slender iron That's fantastic!
@pastel panther maybe use the trinket pro form factor?
@tidal kiln I was thinking that would be a good way to expose more of the hardware, but the primo CP trinket dream is too good to not try
@slender iron ๐น
Guess I don't have to ask if you're going to be on show and tell tonight
goodbye to my sleep schedule, sigh
Questions on the project help channel from @tough flax:
"Hi folks... I know there's Cap Touch support for the Trinket M0 - do the same libraries work on the Feather M0 (Bluefruit LE in my case)? If so, how do you configure the pins?"
<@&356864093652516868> anyone know?
Framebuf is not included in ESP8266 port, which casuses incompatibility with SAMD port. Moreover, when framebuf is not included OLED screens can't be used to print strings.
https://learn.adafruit.com/adafruit-feather-m0-basic-proto/pinouts <-- here is the pinout, and here is the list of pins and the functions they support: http://circuitpython.readthedocs.io/en/2.x/atmel-samd/README.html
You can install the Python implementation of framebuf, which should make all the drivers work (albeit slow): https://github.com/adafruit/micropython-adafruit-framebuf
The problem is that the python framebuf.py does not support text.
The protected single function call saves stack values and LTO
breaks the expectations of nlr_push and pop.
I guess today is bug fix day
You can use other libraries to render text, such as my https://bitbucket.org/thesheep/font454 or Peter's https://github.com/peterhinch/micropython-font-to-py.git โ there is an example for the latter at https://github.com/peterhinch/micropython-samples/blob/master/SSD1306/README.md
See how this is done in py/stackctrl.h. We use __asm volatile ("");, which is more of a guarantee than __attribute__((noinline)) (which is ignored in certain circumstances.). Also, if you want to declare as noinline, the macro MP_NOINLINE is available, and is cross-platform.
@slender iron @timber lion @solar whale Hello guys
set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
PATH=/home/vagrant/xtensa-esp32-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin
:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
vagrant@vagrant-ubuntu-trusty-64:~$ cat $PATH
cat: /home/vagrant/esp-open-sdk/xtensa-lx106-elf/bin:/home/vagrant/xtensa-esp32-
elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/usr/local/games: No such file or directory```
This is also a good option for rendering text without framebuf: https://learn.adafruit.com/micropython-displays-drawing-text It's a library that you plug in a pixel drawing function so it can work with any kind of display (oled, neopixel matrix, etc.).
@slender iron @timber lion @solar whale Hello guys My $PATH seems servicable. I did complete a good micropython.bin generation today. Great Success. I did submit a correction/comment on Learn.Adafruit on the guide to compile. I included my specifc versions of the recommended resources (VB, Vagrant, & Git). Also two essential changes to the scripts provided. One: on first use only: " vagrant up --provider=virtualbox" . Two: make -C mpy-cross cd ~/micropython/esp8266 make axtls must be changed to make -C mpy-cross cd ~/micropython/ports/esp8266 make axtls
I think there is room for framebuf in esp8266. If you want to turn it on now you could trying building it yourself (maybe you did that already). We would like to have it available everywhere if possible. We'll have to see what fits in 3.0 when we get closer to being done.
@tulip sleet that sounds like a good project after finish the job @slender iron has me on.
great job @hollow tartan !
@hollow tartan I thought you were working on building micropython, not CircuitPython. That's what that issue is for.
Something they are working on for the CircuitPython 3.0 release.
@tulip sleet __asm volatile doesn't work for me
This is a board definition for the uGame project:
https://hackaday.io/project/27629-game
uGame is a small handheld game console programmable with
CircuitPython. The hardware part of the project is pretty
much stable by now.
This module is a part of the "stage" library, which is a tile and sprite engine for games using SPI-based RGB displays. The library is part of the ยตGame project (https://hackaday.io/project/27629-game), and contains optimized low-level code for rendering the data and sending it to the display as fast as possible. It's not enabled by default in any ports, even though in general it could be useful outside the ยตGame.
I'm still working on documenting and releasing the "stage" library itself.
@tulip sleet i think this was brought up monday: https://www.youtube.com/watch?v=azf6yzuJt54
"Speaker: Daniele Procida Nearly everyone (especially in the Python community) agrees that good documentation is important to the success of software project...
in case you haven't seen
@slender iron you mean the asm it doesn't compile or it's not effective?
@slender iron regarding changing i2c read_into -> readinto. You mentioned initially adding readinto and making read_into method display some kind of warning. (deprecated). I assume this is a print() statment in the init method. what were you thinking?
@fading solstice I was thinking a note in the docs
lol, micropython 1.9.3 bumped the mpy version number again
@slender iron that's weird because I had the opposite problem with the stack checking routines (or at least I thought I did). But the proof is in the testing.
it is a different use
this was calling a finalizer from the garbage collection that was failing
k, I believe you! In the other routine I needed to make sure it had a stack frame so I could get the address of a lcoal
I will place recreate a new method in i2c from readinto, which will be functionally equivalent to i2c.read_into. I will also change the docs to say the i2c.read_into is obsolete and will be deprecated.
Question: what version of circuitpython will i2c.read_into() be removed?
@tulip sleet can you send me the usb pid master list?
Upstream bumped the version of mpy again with 1.9.3. The version bump was required due to a reordering of unary bytecodes.
Do we want to inherit this version and require new libs for everyone? Or should we revert this format change and potentially have to bump later if the opcodes are used in a different way later by upstream?
@stuck elbow that link makes me think we should always use kwargs to begin with
Also I assume that this issue only effects the library BusDevice and not core module busio, where there is a readfrom_into() method for i2c and readinto for spi.
@slender iron not necessarily, the labels don't have to be in the source, they can be in the programming environment โ so the editor can add them
right, but then you require a specific editor
@slender iron especially since we are pretty thin on memory
well, you recommend a specific programming environment for learning
I think that @plucky flint 's Mu works for that quite well
๐
@plucky flint we are talking about http://worrydream.com/LearnableProgramming/ if you are wondering
@mrmcwethy Lets say 4.0 for removal.
What do you think about readfrom_into? It could be replaced as well. It'd just be a bit weird because it'd still take the address as a parameter.
We have most of it is merged already. We just need to decide about the mpy version bump (#399).
https://github.com/micropython/micropython/releases/tag/v1.9.3
I'm not sure yet, but I don't think it needs anything special. It's just one struct and one function, and the only thing they need is the spi write function, so I think it should just work out of the box, but I haven't tested it yet.
Ah, sorry, wrong pull request. The board itself is basically as trinket m0 haxpress with custom pins.
Answering here is ok because I don't expect you to submit a board for a version you can't test.
We don't have SPI support quite yet but will soon. Once we do, please migrate your dev to it. Thanks!
what library bundle should we use for testing m4? the 'main' one?
yeah, let me know if you see funny behavior
they aren't actually exactly compatible
so the uf2 you just linked + the latest bundle release = OK?
maybe that's it. did you put that in manually? delete .mpy, add .py?
here's what i get just using the bundle:
Adafruit CircuitPython 3.0.0-alpha.0-153-gb6587b3 on 2017-11-01; Metro M4 Express with samd51j19
>>> import board
>>> import neopixel
>>> pixels = neopixel.NeoPixel(board.D8, 4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "libraries/drivers/neopixel/neopixel.py", line 79, in __init__
TypeError: 'bool' object is not iterable
i've got 4 breadboard neopixels tied to d8
Oh do we need to attach something external? I was trying to control the onboard one.
shouldn't matter. i just wanted to exercise more than one
@tidal kiln are you using mpy?
yes. hang on. trying .py next...
code here looks ok: https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/blob/master/neopixel.py
that may be the mpy thing
guess so:
Adafruit CircuitPython 3.0.0-alpha.0-153-gb6587b3 on 2017-11-01; Metro M4 Express with samd51j19
>>> import board
>>> import neopixel
>>> pixels = neopixel.NeoPixel(board.D8, 4)
>>>
k good to know
I should have said something. I thought I had forgotten how to do NeoPixel code. lol
they change the mpy format before bumping the version number
what's the mpy thing? its build isn't correct for latest python build?
answer before question. nvmd...
right, they changed the meaning of some the bytecode numbers
"some"? so some .mpy might work?
we will need separate .mpy packages for every version
I wish they were like .mp0, .mp1 etc.
right, only the unary ops
that makes it fun
also, didn't they had code in there that checked the .mpy version and threw an error?
more info on it is here: https://github.com/adafruit/circuitpython/issues/399
I think I remember they added it at some point
@stuck elbow yes but they didn't do the version bump when they changed it
- changed the bytecode
WHAT?
yup
what?
cries a little
yeah....
I forgot that micropython has the "we will fix it before the release" development model, and not the continuous integration/delivery one
then again, if they made a couple of changes before the release, they don't need to bump it several times
yeah..... numbers are free though
up to 31 bits, anyways
they just bumped to 3 so I think they have time
so sounds like a somewhat temporary issue, will be ok when version bump happens, then version check will work?
yeah, I opened the issue because we coudl actually revert the bytecode change instead
that makes us more different from micropython though ๐
can we put it back when they bump the mpy version?
yeah we could. we just have to be more aware of the changes they are making
or we could bump the version now
right
in other news:
>>> pixels[0] = 0xff0000
>>> pixels[1] = 0x00ff00
>>> pixels[2] = 0x0000ff
>>> pixels[3] = 0xffbad2
i've got a red, green, blue, and hello kitty pink neopixel
nice!
and just to give a kudos to how easy you're making this....first time i've tried neopixel on cp
import. use. magic.
๐
@idle owl don't worry. i almost didn't raise my hand either.
I have a blue NeoPixel!!!!
oops, wrong blue ๐
Now it won't mount.
sorry, I cursed it
Bootloader mounts. I reflashed it. Still not mounting CIRCUITPY.
anything in the console?
@idle owl does your stored code work still?
Yes to both
I had a mass storage issue and my neopixel animation was still working
ooooh post it please
I think there are still gremlins in the usb
I tried to replicate it but couldn't after I saw it
USB device 239A802114110002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114110002 - fConsecutiveResetCount = 1.
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - fConsecutiveResetCount = 1.
SmartBattery: finished polling type 4
USB device 239A802114130002 - will be reset!
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - fConsecutiveResetCount = 2.
USB device 239A802114130002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USBMSC Identifier (non-unique): 0x239a 0x13 0x4201
Report bytes: input:64 output:64 feature:1Collections : 2Buttons : input:0 output:0 feature:0Values : input:1 output:1 feature:1Element value capacity 3348Report count: 1Report ID: 0 input:512 output:512 feature:8com_driver_GxxxDriver::probe(IOHIDInterface)
com_driver_GxxxDriver::probe fails
disk2: media is not present.
disk2: media is not present.
disk2: media is not present.
disk2: media is not present.
msdosfs_fat_uninit_vol: error 6 from msdosfs_fat_cache_flush
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
IO80211Interface::updateReport _peerManager is missing
SmartBattery: finished polling type 4
USB device 239A802114130002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1```
There's more before that too.
kUSBHostReturnPipeStalled seems suspect
@idle owl if you can figure out how to reproduce that it'd be awesome. I doubt its easy to though
I've reflashed it and reset it multiple times and keep getting this.
how'd you get there though? just set on board neopixel to blue?
Ah yeah. Yes, apparently.
Nope, will try. I keep forgetting I have a power adapter now.
๐
Nope I can't connect via serial either since it stopped mounting
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - fConsecutiveResetCount = 2.
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USB device 239A802114130002 - will be reset!
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - fConsecutiveResetCount = 2.
SmartBattery: finished polling type 4
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USB device 239A802114130002 - will be reset!
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - fConsecutiveResetCount = 2.
SmartBattery: finished polling type 4
USB device 239A802114130002 - fConsecutiveResetCount = 1.
USB device 239A802114130002 - fConsecutiveResetCount = 2.
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
USB device 239A802114130002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114130002 - fConsecutiveResetCount = 1.
SmartBattery: finished polling type 4
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1```
Yep.
Flashes a little at first like it's doing a status check, and ends blue.
I picked blue because it was a color that the status checks didn't give.
yup, thats a good idea
import board
import neopixel
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixel[0] = (0, 0, 255)
simple as that?
Yep.
Except I think I used pixels.fill because it wasn't working. I just realised it's because I tried to do it to pixel 1, not 0.
and it let you?
Yeah.
weird. there's a check:
https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/blob/master/neopixel.py#L157
1 didn't turn it blue, I'm not sure if it threw an error.
should that be n-1?
I thought I was formatting it wrong, so I did fill instead.
nvmd. >= works.
And now serial works.
wew!
And now I'm getting the cyan status flashing telling me my code is wrong.
>>> pixels[5] = 0xffffff
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/neopixel.py", line 143, in __setitem__
File "/lib/neopixel.py", line 103, in _set_item
IndexError:
didn't let me get away with it
Hmm. The serial connection keeps dropping. So it's not really working. But the code finally failed, I am getting the flashing status.
Reflash - runs the code successfully, turns the NeoPixel blue.
Yep, we'll get back to it ๐
Hey all! I'm teaching an intro to python/coding course at my university and we really to use circuitpython with the CPX (hardware is fun!)
Unfortunately the students will all have their own laptops, and essentially every operating system possible...
So how compatible is circuitpython across every OS?
@sturdy furnace Windows 7 is the trickiest and needs our latest drivers. Everything else works driver free I believe.
this is really the main reason I'm focusing on circuitpython for workshops, and not micropython or anything else
you just plug it in and see the files
๐
previously I made several workshops with the esp8266 boards, but there is always one person with the newest mac that has broken drivers, or something like that
and you spend half the workshop getting it to work
exactly, it's such a good learning tool.
Any recomendations on environment for this? Is their a way to give them a debugger, and a REPL without using puTTy?
how soon are you running it @sturdy furnace ?
it starts in march next year
(so plenty of time)
it has repl built-in too
cool cool, mu is our recommendation
oo thanks, I'll give it a try.
We are thinking of getting everyone to use visual studio code for the whole course.
I was going to test integration with that.
So.... I just made a new build and I'm still having the same issues - although frankly that's probably a more reasonable outcome since the build Scott posted shouldn't be any different.
I went back to the build Scott posted. Regardless, I'm consistently getting the same thing in dmesg. I'll wait to reload the bootloader in case this is worth further investigation.
I was getting ready to hook up a NeoPixel strip too. When I tried to save the updated code, it acted like it had already disconnected, but I'm wondering if main.py is stuck somewhere in the middle of the updated code, and that's why it's failing. I don't think that would explain the dmesg output though, but I don't know enough about what goes into dmesg to know whether failed code would impact it. - Edit: It does. Updated info @ 11pm.
@idle owl got everything plugged in? Lolololol ๐น
Always worth asking!
blue-tac: for when you're too cheap/lazy to buy a vice
Well.... my initial attempt at some debugger code compiles & links....
ya?
calling debugger() drops me into my debug repl from which I can continue ๐
it also responds to :c that returns to continue execution, and :b which for now prints "BACKTRACE"
exciting
oh wait, you're writing your own code?
@pastel panther I'm working on adding some debugging capabilities to MP/CP
@pastel panther my test file is: ```
def foo(x):
print("start")
y = 2
debugger()
print("done")
foo(1)
@umbral dagger That's awsome!
@umbral dagger Nice!
THIS SENTENCE WAS A TRAVESTY. IT HAS BEEN REDACTED FOR YOUR SAFETY.
I just got my jlink today so I'm eager to get debuggin'
@pastel panther Excellent!
@pastel panther This will all be from within MP/CP. You put breakpoints in your python code by calling debugger(). You run your code and when debugger() is called you get dropped into a repl (much like the top level repl with some extra meta-commands. but you're in the context of where debugger() was called. Access to any local variables, the stack, etc.
@pastel panther I'm just playing in a fork at the moment.
goes repo hunting
no commits in four days?!
taps foot impatiently
@pastel panther I haven't done much for the last few days. I picked it up tonight
@pastel panther With the above python file: ```>:./micropython debug-test.py
start
MicroPython Debugger
DD> :c
CONTINUE
done
:
@pastel panther Not much yet, but the first step.
Oh. I just got something new in dmesg. saved
@umbral dagger Are you working from some knowledge of how debuggers work or are you doing it de novo?
@idle owl do you have an issue for the stuff you're seeing?
Not yet. I'm not convinced that it's not just something I'm doing, so I hadn't reported anything yet.
Also, the drive shows up on Windows, but only on USB2.0. I renamed main.py to something else, and now it shows up on Mac as well. (Which is USB3.0)
Does USB 3.0 work on windows?
Yup.
Yep.
That sounds issue-worthy
Need to repro it.
@pastel panther This is not my first rodeo ๐
@umbral dagger Nice. I once worked at a place that made a binary static analysis tool that was pretty cool. Not exactly the same thing but cool none the less
@pastel panther This will be pretty basic, nothing fancy like a proper Smalltalk or Lisp debugger. Just stick your head in & look around, maybe change some variables.
@umbral dagger cool
@pastel panther Maybe more later, but no more tham needed, and with minimal (or zero) effect on size or performance.
@umbral dagger awesome
Ok. So only the NeoPixel code I have causes the issue. Going back to a blinky-only main.py doesn't cause the issues. Neopixel code as main.py consistently does the USB2.0 vs 3.0 thing, causes the same dmesg output and same issues with the serial REPL. But the NeoPixel code works, I can import a different filename in the REPL and I get my blue pixel.
strange
I'll deal with it tomorrow.
nice, I just cut the battery voltage diode on my feather m0 in half
Who needs reverse voltage protection anyways?
@pastel panther How did you manage that?
@cunning crypt I was cutting a header off to replace it with a different type. Or rather to replace it so it matched the one on the other side even though it was perfectly functional. Cause you know, electrons care what your headers look like. ๐ถ
Well, now in addition to replacing the header, you have to replace the diode!
I like to think of it as an excuse to by myself a hot air rework station
Is it an M0 Express? @umbral dagger did a thing on replacing the Flash chip with a bigger one, since you seem to need to replace everything.
shoves the other m0 perfectly functional dev boards under the keyboard
Yeah, but getting a hot air rework station would be great
Ya, I've got some flash chips on order for that mod
I'm also shoehorning a SWD header on while I'm at it
@pastel panther an SMD iron tip, some solderwick, and a pair of fine tweezers.
For a diode you can probably get away without the wick, but it might be nice to clean it up before replacing.
I've pretty much faced the einevitable move to solder paste/stencils and an oven. Putting that off as long as I can.
@umbral dagger I'm 110% sure I can only possibly fix this with a hot air station. Yup, I clearly must have a hot air station. No way to do it otherwise. Nope.
@pastel panther I see the logic in that.
My next big acquisition is a 3d printer. I'm waiting on a referrable from work that will take care of that, and maybe get me a better workspace while I'm at it.
Be carefule about that workspace. Electronics projects are like a gas: They expand to fill all available space
@pastel panther No lie
I know. I've been doign this off & on for a long time.
So you have less space left than the rest of us!
Nice. Mine is about that size with an extra tier for monitors and stuff. A friend gave me his old music desk so it even has built in rack rails, not that I need them for much.
@umbral dagger thatโs amazing! Please post a link to the repo on the issue @meager fog filed
I've started looking into this. Initially I'm playing in the unix port, but the code should all live in py/
@slender iron having very odd problems with latest master (b6587b3b6). I am loading the identical firmware build on two identical metro M0's. On one, neopixel turns very bright when plugged in, but only sometimes, other one it doesn't happen. Can sometimes get into repl on one or the other, but maybe require resetting system-udevd. Still see 30-second reset in syslog. I'm wondering if there's a wandering clock or something like that. Is clock locked to USB as in 2.x?
i need to go to sleep, but will try to be more systematic in the morning. Didn't see anything terrible in gdb on one when I was connected.
The repl works, but I don't have the context right yet, so you can't "see" local vars.: ```>:./micropython debug-test.py
start
MicroPython Debugger
DD> print("Hello, world")
Hello, world
DD> :c
CONTINUE
done
:
Reminder, the file being executed is : ```def foo(x):
print("start")
y = 2
debugger()
print("done")
foo(1)
So if anyone here wants some extra money, I've put some bounties on CP code I wish to exist. Because obviously the best solution is to throw money at my problems. But in limited quantities, because I still have bills to pay.
A link is useful: http://phoenixborntech.com/bounties/
@tulip sleet its possible its wandering. I thought I'd looked at it and it was ok. I don't think I'm handling usb callback failures well. In particular, see if you get a NAK or STALL on an endpoint.
@slender iron those ice40 boards are sweet
yeah I was thinking I need to make a digikey order
Do you have a part number for the USB jack? I found what I thought was the right one but it's subtly different
yup, let me look
here is one better: https://docs.google.com/spreadsheets/d/1PsXjGim6C2bTgLewq7IV2TV4Dt1g-ueLys6l54iHw9g/edit?usp=sharing
Google Docs
BOM
part name, symbol, size( imp), max current, unit price, units per build, units in stock, units on order, order total, Manufacturer ID, source url, datasheet, datasheet2
C 10 uF, C6, C14, C16, C19, C20, 603,$ 0. 26, 5, 7,$ 1. 30, C0603C106M9PACTU, https:// www. digikey. com/ products/ en/ c...
no promises its right
usb should be though
Are you doing FPLA/CPLD work on your mac?
not sure what you mean
Isn't the ICE40 a CPLD? I was asking if you're developing for it on your mac
I was under the impression most toolchains for working with FPGAs and similar didn't generally support macs
ah, I only know of it as an FPGA
icetools works on mac I believe. I put some effort into adding ice40up5k support to them and someone else has done some more work on it
this is interesting: http://edunham.net/2017/11/01/better_remote_teaming_with_distributed_standups.html
yeah, edunham is awesome
Hello. Would someone please explain to me why I ended up with a .elf instead of a . bin?
text data bss dec hex filename
573820 1076 64352 639248 9c110 build/firmware.elf
Create build/firmware-combined.bin
esptool.py v1.2
('flash ', 35456)
('padding ', 1408)
('irom0text', 539476)
('total ', 576340)
('md5 ', '736dd22c74c29ca10eb5742df6d341c4')```
you didn't get both?
I am checking . probably a stupid question because I need to sleep...
oh yea, it's right there
yep they are in the build directory! ```-rw-rw-r-- 1 vagrant vagrant 576356 Nov 1 20:12 firmware-combined.bin
-rwxrwxr-x 1 vagrant vagrant 894828 Nov 1 20:12 firmware.elf
great! good work @hollow tartan
Which cannot be seen from Windows; unless the last step to move it into the shared vagrant file. ๐
I'm headed to bed now but will be around tomrorow
ta ta
Thank you for the suggestions. I'm aware that there are other options available, but in my opinion such small differences between ports are very annoying, especially when they are not clearly shown in docs. I use both SAMD and ESP8266-based boards and my point is that if there is no real need to keep such differences between ports they should be removed.
- For the MBR in that link 0x0..0x3000 = 12KB (???)
<img width="546" alt="screen shot 2017-11-02 at 08 49 37" src="https://user-images.githubusercontent.com/181073/32315042-ce61b7e2-bfaa-11e7-8968-bcc05f58ec67.png"> - The bootloader also supports OTA updates via BLE, which is why it's so large
- I will probably combine the two file systems internally yes (nRF52832 variants without USB), and simply hide the config files, but I always need to be sure that we have 'n' bytes free for storing t...
@cunning crypt I don't know if that helps, but reading BMP files is super-easy
There is conflicting information about the sizes in the documentation. :(
I've listed below what seems to be the right/final settings for:
- S132 v2.0.1 (current feather52 boards)
- S132 v5.0.0 (future work and nRF52840)
S132 v2.0.1 with OTA DFU Bootloader
- CircuitPython Core: 228KB
- User Filesystem: 96KB
- Private Config Data: 28KB (which may get combined for 96+28=124KB total)
/*
GNU linker script for NRF52 w/ s132 2.0.1 SoftDevice
MEM...
Morning, AdaCrew! I haven't built firmware since last weekend and the volume of stuff has been ... high. Is Master stable right now (i.e., should I go ahead and build firmware for the M4)?
Answer: yes, Master seems to be stable. I have a REPL and (quite bright) NeoPixel. One thing I notice, though, is that I can't exit the REPL with a control-D. It just does a soft reboot and immediately re-enters the REPL (which is probably why I have a solid white NeoPixel instead of a pulsating green one).
Now off to shower and work!
@drowsy geyser thanks for the testing! Could you mention what board this is and OS this is on? We're having trouble with Linux (at least). Also could you write up an issue about ctlrl-D and the REPL? Tnx!
I recently purchased the Feather Bluefruit LE and got Circuit Python installed, but someone on the forums mentioned that Bluetooth doesn't work under CP. Is there are approximate roadmap to this feature working? Or should I flip it back to running Arduino code?
@tulip sleet Sure! This is the Metro M4 Express and the host computer is Windows 10. I use the Windows 10 Unix environment to build the firmware, but then bossac to flash it. I'll write up an issue in a couple of minutes. Thanks!
@hearty thistle we have started work on porting CircuitPython to the nrf52 chips, which have native Bluetooth. The Feather Bluefruit LE could be supported, but someone would need to spec and write a library. We're not working on that particular thing right now. There's an RPi Bluefruit Python library that could be a starting point
@drowsy geyser that's helpful, since it says the USB stuff is working OK on Windows
@tulip sleet Glad it's helpful! I had no problems mounting, remounting, or flashing the board. The only thing different was Windows asked me if I wanted to trust the connected device. I hadn't seen that before, and I'm unsure if it's device-related or an artifact of the Creator release updates.
@drowsy geyser I have a couple of Windows machines running Insider builds: I will try that
@tulip sleet Thanks. I'll take a look at the nrf52 ones. As you work on the code, would it be posted on the Adafruit/CP Github page?
Also, does the Feather 32u4 Bluefruit LE run CP and have BT support?
@hearty thistle No 32u4 (or any AVR) boards run CPy - not nearly enough RAM or flash. The nrf port will show up in adafruit/circuitpython, branch master, as it develops (initial stuff is there already - merging nrf MicroPython code into our tree)
Cool. Thanks. Will keep an eye out for it
sure! will be great to have some testers. If you browse, you'll also see an nrf52 branch, but that's out of date
I did a git pull and submodule update this morning (2017-11-02) and flashed the firmware to the Metro M4 Express. Afterwards, I got a solid white NeoPixel. When I connected to the REPL I got a prompt with no banner. The REPL works, though. When I hit control-D to exit the REPL it did a soft reboot and immediately re-entered the REPL. This happens repeatedly with control-D, regardless of whether or not I execute any Python in the REPL (not that I think it's likely that would change the behavi...
@tulip sleet My work machine is running the latest Microsoft internal build. I'll go home in a couple hours after I get some work done and get the M4 and try it the REPL on my work machine.
BTW, I created the issue on GitHub. I tried to capture all the relevant behaviors and the system configuration.
This branch is 1 commit ahead, 2 commits behind adafruit:master.
So I'm one step forward, two steps back?
progress is not always forward ๐
sometimes you need to take some step back
Do you mean we should run double extension files at a lower priority or just give a warning about them?
probably just run them at a lower priority - but a warning on REPL-open might be good
@siddacious if you're interested in taking this on, you can start by adding the list of files and we can do the warning later :)
rad. to extend my terrible idea...would it ever make sense to have a debugging backchannel thru HID...so REPL stays clean
Do we care about all the possible combinations or just doubling of the same extension?
i think all combos make sense?
It would probably be good to make up a table of possibilities or iterate through the combinations, instead of having multiple calls to maybe_run().
Heads Up people. Remember, in the old days, double file extensions were used for malicious intent. Anyone remember VBScripts? In my view, I would simply have the system ignore double extended files. I see no reason for them. IMHO.
I only say this because it reminded me of what George Santayana once said, "Those who forget the past are doomed to repeat it".
@slender iron The saved Atmel START .json files now no longer load as a saved project. โน
Downloading downloaded-zip/samd21.zip ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Could not populate ConfigContent from /opt/packs/Atmel/USB/0.0.1/templates/config/usbd_composite_config.h.jinja2 for config/usbd_config.h with configuration: Could not find element with ID "usb_composite_iserialnum" in wizard ""</p>
I needed to add some devices to get additional config constants...
lovely, can you load it on the web?
no, I get a less informative message that's equivalent: "
Failed loading project
Loading file did not complete successfully"
it's not obvious from the updated release notes that there was an incompatible change. "What's New" link in the upper right hand corner of START page just says they added more devices
I think I am going to take just 5 minutes and look at Dean's Arduino core (and the older D21 core).
yeah, asf4 sucks
I'm looking at their interrupt enable/disbale code now
it looks ok actually
there are parts that are fine, parts that are just missing, and parts that assume you want to set up everything via #define's.
yup yup
I have the I2C code written, just trying to get it to compile. WIll see if I can make it work before I get more annoyed.
I'd be happy to look it over if you need another set of eyes
my code is fine -- it's the library .c's that don't have all the config info, about baud rate. I had to add asf4_config/ sercom config file, and it doesn't have enough devices. I think I will just define what I need or hack it up. We set the baud rate at runtime anyway.
time for lunch anway - just heated up some soup
๐ I'll take a look at updating asf
don't spend too much time on it now - I think I need to short-circuit the configs. One problem may be that it will check that you can't overload the sercom's: they have to be divvied up among SPI, I2C, and USART, even though we potentially want to use anything anywhere
that ok. I'm curious if they've had usb changes
lol, atmel start uses jinja
Could not populate ConfigContent from /opt/packs/Atmel/USB/0.0.1/templates/config/usbd_composite_config.h.jinja2 for config/usbd_config.h with configuration: Could not find element with ID "usb_composite_iserialnum" in wizard ""
so you think they use jinja templates for the source code?(!)
oy, I think. I did think you could recover your config just by staring at the json.
that what I'm doing ๐
comparing it to something I just generated
I'm particularly interested because the json usb config changed
still version 0.0.1 though ๐
I'm having a challenge porting an Arduino SPI library to Circuit Python. SPI bytes are zipping to and fro, but i'm not seeing the identical sniff i see when I run the Arduino code. I document my challenge here: https://docs.google.com/document/d/1ICpaAfVQYYZULmi_ZxxGqk52SWFuQYYkc8R1Ldr73gY/edit?usp=sharing
Google Docs
I am porting the energyic_SPI arduino library to circuit python. There is a function in energyic_SPI called InitEnergyIC() I have written enough of the CIrcuit Python port to send/receive the SPI traffic generated by InitEnergyIC() up to writing and then reading Checksum 1. The Circuit Python c...
i'm looking for any insight and fully realize that is asking a lot...so don't expect any...
@bronze geyser what logic analyzer are you using?
yup yup, thats what I use too ๐
could you post the logicdata files so I can look in Logic?
i'll make some runs. i didn't capture these. This is because I am so close to being clueless. Just a few minutes..
I've got time to help now if you do
try putting it here. there is a file size limit you may hit though
and this same exact hardware works arduino code?
I have to Huzzahs (for convenience). So that is different. It is the same ATM90e26 Featherwing.
(where two == to)
hrm
i'm new to python. Perhaps it is in how i am handling the write and readinto?
I looked at the code and it looks ok to me
ok.. thank you.
the arduino capture seems weirder to me
because enable drops before the clock line
it looks like the phase is different
hmm...Arduino -> mode 2 -> polarity = 1, phase = 0 ...this is why i modified spi_device ...
the arduino capture looks like its capturing on the rising edge
ok. thank you. i need to brush up on phase/polarity as well as how it looks within the logic analyzer. Thank you for pointing me in this direction (i hope...)
i need to double/triple check...
it confuses me that the MOSI looks ok...
thats arduino
python phase
see how the MOSI line is shifted half a cycle to the left?
yes. however what is weird to me are the arrows on the sclk. for me, on both the arrow points down. for you on the arduino the arrow points up.
I changed it ๐
I changed the SPI analyzer's phase
@lofty topaz The case that you mentioned (presumably things like seekret_info.xlsx.exe) is sufficiently different than the scenario we're talking about supporting that the security risk minimal to non-existant. Good on ya' though for thinking about security; not enough people developing software do so.
I've got the simple version but I'll take a whack at the warnings and combo iteration when I get home.
OK... i changed the phase=1 w/in spi_device and the results are looking much better....in fact, they might be right but i need to check a few things. THANK YOU. Yippee!
@stuck elbow It's been.... many hours now, but Bitmaps are something that's crossed my mind. However, JPEG images are typically smaller, and if the end goal is to have everything running off of a SPI flash chip (VS an X-GB SD card), then filesize will be much more important. Even if I take a page from @umbral dagger and supersize the flash chip
@slender iron THANK you very much.
@bronze geyser no problem! I'm happy to help
that's not I/O stuff, though, those came from ARM, I think.
yeah, I'm still looking through it
I'm understanding better my compilation problems. The sercom baud register values are calculated via #define's, but it's generating warnings that appear to be just wrong. I may simplify the asf4_conf files, because to get a complete set of values I have to generate them separately (download a project with 6 I2C's, then 6 SPI's, etc. But the actual settings are very small: there's just a lot of boilerplate in the config files. It would be easier to see if all the comment noise were removed.
thats kinda crazy its #define based. can you replace the code instead?
but the comments are there to help you ๐
@tulip sleet I just updated asf4 master. do I do a merge into master_bugfixes now?
yes, and then from master_bugfixes into circuitpython. sorry for the tedium. The idea was there might be other ports than circuitpython.
not worth it unless you have to fix merge conflicts. but lemme know about any interesting changes
@tidal kiln (and @slender iron): sample declaration from the deptpartment of redundancy department:
/**
* \def CONF_CPU_FREQUENCY
* \brief CPU's Clock frequency
*/
#ifndef CONF_CPU_FREQUENCY
#define CONF_CPU_FREQUENCY 1000000
I reduced that to:
#define CONF_CPU_FREQUENCY 1000000
@tulip sleet @slender iron Wizards at work. Sorry, just kibitzin' again. You guy's rock. โ
omg. but what if it's already defined??!
actually guess that could happen, like something else wants to set it first
@slender iron there is a routine that calculates the baud rate register values -- it just depends on some other define values. That routine takes three args, including the sercom clock rate. The clock rate passed in is ignored (!) and fetched from the defaults instead. The defaults are calculated in the config files.
@tidal kiln yeah but we're not going to do that ๐
@cunning crypt that is true, on the other hand, JPEGs require a very complex algorithm and a lot of memory to decode, while you can practically pipe the bmp file directly into the display with very little processing
@stuck elbow That is correct! I have, however, come across an Arduino JPEG decoder library that runs very well on the ESP8266
It'll likely work on the M0, but I haven't tried.
@cunning crypt there is another possibility โ since you are going to have a converter program anyways, you could store the image in exactly the same pixel format as the display needs, and simply gzip it โ circuitpython/micropython already have gzip library built-in
@stuck elbow @cunning crypt you'd probably want a util for converting from jpeg/png/bitmap/whatever
@stuck elbow The goal is, ideally, NOT to have a converter at all. Hence JPEG. That way users can just drag their files into the appropriate folder on the CircuitPYthon device and it'll be able to pull and display as needed
@cunning crypt I mean, if you want to get tricky you might be able to transcode it as it comes in? Maybe?
sounds like a PITA
@pastel panther I, personally, am pretty poor with coding especially when it comes to things like this. That's why I'm throwing money at the problems (See: http://phoenixborntech.com/bounties )
My current designs use an ATMega328, or the experimental failure design used an ESP8266. They pull images off of an SD card and display them onto a wearable badge.
I want to make it as user friendly as possible, so I want to get everything working with CircuitPython. Since CP shows up as a mini flash drive, being able to drag images onto the drive is super and lets me get rid of the SD card.
You could always just wait until @stuck elbow inevitably releases a CP game engine
I used to do a lot with graphic files. This book was a godsend.
After sleeping on this I think its best to merge in the bump. Its ok to teach people to look for bundle that match their major version.
I'll do this in #400
@slender iron I agree. Change is OK, since it's a major version bump.
is analogio in cp3.0?
(3.0.0-alpha.0-153-gb6587b3)
no
thanks. guess that's why i can't import it.
๐
@cunning crypt though I'm lazy, so I'm using BMP in my engine ๐
@cunning crypt here's my sprite badge that displays PPM images on a double 8x8 dotstar grid: https://www.dropbox.com/sh/3nd3v2motkq8nhn/AAAYmXqzW2nQXptH_hMzSdW9a?dl=0 i've got other stuff going on and haven't had time to make it into a library and guide yet, but the pbm.py is a binary PPM parser
if you make a PPM in GIMP and save it as a binary it can read it
but you probably don't have memory to store it, so it has a concept of visiting the pixels
ppm is wasteful
as you visit them you draw on the display
doesn't matter if it's on SD card
and it's easier to parse
it's like 20 lines of code ๐
anyways take a look at main.py to see how i use it
this is what it looks like: https://twitter.com/tdicola/status/921219015267061760
every time it draws a frame it's just reloading the image ๐ like i said it can't load them in memory so it just reads them and draws pixel by pixel
can get about 3-4 FPS like that
so not fast but good enough for simple sprite animations
So I narrowed down all the issues I was having yesterday with the M4 to a specific code snippet being the only code in main .py. I have no idea why, it doesn't make any sense to me. I included all the code in another main.py with other code, and it doesn't cause any problems.
@idle owl do tell! I was just gonna start looking after I eat lunch
Oi. I think I need to reboot. Atom crashed a bit ago, hadn't reopened it. Tried to open a file from the M4, crashed finder, and if I go to /Volumes/ and try ls, it hangs. Whee!! Be back in a sec.
yup, bad usb can do that
It was fine once I figured it out yesterday though. Connected and reconnected repeatedly. I now unplugged it and Finder came back up. Either way, rebooting.
k I'll be around
0864a69 py: Clean up unary and binary enum list to keep... - dpgeorge
36f7952 py/objtype: Clean up unary- and binary-op enum-... - dpgeorge
ff93fd4 py/persistentcode: Bump .mpy version number to ... - dpgeorge
8c7db42 stm32/modnwwiznet5k: Get the IP address of an e... - Li-Weiwei
98dd126 tests/extmod: Add test for '-' in character cla... - dpgeorge
I โค closing issues
Not even plugged in and I had to manually shut it down. Wouldn't reboot on it's own. ๐
also @cunning crypt I see the bounty you mention for drawing shapes and text, have you seen these guides and libraries? https://learn.adafruit.com/micropython-displays-drawing-shapes and https://learn.adafruit.com/micropython-displays-drawing-text they both work with circuitpython and give you a GFX-like library for shape drawing and text rendering without framebuf module
just be warned it's slow.. it's all pure python so you don't get much speed for shape drawing
but works well for UI etc
Well, for the speed and shapes I'm not terribly worried about speed.
yeah for speed you'll want to use the framebuf modle and its built-in C functions for sure
but that needs a m0 express of some sort, the basic m0 builds can't fit it in right now
or you could look at making a custom build that strips out stuff you don't need and adds it.. gets trickier though
I had to reset it once to get it to mount to Finder. But it's working now.
@idle owl so it all works?
Ok, so yesterday I wrote up a main.py to turn the onboard NeoPixel blue. It started having issues connecting. It would allow me to connect via serial and sometimes get to the REPL, but it would drop that connection after a fairly short amount of time. My Mac is using USB3.0. So I plugged it into Windows USB3.0, it showed up as "removable drive" but wouldn't let me do anything with it. Connect it to USB2.0 on the Windows machine, popped up immediately. So I renamed main.py to something else, and it showed up immediately on USB3.0 on both Windows and Mac. 100% reproducible as of last night. I went back to blinky-only main.py and had no problems connecting. I included the exact code from the main.py that was causing issues with the blinky-code, and no issues.
So... the same code is included with other code an doesn't cause problems. But alone, caused all of the above problems.
I can try it again. Windows is up on a different machine, so I don't have to take any time to switch it back and forth.
hrm
Oh and I was getting consistent errors in dmesg when it was having issues connecting.
hmm
So the current main.py includes bliinky, onboard blue NeoPixel and a rainbow animation on a NeoPixel strip. And other than the issue I had a few minutes ago which sorted itself (and may have been Atom related anyway), I haven't had any issues with the current code.
hrm
๐
I'm distracted by the jlink connection issue
Oh and also it could get to the bootloader through all of that, but reflashing CP, both the build you posted (which is what I went back to) and one I built did not resolve the connection issue with the specific main.py. Every so often after the serial connecction would drop, it would either stay at the white status NeoPixel or it would go to where it flashes yellow and cyan to tell you that you have an error in the code. But most of the time, the code continued to run - I had a blue NeoPixel most of the time.
I can file an issue. I'm never convinced that it isn't something I'm doing, so I hesitate to file issues until I get a second opinion.
I'll want to see if I can repro it again though.
its definitely an issue
just fyi, as an experiment (on Linux), this morning I turned off the msc descriptors in the .py descriptor generator, so I just had a repl. Then I did not have any issues connectingto the repl, 30-second resets, etc.
I tried putting the code into an entirely new file as well in case the file got corrupted, that did not resolve it either.
@tulip sleet could you give me a beagle trace with the issue?
sure - right now I'm putting everything back together after incorporating the latest changes. But i'll do it on the tip of master, not my i2c code branch
@tidal kiln You sure you want to? lol. I can't get it to show up anywhere now. Also, I made the mistake of not copying it locally and realised 2 seconds after I hit reset that I should have. If/when I get to it, I'll grab it and post it.
while CircuitPython is running.
yeah. sure. can always recover via j-link.
ok, my drive failed the first time here
perfect! Thanks
on an M0 (not M4), I loaded the latest 3.0 master, turned on tracing, then plugged the USB plug in
k, will look after I look at this msc thing
Hah! Got it back!
insert 'Stella got her Groove Back' reference here
@idle owl what you describe sounds like the neopixel code is not letting the circuitpython code do some usb stuff, but the blinky code does, and so if you mix the two, it still gets time to do some maintenance stuff โ at least it looks like that to me
@stuck elbow Could be. I was thinking something like that, but I don't know enough about USB3 vs USB2 to explain why it works on one and not the other.
I'm guessing here too
@tidal kiln I rename this to main.py and it'll let me get to the REPL and interact with it at least once more before I eject and reset it, then the problems start.
Also tell me if my code is wrong. That's what I thought was the problem to begin with, except that it works. I get my blue light.
I would add a sleep in the loop
don't need loop, and i think default is true for auto update, so maybe don't need show
or just drop the loop completely, you don't have to keep setting the pixel to blue
but i wouldn't call those things "wrong"
That's what I had at first, but it wasn't working (that wasn't why) and I added it when I was trying to make it work, and never removed it because it worked. (My issue before was pixels[1])