#circuitpython-dev
1 messages · Page 159 of 1
So I haven’t been able to test it for any other displays beside the ST7735 .but the only major changes were made inside of Rgb.py. And I renamed some variables
why did you rename them?
This turns a hard crash in a recursive generator into
a 'maximum recursion depth exceeded' exception.
ok, then do git 'checkout master' to get back to the master branch
and do the whole dance again
git checkout master
but with a different branch name
also, I can't see your pull request, did you make it?
Okay, when I get I t working I will. Thanks you so much for the help again! Separately: I know that framebif isn’t technically supported anymore but the text needs it to work. Do you know if it could be exported separately?
Or where to find it. I’ve checked both adafruit and micro python repos but the one I found doesn’t have text in it.
it isn't supported?
but first time I hear about it not being supported
I checked on the circuit python wiki and it said it was unsupported and might stop working anytime. I will send link when I get home
@stuck elbow it says that on the RTD page: http://circuitpython.readthedocs.io/en/latest/docs/library/framebuf.html
@marble hornet the best way to see if it is enabled, is to check the mpconfigport.h file in each port: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/mpconfigport.h#L191
that's for the SAMD boards. nRF will have it in the future. but, as the note you mentioned says, we don't maintain it (that i know of)
so ill have to port out the internals of it, or a ada_gfx could be made for circuit python
porting it out will be even less efficient. it's currently written in C and compiled with the firmware. if you write in Python, you then need space to import it. that is why it is only enabled on the Express boards. the nRF52x boards are Cortex-M4 chips, so they also have enough room on-board.
unless by port it out you mean write another core/firmware driver...
yes, thats what i meant
ahh. ok.
but that a task for another time, at least ofr me. this works on 2.2.4 for now
ive been thinking, i know that framebuf supports multiple color formats could a unified display library be made? or is it best to separate monochrome from rgb? becasue then all types of lines and circles or curved rectangles could be only coded once
i'd be 100% willing to chip in on the coding !!
but i don't have the expertise to code something of that magnitude alone
anyone in?
<@&356864093652516868> Meeting will be at the normal time tomorrow here on Discord. Everyone is welcome. It's at 11am Pacific / 2 pm Eastern http://everytimezone.com/#2018-4-1,1800,b8jj
I'll be... Going to the airport then.
Plane leaves at 130
And I am actually currently in Pacific time
😃 let me know if you are ever in seattle
@slender iron Likely will be in May
ok keep me posted! I'll be in cleveland for pycon in May but should be here otherwise
I think you are on the right track. The interrupt should fire on the specific first edge and then fire on both. This can be very tricky to debug since the DHT will return the data even if you are stopped at a breakpoint.
I'd suggest having a Saleae to validate that the sensor is responding OK. (Ping me if you don't have one.) That can also be useful to validate the measurements against a "neutral third party" so to speak.
Other than that, I don't have any specific ideas.
I'll be there the 18th through 20th if I go
I see it ~30 seconds longer for the unix part of the test. I'm willing to pay that price because it speeds it up for you locally. :-)
to seattle? I get back from the midwest on the 19th
@stuck elbow (when you are around) what was the reasoning for gamepad to take in DigitalInOut objects instead of Pins? Were we thinking it could be expanded to pins off the MCU?
Fixed by #732 and #733. Thanks @deshipu
@dhalbert Is this on your radar for your USB work?
Please update this. (I think merging the parallel PR messed it up.) Thanks!
The con I am (probably) going to is right near the Seattle airport
👍
Try commenting out this reset_mp(). https://github.com/adafruit/circuitpython/blob/master/main.c#L303
reset_mp is what resets the heap and the top level VM state (via mp_init()) I believe.
I'm open to this but don't want to add the work to 3.0. Lets consider it for 4.0 after 3.0 is ready.
@slender iron it seemed like a good idea to take the most primitive object type necessary, and let the user create it — just like with the spi and i2c objects
generally that would let you use a pin object from a pin expander driver or something — though in this case, with the functions in C, that won't work
Thanks, I will give it a go.
I wonder if this could also be an option for #184 — have a flag that controls whether to reset it or not after running the file.
We could put in a check for travis vs local.
@tannewt rebased, thanks for the heads up.
@dhalbert just change each --auto-jobs to -j1 in .travis.yml, I think.
.. so explicitly set them to run serially with -j1.
(as discussed on #729)
@stuck elbow Pin seems more primitive to me if you want to restrict it to pins on the microcontroller
@slender iron internets down out here, wont make meeting
@tidal kiln okie doke. will record and post later. thanks for your help here on discord @tidal kiln
@slender iron maybe I expressed that wrong. I prefer to avoid creating the resources inside the library, and instead like to pass them into it — usually that makes things more flexible and simpler.
yeah, I agree with that
there is no particular reason for that in this case, of course, and we can easily add code that checks if the passed objects are pins, and then create the digitalio objects for them
it does feel a bit unpythonic to be checking the type of the object to see what to do with it, though
<@&356864093652516868> meeting starting soon!
@twin mica I heard you..
sorry - I won't be able to participate today - group hug!
thanks @solar whale !
Definitely need some more that...
I am currently heading to the airport to go home. No news from me.
None for me today
hi text only
@meager fog any hug reports?
What...Dyno got me.
i gotz a hug for @idle owl for helping noe & pedro with this weeks 3D printing project, the trampoled 😃
9 Likes, 1 Comments - Pedro Ruiz (@videopixil) on Instagram: “#led trampoline 📸🎥 #3dprinting #adafruit”
boing boing
CGrover you got some netlag on your audio.
EDIT: I got about 96 percent of what you said.
Holiday light controller. Trinket M0 and CPy feeding various NeoPixel strips. Has internal 6 hours on, 18 hours off timer.
I use morse code for status updates via piezo buzzer. ;)
STATUS: ON
@errant grail Is that for the 2017 season?
@opaque patrol 2018, if I get it done by November...
oh you caught me off guard. I'm good. ;)
Narrowing in on SAMD21 PulseIn debug (DHT22 issue; should probably see if it goes beyond that). Battery arrives today, so I can do the last test for serial_connected. 3.x issue list will determine next project.
Only just got audio, sorry. Catching up. Audio was hidden in sidebar since so many channels listed.
Solder practice
@opaque patrol moar flux!
Trying to create some cashflow putting together kits for UK educators, using Circuitpython compatibility layer for NodeMcu-M boards
will clean when done
I meant, you need to use more, the solder will then form nicely shaped joints
(or maybe just heat the pin a little bit more, to give the solder time to flow)
probably more heat
the more 1s, the faster it is
If the strip is physically long there may be series resistance to consider for brownout, but if it's fairly short, the problem will be starving the strip with an under-rated PSU.
For dimness I found you can boost halfway down the strip by providing power wires to bypass all the little wires along the strip
Might be different light tech I was using
Thanks everyone! #Alpha5 😄
Thanks!
👍
@hollow ingot excellent suggestion.
@hollow ingot that's exactly how you compensate for series resistance on the rails. ;)
power from middle-out. nice.
Will be up at http://shrimping.it when it goes live. Working on hardware sourcing right now.
Already sold 30 kits, even though they don't exist yet.
awesome!
Teehee
Sold to twitter: @teknoteacher who is very influential in UK education
Will be working with him and Exabytes to demonstrate WebREPL programming of Neopixels from ESP8266 running off 2xAA battery packs. Instant home IDE for kids to take home and have instant Python3
cool! keep us posted!
The prior stuff at @ShrimpingIt is the Arduino-compat kits I have already been shipping for a while. New stuff will all be Micro/Circuitpython
So here is a stupid idea, but maybe it has something useful in it. A lot of people have problem how the CircuitPython starts and what gets run when and so on — there is a lot of hidden stuff with the boot.py and main.py and all the other details. What if we simplified this by making it visible instead?
We could auto-create the boot.py file, and by default have the USB setup and filesystem-mounting commands in it, and also the "reset and run" command. This way people can actually *see...
weird i tuned in but never heard any audio. discord (shrug) 😃
@hollow ingot your start.shrimping.it does not suggest a useful bookmark title when saving it to bookmarks. It tries to save the bookmark as "What We Do ". I think the <title>my title</title> portion of static HTML will control what is suggested as the bookmark's title.
@meager fog I did not see an avatar for you in the audio channel.
weerid
im desynced 😃
Maybe you're an eighth of a second into the future and nobody's noticed yet. ;)
Great feedback. @timber mango The website is getting a root-and-branch reset this week. Will keep in mind. Previously a gnarly set of bash, pandoc, python and XQuery would you believe. https://github.com/ShrimpingIt/website_text/blob/master/src/xquery/index.xq got lost in my own experimentation until it was impractical to maintain, and recently Google has been complaining it's not 'mobile compatible' despite the responsive design. Now will be based on channelcat/sanic with regular Jinja2 templating and Boostrap styling ( https://bootswatch.com/united/ ) wrapping Markdown based content. Nice to be able to cleanly migrate at least the markdown from the last time round.
website_text - The text content of the http://start.shrimping.it site, before templating.
Haha that was a world salad from my outdated point of view. I learned to code HTML by hand and author static HTML pages. I later began using a Makefile to maintain them (mainly by bringing in common headers and footers to support a more detailed clickable menuing system).
That's how I started, and from there it went a bit insane https://www.youtube.com/watch?v=aXQ2lO3ieBA
From the movie "Pentagon Wars". Bradley Fighting Vehicle design and development. Any design engineer will love this scene.
I liked your site a lot. I should lead with that instead of the one flaw I noticed.
😃 I really value unfiltered feedback, thanks. I'll try to keep the good bits.
;) bueno. Yeah, I read a short lecture on making good HTML documents and they paid specific attention to the bookmark's title as suggested by the static HTML document. Obviously the readers can override it and supply their own, but a good title provided by the author is usually the better way to go about it.
Since some (most?) web browsers tend to auto-expand the width of a column list of bookmarks with wide titles (to fit the entire title) I like to keep mine very short, so that this does not happen on my watch (because of my choices) on the audience's web browsers.
For reference, everything on the site is designed to be stealable and repurposable by educators or anyone else under CC-BY-NC-SA so feel free if anyone can use any of the technical/graphical material, despite it being a bit retro targeting ATMEGA328 hence I am archiving it. I'll be using the same vector art for breadboarding etc. this time around, derived from Fritzing liberated for use with Inkscape.
I need to learn how to create Fritzing stuff in Inkscape (I already have a smattering of Inkscape experience from authoring orthographic projection maps for Wikipedia).
Grab me cefn@cefn.com if you need anything. A lot of components and approach is in https://github.com/ShrimpingIt/projects/blob/master/vector/common.svg (only really makes sense in Inkscape given special layers).
Thank you! Will do.
Working on prototype Simon Memory Game using MCP23017, driven by NodeMCU (a remix of http://start.shrimping.it/project/memory/index.html )
Would you please help me to capture video with Raspberry Pi?? I have connected usb web cam with raspberry pi... A beginner here... Any help would be great
Looks infinitely more approachable using ESP32 board as pictured below, but cost differential is high for classroom kits, esp given two 400pt breadboards on top of high-quality USB cable. Still trying to optimise the sweet spot for this kit. Even considering ESP8285 ESP1 and trying to squeeze on a single 400pt breadboard to get sub £10 retail (equivalent to £5 if you source yourself http://start.shrimping.it/kit/#pricing).
Sorry I haven't had my head in here much recently. Focussing on writing and hardware for the time being.
@stuck elbow @slender iron Yes, I'd started work on a way to look into running CP code (loaded and started from the REPL or by the auto-load process). It can do a breakpoint and example/manipulate globals, and resume. Breakpoints can be conditional with an arbitrary boolean expression.
@umbral dagger It's no secret that electronics is a 'winter sport' for me. We got good weather here (despite the odd snowfall yesterday).
Although we did work on my brother's audio amps over the weekend (that's electronics) the main focus was on the visit, which I think was a direct result of the improvement in weather. Doesn't take too many of those events (people coming out of hibernation to come out to play) to pull me way off of microcontroller-related projects.
:wonders whereabouts @timber mango is: we had snowfall yesterday here in eastern Nebraska, USA
jepler I'm in Connecticut. Been to Nebraska (once) to drive through it. That was a long drive. You guys got some real estate out there!
@timber mango There are some who would like us to embrace startup culture and become the "Silicon Prairie". We'll see how that pans out. But yes, lots of wide open spaces and agriculture here, with more livestock as you go to the west.
The Interstate thru Nebraska was mostly flat land, which can be nice (I lived in eastern New Mexico for a couple of years and got used to a strong prevailing wind, and a rather flat landscape on the macro scale -- plenty of small hills, though).
There is so much land not being put to use specifically. That's probably a good thing overall.
It's getting nice here. I'm hoping we've seen the last of snow for the season. It's at the time of switching between winter jacket weather & hoodie weather.
<@&356864093652516868> Meeting recording is here: https://youtu.be/aXZcRvgJWDI Thanks to all who joined!
Notes with timecodes are available here: https://gist.github.com/tannewt/f3e67e0f3448ae5d69a78e01a99a005d Join here for the chat all week: http://adafru.it/d...
@idle owl Nice looking guide!
@umbral dagger Thanks!
Everything is set and the guide is live! https://learn.adafruit.com/circuitpython-essentials
@deshipu thats a great idea! Mind filing a separate issue for it?
Right now the behavior of CircuitPython at startup has a lot of details that are hidden, and have to be learned by reading tutorials, rather than by exploration: what files are run on startup, where to put USB-initializing code, etc. We could make it more visible by putting most of the initialization functions in a boot.py files created from a template on board startup whenever it is missing. Then people can simply look inside to see what is happening, experiment with modifying the contents...
@deshipu Sounds good to me!
I will try and see if I can get that as a compile-time flag first.
@tulip sleet looking at your PR now
@slender iron This might be helpful to understand the new usage (besides the incomplete example in the README): https://github.com/dhalbert/circuitpython/blob/3.0_hid/ports/atmel-samd/tools/gen_usb_descriptor.py
where does args come from?
See the argparse stuff in the link above. I just didn't want to bother to substitute constants in the README, though I could.
ah! maybe we should include that in the usage example
(I realize I did it that way first)
or the reverse and remove all mention of args in the example
@slender iron I'd just as soon include it or, even NOT include a copy/pasted usage example, and just point to circuitpython for usage.
linking works for me
k, will change
k thanks!
@slender iron I need -Wno-error=lto-type-mismatch back again after jepler removed it. I removed the tuple2 decl (I need a tuple4 and I'd rather not have a special type), and now I hit that again. Or, I could build the tuple at run-time.
runtime works! gets us closer to doing it dynamically
k, will try that
fixed with https://github.com/adafruit/circuitpython/commit/cebcec5e63d594dda93917ffbecfde6d6fe5c5ca
works great, lets you know if you don't have pullups detected, available in 3.0 :)
@slender iron it appears to be difficult to create the usb_hid.devices tuple at run-time and have it in the right place. The problem is that the .devices attribute is in a static table right now, so the address of the tuple is known at compile time. This is the "module attributes can't be properties" problem. And I can't make a static tuple without making a special type to work around the gcc problem as you did. At this point I'd rather just put the -Wno-error=lto-type-mismatch back.
eventually we might change the way we get the devices list so it's a function call
Ah. Yeah it’s fine with me if it changes
change for 3.0 or later? I have to change the Python library if it changes
👏 🎉 @idle owl 🎉 👏
the guide looks great!!
@slender iron my thinking is that I don't know what I want the dynamic HID devices library API to be, so I'd rather not change it now and then change it later. Only reason not to keep the current thing is the compile issue on gcc 5 (or I make a tuple4 type).
@idle owl nice job on the guide!!
@raven canopy @solar whale Thanks!
I want to give you something to review now. This has a static .devices tuple and I put back -Wno-error=lto-type-mismatch for now so it will build. I can think about fixing that later before the final approval of this PR.
Tested on '21 and '51. I meant to rebase to remove the WIP before I merged from upstream, but forgot. Not sure it's worth rebasing now -- too many changes in between.
@river quest Blinka love!
So, @tannewt was correct that the problem is probably deeper in ASF. The above "simple" fix does not work after testing with a battery. Still stays "connected" after removing the USB connection.
Guess it's into the breach once more...
cdcdf_acm_is_enabled() returns a struct entry, which is set by respective cdcdf_acm_enable and cdcdf_acm_disable functions. In short...not dynamic. I'll keep pulling on these tomorrow to see where they're implemented.
Also, using the device class (usbdc) as opposed/in addition to the cdc class _cou...
@slender iron @idle owl I've started a draft "guide" of SAMD debugging with Windows and Atmel Studio 7. I envision it as a section in the current GDB/SAMD debug guide (or ladyada's Arduino version...but don't think it fits there as well). Spurred by re-listening to the meeting and the call for newsletter additions...and, ASF4 avoidance. 😄
@raven canopy I’d be happy to see it added to the gdb samd guide
👍 like i mentioned to kattni previously, i take forever to write. definitely won't get it in by tomorrow (tonight?).
No rush!
Is the m4, atsamd51j19? And can a atsamd51j20 be a drop in replacement?
@tulip sleet feel free to put the -Wno-error- flag back that you need, I can work around it just fine.. (but still, sigh.)
@tawny creek it seems the j19 and j20 have the same pinout, but I didn't dig any further down http://ww1.microchip.com/downloads/en/DeviceDoc/60001507A.pdf
@onyx hinge thanks - Putting it back is just a workaround for now. Still thinking about making the usb_hid.devices more dynamic, as the current method is not that flexible. Ideally it would be a property, but modules can't have properties, so probably will be usb_hid.get_devices() or usb_hid.Device.get_all() or similar.
@tulip sleet is it possible you have a new file util.py and forgot to git add it as a part of #738?
util.py is part of circuitpython/tools/usb_descriptor/adafruit_usb_descriptor. Did you git submodule update? It was already there.
@tulip sleet travis is failing: File "../../tools/usb_descriptor/adafruit_usb_descriptor/standard.py", line 25, in <module> from . import util ImportError: cannot import name 'util' make: *** [autogen_usb_descriptor.intermediate] Error 1
it's in the repo. I just cloned a fresh copy onto a laptop. I'm at the airport.
have a safe flight.
I'll see what happens locally if I build, but if any problem comes up it could also be my environment
did you git submodule update --init --recursive in circuitpython?
if you cd into tools/usb_descriptor, what does git log say at the top
travis does what travis always does
oh travis
sorry if I was too oblique. https://travis-ci.org/adafruit/circuitpython/jobs/361443324
locally at beb6ad2e4 Add USB HID support I did seem to get a good build after fiddling with the lto flag
so maybe it's travis who is confused in this case
travis logs show it getting the same ref in tools/usb_descriptor that you committed: Submodule path 'tools/usb_descriptor': checked out '1ad93335ef3b41c473612eb49b6cf81f69555797'
scratches their head
I see a diff problem. The gen_usb_descriptor.py script wants to create $(BUILD)/genhdr/autogen_usb_descriptor.h, but genhdr doesn't exist. I need to mkdir it on a clean build. The script should do that but it doesn't.
I think I added the command to do that once
maybe I forgot to make a pull request with it
it didn't used to create a .h file, just a .c file. I added the .h file in the latest version.
the .c file is in $(BUILD), not $(BUILD)/genhdr, which is where i put the .h file (for consistency with a different .h file.
@stuck elbow I do remember a problem like that with some other build dir
the pull request https://github.com/adafruit/circuitpython/pull/738 shows the top commit is beb6ad2e4, but the red × next to it goes to a travis build which says it's for Commit 5513099 https://travis-ci.org/adafruit/circuitpython/builds/361443323
so something may be weird on the travis side
hmm I may need to debug that when I get back. anyway, at least one other problem. and it turns out HID is not working properly on Windows or Mac; only works on Linux. So don't spend too much time on trying this out now -- more changes on the way
what luck, I'm on Linux too 😉
OK, the ref difference is because travis builds the merge-to-be, not the head of the pull request branch. beb6ad2e401ba4d1c5a9540fa912831bd49fe30d refs/pull/738/head 55130995dba4ee731b41d8f7fa4ef5121f594eea refs/pull/738/merge
hm anyone know if RunMode.BOOTLOADER is expected to be working in 3.0? http://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/RunMode.html — when I run this, it just reboots 'normally', rather than causing TRINKETBOOT to appear: import microcontroller; microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER); microcontroller.reset()
not sure if related: https://github.com/adafruit/circuitpython/issues/653
i've realized i'm not completely sure where i'm going with all of this
it's really simple stuff that i'm not quite sure how to actually do because all i've been doing is tweaking code i've found and nothing i've really done on my own
@unreal ginkgo what are you doing?
currently, i'm attempting to dissect the fidget spinner code to get a simple spinning light animation for the playground express
i know there's a much much easier way, it just hasn't occurred to me yet
im not
im not learning anything honestly
I don't know about you, but dissecting code lets me learn a lot, personally
i'm learning from it it's just
i'm not quite learning how to do much on my own
honestly all i'm really looking for is a thing to have chasing lights for a short bit
i had that with the bike light but
myeh
i'll keep looking around
@unreal ginkgo bike light? so you found these examples?
https://learn.adafruit.com/circuit-playground-bike-light/the-all-of-them-circuitpython
yeah, i was fiddling around with it for a different part
really bright for whatever reason
that's probably the easiest way to do animation, basically just loop and change with a delay
alright thanks
for animation, the part that matters is in the while not buttons_pressed(): block for each function
it's doing some fancy stuff so you can change animation with a button press, but that's what doing the actual animation
you can use cpx.pixels.brightness to change the overall brightness, just give it a value from 0 to 1, ex:
cpx.pixels.brightness = 0.3
you'll need to call cpx.pixels.show() to see the change
for the bike light code, you could just put this up near the top, like before the def buttons_pressed(): line
and in that case you woldn't need to call cpx.pixels.show() as that will be done for you by the animations
@onyx hinge thanks 🙏🏼. I have j20’s vs j19– slightly more memory too iirc but wasn’t sure if I can use it for cp
@idle owl Just had a chance to read your new guide. Wow. Easy to understand with well thought-out examples. Excellent!

What's next in the trilogy?
Return of the Blinka?
@tawny creek I didn't get down to comparing the memory maps. you may need to do a custom build of CircuitPython with some changes to the linker definition files...
actually now that I look I see there are linker defintion files for samd51x18, x19 and x20 in ports/atmel-samd/boards so maybe it's just a matter of selecting the right one
I can't seem to find the pulseio module. I downloaded https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20180403/adafruit-circuitpython-bundle-2.2.3-mpy-20180403.zip
but looking through the lib folder I don't see anything that looks like pulseio. Am I just being blind?
it's a core module:
http://circuitpython.readthedocs.io/en/2.x/shared-bindings/index.html#core-modules
the bundle is for libraries
Oh, just found it
I missed it the first time I did help('modules')
Thanks for the quick answer anyway!
the core ones are "baked in" (if board supports it)
libraries are like add-ons, drivers for various sensors, etc.
or, to put it another way, the core ones are in the circuitpython firmware - the file you get from here:
https://github.com/adafruit/circuitpython/releases/latest
thanks @onyx hinge noted :}
@errant grail Thank you!
Hi, good evening. 😃
@tepid summit o/ good evening
Some gave me a hint (in the forum), that this would be a good place to ask how to build a costum version version of circuitpython. I want to create one for the Trinket M0, but with neopixel build in!. 😃
@tepid summit hardware wise or you mean software*
@tawny creek (software) I currently use a .mpy, but that is a bit to slow for my purpose.
what are you building @tepid summit
I wrote a lib, that writes letters, numbers and some special characters and use the neopixel.mpy as imported module. That works fine, until I want to scroll the text a bit faster. 😉
@tawny creek I have the J20 on my toaster oven board. it works just fine
@tepid summit have you looked at how the circuit playground express is built?
@slender iron any idea why this isn't working for me on master branch? (just does a normal reboot) ```import microcontroller; microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER); microcontroller.reset()
.. I was trying to add "Reboot to bootloader" to ampy
@onyx hinge what version of the bootloader do you have?
it works by setting a particular memory section to a special value
@slender iron good question, I will figure out how to check when I'm back at home, or else just get a fresh one if it's a possible cause of this failing. It's whatever was shipping on new Trinket M0s in March.
I assume I have to go a level lower than TRINKETBOOT to update the uf2 bootloader
there is a file on the bootloader file system with the version number
@onyx hinge actually, no. you can load a uf2 that updates the bootloader 😃
if that breaks it though then you need a jlink or similar
@slender iron Sorry, I am not shure, whether I got that correctly. Do you mean something like the "Making your own UF2" of the https://learn.adafruit.com/adafruit-circuit-playground-express/adafruit2-uf2-bootloader-details site? In case this correct, I'd could use some backup /explaination.
@tepid summit Thats not what I'm thinking. Have you built CircuitPython yourself yet? What OS are you on?
I have always used a prebuild uf2. I have a Xubuntu and Win10. Both 64 bit.
ok Xubuntu will be easier to use
@slender iron :shivers: I don't have a jlink and anyway can you attach that to a trinket? I guess there are solder pads/test points on the underside for that.
@onyx hinge we can get you one. there are pads on the bottom
Guys, are there any news on CircuitPython support for the Huzzah32. I read somewhere (last year) that there were plans for it to be supported, but I haven't seen anything yet.
@onyx hinge you shouldn't need a different bootloader though. the reset problem is likely a circuitpython thing
@gusty topaz its on our radar but not being worked on. we're focused on the SAMD51 and nRF52 first
@slender iron I was guessing that it was a CP issue too, was going to test with released CP 2.x but ran out of time before coming in to work
@onyx hinge 👍
@slender iron I think Adafruit has a winner on the Huzzah32: really fast, enough RAM, WiFi+Bluetooth Classic+BLE, feather form factor. I really don't understand why doesn't receive much love, but I guess you guys know what you are doing.
@gusty topaz it looks like there is micropython for huzzah32 but that's only based on looking at some google hits, not personal experience.
@onyx hinge Yeah, I've been reading a lot a bout it in the last couple of days. However, there is no official support for BLE yet.
@gusty topaz that's a bit of a drag
@gusty topaz Its a prioritization thing. Core to CircuitPython is built-in USB which the ESP32 doesn't have
the new nRF52840 has it
@slender iron Do have some hint how to build this? I can Remember that I read a guid for mircopython, back the days where there was no circuit python.
@tepid summit https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/README.rst#setup
(sorry I'm doing a bunch of things at once)
@slender iron I see. No problem. 😃
@onyx hinge tell me about it. I'm using the board on a couple of my projects through the Arduino IDE. Programming it in C/Arduino is not as fun as coding in MicroPython/CircuitPython plus there is no support for a bunch of libraries yet. So, if you want to walk off the beaten path (thermal camera, IR pulses, etc), you are out of luck with MicroPython/CircuitPython.
@gusty topaz I'd be happy to help you add support 😃
@gusty topaz want to voice chat? I see you are in the channel
@slender iron Dude, few things would give me more pleasure than helping you guys with that project, but I'm afraid my coding knowledge is not up to your standards.
@gusty topaz I doubt that. We can always help you improve too
@slender iron Kind of hard to voice chat right now (attending a webinar at the office 😉 ).
kk
@gusty topaz I picked up two Trinket M0s, put one on a project built with Arduino and have the other one for playing with circuitpython. Like you, my first project wouldn't have worked in CircuitPython of today, because it needed to combine the analog comparator function (not supported in circuitpython) with a SPI slave bitbang interface (too slow to code in circuitpython).
@onyx hinge Yeah, I bought the Trinket Mo and the Feather M0 express just because they were designed for CircuitPython!. I didn't even had a project in mind when I bought them 😃
@slender iron so the Feather nRF52 will soon have support for CircuitPython?... it would be the ideal board for a project I'm about to start. Would it support BLE from the start?
@slender iron I cloned the circuit python, loaded the git sub modules and build the mpy cross compiler. No I have the get the the neopixel.py and put it in some magic folder? Or am I wrong?
@tepid summit look at the files in the circuit playground board folder
I don't know it off the top of my head
@gusty topaz preliminary support is in the 3.0.0 alpha. I don't know how well BLE is supported but it will be sooner than the ESP32
I don't think we should block this PR on fixing the after USB case. Its useful enough on start up. We likely won't do multiple USB enumerations until we switch to TinyUSB from ASF4.
@tepid summit lines like these: boards/circuitplayground_express/mpconfigboard.mk:FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
you'd add the line(s) you want in the mpconfigboard.mk file(s) for the boards you want to build. It looks like the rest is automatic, just "make clean; make -j5 BOARD=yourboard"
@raven canopy if you (or anyone else) have time tonight: https://github.com/adafruit/Adafruit_CircuitPython_Trellis/issues/4
@slender iron Seriously, I'd love to help adding CircuitPython support for the Huzzah32 in any way I can. I need to finish a couple of projects, but can we circle back in some weeks?
@gusty topaz Awesome! We'll be here when you have the time. In the meantime you could try the nRF52 build too
I am attempting to reset into the boot loader via the REPL via:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
microcontroller.reset()
- When running 2.2.1 : the board properly resets into BOOTLOADER mode (with the uf2 file visible in the mounted disk).
- When running 2.2.4 : correct behavior (same as 2.2.1).
- When running 3.0.0-alpha.3 : the board resets into normal running mode. Bootloader mode seems to be skipped or ignored.
...
@onyx hinge and @slender iron Compiling... Thanks so far.
@slender iron I don't have that feather board yet and it is Out of Stock on the store 😦
ah ok!
Weird, "osterwood" is inside my head.
lol, thats what I was thinking
Hi @slender iron ? Might there be some specific reason, why I can not. Move The firmware.uf2 to the TrinketBoot Drive?
@tepid summit what does it do? it should work
The last lines of the compilation are: Converting to uf2, output size: 366592, start address: 0x2000
Wrote 366592 bytes to build-trinket_m0/firmware.uf2.
that looks right
@slender iron When, I want to copy and past the firmware.uf2 to the TRINKETBOOT folder nothing happens. Like, nothing. 😉
it should copy over and reset
@slender iron Perhaps its due t the code on the board? I tried turning of thre trinket and start a new boot sesson and also I tried to load a "normal" circuitpython 2.2.4 trinket uf2 file.
if its in bootloader mode then I'd expect it to load ok
Hi @osterwood! I'm excited to hear you are designing a custom board! I'd love to have it supported in this repo when you are ready.
@jepler was just asking me about this bug too. I glanced at the related code but didn't see anything super obvious. Its a matter of writing a special value to a particular memory location before resetting. So, its likely a change in the linker scripts (which defines the location) that broke it.
I don't have cycles to currently look at it (I'm heads down on ...
goes to eat lunch
@slender iron have a good lunch. I am done for today. I have often update the firmware. Never had any problems. I also can not delete the main.py in normal mode. Strange.^^ But thats how it is...
cya.
some progress with the badge thingy
@solar whale Regarding your previously shared link on Micropython for ESP32, how do you know BLE is not supported yet (couldn't find anything related to it on the readme.md)
@stuck elbow what are you making ?
@slender iron oooh cool! :} also, very nice toaster oven build 😊
thanks @tawny creek !
so i managed to get the IR remote working with my code and what i want it to do so now what i need to figure out is how to get it to stop after playing the first time
update, removing the uh
last command = command seemed to work
soup for thought
haha. shouldn't it be a toaster oven? 😄
@raven canopy like all temp controls, it will eventually be a sous vide
hmmm. sous vide electronics manufacturing. "no more fried circuits". although, buoyancy might be an issue...
oh! so @here we have a 9pm ET adabox unboxing, HOWEVER, would anyone here ... NOW, like to see a #LEEK ?
YES PLEASE
ok fine here we go.... #LEEKS
go fir it.
go nuts
leeka
CPX2? 😮
Here come the puns
.....
😐
Yep. There it is.
heh
leeks :| lol
TWO LEEKS!!!!
itsybitsy
yay itsy
can I be the first to say nice
on gardening?
I both love and hate this server for the leek puns.
guys we have a leak in the server
ha just got that
thus concludes #LEEKS ... in the store sooooooooon
at least i'm doing well with my coding
Ooh looks pretty Teensy-inspired! Love the diagonal header pins on the corners
yay exciting!
Whoops I guess Itsy Bitsys already exist. Then the special part is that it has an M4?
@gusty topaz exactly. Nothing about BLE mentioned.
@river niche yup, m4
yup .. CORTEX M4 with 192k of RAM and 512k flash @ 120 MhZ ... and will not hurt anyone's feelings
@slender iron RE: Trellis issue - appears to be a Trinket issue. I recreated it on one of my Trinkets, but the exact same setup runs without a hitch on the Feather M0X. looking at the mpconfigport, only a couple I can think would affect it in the "flash size" definitions: array_slice, builtins_reversed, check_self_arg, and cpython_compat. (granted, i'm not entirely sure what all of those do...)
@raven canopy the array slice thing would do it
that was my #1 suspect as well.
since the assign in the driver is a slice assign
that's for BBQing.... 😄
lol
"Texas Crutch" as its known...
Very cool 'Leek' @river quest 😉 bet that'd add zest to any recipe.
happy that i seem to have everything working so far
so are we!
i'll get to the other 2 commands soon but for now i'll get the flashlight command working
Thanks for the quick reply! I'm not the right person to do a deep dive into linker scripts, so I'll watch and learn from the sidelines on this one.
I will be submitting patches once the next board rev is in and pin definitions are finalized. Thanks so much.
By the way -- really enjoyed your interview on The Amp Hour.
well! i can finally get this sorted all out properly
that feeling when the code syncs up perfectly
got a beginner circuitpython question here.... i'm trying to gain control over a servo motor using a CPX (2.2.3) and have been stymied at every turn.
tried following this guide: https://learn.adafruit.com/using-servos-with-circuitpython/overview but am getting nothing but seemingly random wiggles from the servo when i least expect them.
i'm connecting to the REPL using PyCharm, also wrote code to it via mu, and made some .uf2 files for it with the makecode drag-n-drop editor. so far nothing has worked and i feel like i must be missing something simple. power?
maybe i need to add more power?
Yes, something has moved _estack by 4 bytes! Pursuing further...
In CircuitPython 2.x branch, build-trinket_m0/firmware.elf.map:
Name Origin Length Attributes
FLASH 0x0000000000002000 0x000000000002e000 xr
RAM 0x0000000020000000 0x0000000000008000 xrw
*default* 0x0000000000000000 0xffffffffffffffff
Linker script and memory map
0x0000000020007ffc _estack = ((ORIGIN (RAM) + L...
@slender iron Trellis fix PR is submitted.
Commit efbf08266b6 moved _estack in order to ensure 8-byte alignment
of the stack, but the address of _bootloader_dbl_tap must remain
right at the end of SRAM.
I verified by reading the source that the 4-byte-aligned address is
used for all samd21 / samd51 boards in
adafruit/circuitpython@efbf08266b. However, I only tested on
trinket_m0.
Closes: #653
False alarm, I don't think #740 is actually related to this.
250 is the approximate max. how many & which modules are you importing?
uhhhhh
i've got 7 import things and i haven't even figured out what i need for the stuff i got in the mail today
no worries. you've now entered into the "optimize" phase. 😄
let me look up a thing
7 is going to be pushing it, most likely. are you using .mpy libraries?
did you get them from the bundle release page?
ok. good. that'll save you some heap space.
import adafruit_trellis
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA)
trellis = adafruit_trellis.Trellis(i2c)
trellis.led.fill(True)
I was just working on that, so it's burned into my brain. Summary: import the library, then use its API according to the documentation.
this guide can walk you through it better than i can: https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries
there. fixed to the non-board-specific version. (even though it isn't different)
i'm not quite sure what i'm looking at or for
a majority of my code is the same thing repeated in different ways 30+ times
well, we just need to slim it down. sorry if my previous posts confused you. I thought you were asking a general "how do I use libraries" question.
alright then
from the screenshot you posted, you could probably save quite a few lines by putting most of the recurring commands into a function that can be called over and over. if your time.sleep() calls are all the same, then the only thing to update each time is the RGB.
like this (give me a sec to type it out)
sadly, a majority of them are different
def update_pixels(new_brightness, rgb, sleep1):
brightness = new_brightness
pixels.show()
pixels.fill(rgb)
pixels.show()
time.sleep(sleep1)
# inside your current main loop
if command == 206:
update_pixels(1, (255, 34, 255), 0.6)
elif command == 207:
update_pixels(0.4, (113, 48, 0), 0.8)
the idea is, only write things the minimal amount of times you need to. if you have a line/lines of code (not including variables which can be passed differently) that is repeated a lot, put it in its own function and call the function.
you're welcome. all part of the process. kind of like writing. outline, draft, proof read, edit, repeat. 😄
yep. small chunks. then before you know it, you have a large chunk that works!
things i've got to figure out at some later date:
adding more pixels
sound and the really big wav files
really big wav files might be a challenge with blinka. i've been meaning to mess around with the standalone VS1053 board, but that's down the road.
it's an 18 second video turned into sound
that i'm currently dissecting frame by frame to make it able for the colors to sync up with the audio
well
now that i've got all that down
time to start condensing
well now that that's all out of the way
i seem to be getting some NEC repeat thing
however
i'm far too tired at this point to worry aboutr it today
i'll pick up on it some time tomorrow
Any news on this ? Starting to jump in circuitpython and I can see the benefits here. (Having experience with asyncio on Cpython)
My goal is to have this working for PyCon and I’m still on track for that. As soon as I get something that doesn’t break the world I’ll push a branch for people to play with.
I'm finally back home and will be happy to help with this. I feel somewhat responsible ;-)
tfw you left your fuzzer running and now have nearly 500 more crashes to triage
it should also fix them automatically ;-)
Hi folks. I'm having issues getting the MicroPython plugin working for the first time in PyCharm. (It keeps installing the 0.1 version from the repo). Where you do recommend I look for help?
Welcome back @jerryneedell! Responsible? For making things work, yes. 😄
I'm still trying to track down why the interrupt handler isn't firing beyond the first instance, as confirmed (for me) by watching breakpoints and callstacks. Help would be much appreciated.
@sullen axle did you get circuitpython working for you?
Hi @slender iron ! thanks for asking, i haven't yet got my servo to obey me
@sullen axle what servo library are you using?
using this library: https://github.com/adafruit/Adafruit_CircuitPython_Motor
k, thats the one I wrote 😃
tried on SG-5010, SG-92, & SG-51R servos, same issue with all of them, my problem is something bigger and/or simpler i think
whats the problem?
when i connect to them and follow along with the example code i don't get a response from the servos
they wiggle sorta randomly, but that's it
how are they being powered?
powering them with the circuit playground
thinking i might need another source of power
with 3v or 5v?
tried both
i.e. tried connecting to 3.3V pin and the Vout pin, didn't seem to make a noticeable difference
I did my testing through the servo wing
the SG51R is 5v power and you'll need a logic level shifter to 5v for the pwm signal
(probably need a shifter)
uh, servos need a lot of power
@slender iron actually might work without the logic level shifter, but definitely power that can provide at least 500mA or more is needed
usb is not good for that
I was using a separate supply
and the tiny voltage regulator on the cpx definitely isn't
and before you try, alkaline batteries are neither
especially the weak 9V ones
how easy is it to add 5v power if i'm sticking strictly to alligator clips and a CPX? maybe connect to battery pack (like https://www.adafruit.com/product/727) with some headers stuck in the JST?
the problem is that battery pack is still 3.3-4.5V
ok imma try the AAx4 method real quick and report back
@sullen axle do you have some of these? https://www.adafruit.com/product/3255
@tidal kiln i'm using reg alligator clips rn to connect to circuit playground's big pins https://www.adafruit.com/product/1008
hmmm. got any male-male jumper wires? for like bread boarding?
oh. then get some PID 3255's and then see how JP did it here:
https://learn.adafruit.com/combo-dial-safe-with-circuit-playground-express/build-the-circuit#wiring
on the CPX, VOUT is tied directly to the battery input
try the second one, with battery connected to CPX
woo! writing code to the main.py file via mu moves the servo! haven't figured out how to speak to it though pycharm yet tho... perhaps unnecessary
i've got JPs example to rotate the SG-5010 smoothly back and forth 180 degrees
works fine without extra battery pack, confusingly
extra?
it's powered only through micro USB connected to laptop right now
and red clip on VOUT?
yeah
you're powering via USB then
@slender iron i'm currently puzzling over how to use the REPL, am i following your guide correctly? feel like things in pycharm don't look quite right.
that use looks right
I think D3 was added in a newer version
the whole pin naming thing is weird
try the A version
as its labeled on the board
(not like Arduino)
oh yea maybe that's the problem. it's fine when I use "board.D5", but anything else (A5, D3) returns an error
you can do dir(board) to see everything it has
no D3 in 2.2.4 either
Adafruit CircuitPython 2.2.4 on 2018-03-07; Adafruit CircuitPlayground Express with samd21g18
>>> import board
>>> dir(board)
['A0', 'SPEAKER', 'A1', 'A2', 'A3', 'A4', 'SCL', 'A5', 'SDA', 'A6', 'RX', 'A7', 'TX', 'LIGHT', 'A8', 'TEMPERATURE', 'A9', 'BUTTON_A', 'D4', 'BUTTON_B', 'D5', 'SLIDE_SWITCH', 'D7', 'NEOPIXEL', 'D8', 'D13', 'REMOTEIN', 'IR_RX', 'REMOTEOUT', 'IR_TX', 'IR_PROXIMITY', 'MICROPHONE_CLOCK', 'MICROPHONE_DATA', 'ACCELEROMETER_INTERRUPT', 'ACCELEROMETER_SDA', 'ACCELEROMETER_SCL', 'SPEAKER_ENABLE', 'SCK', 'MOSI', 'MISO', 'FLASH_CS']
>>>
i'm having some confusion about how to use ctrl-C and ctrl-D in pycharm. do i need to use either to indicate when i'm done creating a function, to get back to the >>> ?
no. just hit enter a bunch.
>>> def foo():
... print("hello world")
...
...
...
>>>
until the ... become >>> again
I'm gonna do errands. I'll be back a bit later
@slender iron thank you for your help!
success! i have, despite myself, accomplished a simple project and had fun. taking a break to eat soup 😋
Ooh they're right.
thanks @idle owl
@slender iron np. I was taught Fritzing right... save the fritzing files. Makes for a quick-fix. Also helps that I haven't been fritzing for long so not a ton go though... also good naming 😄
feeling inspired to hook up servos to a circuitpython board tonight
@idle owl can't remember - is there a general guide page that links to your cpx library? or is it just the one like in the piano guide?
@tidal kiln There's not, and it's on my list of things I'd like to take care of. I get that question a lot and it seems like something that there should be.
@onyx hinge It's a lot of fun 😃
maybe part of the on going guide clean up / consolidation effort? seems like it should be talked about the in the CPX guide under CP
Or in it's own section in that guide was my other thought. Because I'd probably end up doing 1 page per feature.
So similar to the way we did the Essentials guide, make it its own guide and mirror it into CPX.
Is what I'm picturing at this point.
I have it written down, I need to remember to bring it up. That's the bit I keep forgetting.
remembering to remember? yah. me too.
😄 Exactly
anybody have a VL53L0X and want to see if they can replicate this:
https://forums.adafruit.com/viewtopic.php?f=60&t=133428
nvm. solved.
Adafruit CircuitPython 2.2.4 on 2018-03-07; ESP module with ESP8266 🕶
@onyx hinge are you having a problem with the esp8266?
@solar whale no, everything's fine. new addition to the family.
something seems weird with the IR remote stuff for me
keep getting an error or something saying NEC repeat
@slender iron something's still weird with reset modes. On my Trinket with master branch OR with 2.x, SAFE_MODE starts the bootloader
unless I misunderstand what SAFE_MODE is supposed to do
I get a red LED next to the power connector and TRINKETBOOT as the disk device
thats not right 😃
hardfault?
let's check this one more time ... ```Adafruit CircuitPython 2.2.4 on 2018-03-07; Adafruit Trinket M0 with samd21e18
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
microcontroller.reset()```
RGB LED is now green, and red LED is now pulsing
if I write the 2.2.4 uf2 again, the RGB LED is set to pulsing yellow
in other weirdness
my mini IR remote
seems to be working with my TV?
Model: Trinket M0
Board-ID: SAMD21E18A-Trinket-v0
@onyx hinge sounds broken 😃
@slender iron I would like for it not to be
// Set up the defaults.
_bootloader_dbl_tap = DBL_TAP_MAGIC;```
something seems fishy about that, only BOOTLOADER should set DBL_TAP_MAGIC, surely
ya
A baffling constellation of things are all broken near here. ```Adafruit CircuitPython 3.0.0-alpha.3-96-ga72cbda9e-dirty on 2018-04-04; Adafruit Trinket M0 with samd21e18
import microcontroller
microcontroller.RunMode.BOOTLOADER
microcontroller.RunMode.SAFE_MODE
ouch
the whole nec repeat thing is still confusing me and i'm not sure what is actually going wrong
nnnneat
turns out i just had some code in the wrong place
everything worked it just
was in the wrong places
I sure chased my own tail all night 😕 maybe I have rebooting sorted out now, but I'd better not rush to pull request before I test some more. and I feel like maybe ampy is still being flaky even before my changes 🙁 so I know I need to do some more analysis of what is happening
'night all
night @onyx hinge. self-tail-chasing is kinda what we do, right? 😄
Are there known problems with the itsybitsy_m0_express and CP3.0 current master? I cannot get the FS mount reliably - Just get a solid green Dotstar. I have tried wiping the FS. Just wanted to see if otheres are having issues with it.
This fixes a couple of problems with reset modes that I encountered:
- The 'BOOTLOADER' mode's repr said 'SAFE_MODE'
- All reset modes were acting like 'BOOTLOADER'
@stuck elbow in a quick look, the RTC header is in the ASF module. Not sure if/where it may be utilized though...
This feels like a stupid question, but on a Trinket M0, how can I tell whether rebooting to "safe mode" actually worked?
the repl tells you that you are in safe mode
and the usb disk doesn't mount
iirc
(not sure about that last one)
the docs say "Run CircuitPython in safe mode. User code will not be run and the file system will be writeable over USB." http://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/RunMode.html#microcontroller.microcontroller.RunMode
RGB Led should be yellow in safe mode.
@stuck elbow there is an issue for the RTC: https://github.com/adafruit/circuitpython/issues/671
@slender iron OK - I'll create an issue later when I can document it better
thanks @solar whale
@sullen axle @slender iron Do you mind me asking where the Pycharm guide you were referring to above is? Hi 😃
I finally got the MicroPython plugin working. I didn't have the latest version of PyCharm installed. Now I'm just trying to get it to talk to the Gemma M0 without success. The MU editor seems to work okay.
Thanks! I've seen this one. It's pretty good but it doesn't address much in the of troubleshooting. Which editor do you use?
Is MU the officially supported interface?
@regal whale Mu is used most often by folks at Adafruit. @idle owl uses PyCharm. I use Atom and screen in a terminal.
Thanks! Good to know what other options are popular.
@tannewt I think the only thing left from the lists above, is taking care of the FeatherWing example "readme". Other than that, guess it depends on what adabot is still complaining about...
@regal whale I use screen in a terminal for serial console output, but there is an unsupported plugin for PyCharm that puts the serial REPL in another panel within the editor. The Welcome to CircuitPython guide talks about it.
Thanks @idle owl, I'll check that out too.
blergh. Adalogger not seeing the SD card. Trying another format.
No dice.
Hi All, Just got a gemma m0 in my adabox... checked online & downloaded a nice LEARN document. I'm still waiting for a similar document for my Itsy Bitsy M0 that I bought a couple of months ago. Q- any idea if/when said document might, if ever, be produced??? Thx
@languid sage It's in the works! We don't have an ETA though.
@idle owl OK, I'll grow some more patience
Hah! The pin used in the code was wrong for my setup apparently.
Found the SD card.
But lost my I2C.
Ok it worked last night before I started trying to combine the sensor code and the adalogger code. So it's not the soldering. Why would it suddenly lose the I2C connection.
@idle owl can you link a gist or something?
Yeah. Give me a second, I just wiped and reflashed the whole board.
I'm using I2C scan to try to find the addresses
So right now, this: https://learn.adafruit.com/circuitpython-essentials/circuitpython-i2c#find-your-sensor
And it's finding nothing.
Yesterday it found the temp/humid sensor and the adalogger.
I just did another visual on my soldering and, while it looks awful, I can't see anything that shouldn't be there.
what's the hardware?
AM2320
is all there is at the moment.
Adalogger featherwing also, but it's not on at the moment
I was trying to back it off as far as I could
what feather main board?
Feather M0 Express
got any other i2c devices?
probably, does the adalogger count? Or you mean something else-else
else-else, like another i2c sensor
I don't know off the top of my head what's I2C and what isn't.
hmm
searching adafruit
joy featherwing
oh yeah, the rtc on the wing is i2c
how are these all stacked up / wired together?
the am2320 is wired to the proto area on the feather with resistors connected to 3v from scl and sda pins on the sensor
the adalogger would be stacked on top of the feather
feather has female headers, adalogger male
short headers each
for shorter sandwich.
am2320 inside sandwich?
that looks ok...
Limor thought so too, so that's another vote.
what value resistors?
what happens with i2c scan without the logger wing attached?
and it worked before?
at this point would want to see photo of real deal
Sigh ok yeah. It looks terrible. I've never soldered perf or proto board before. I'll do my best to get an image.
you can leave the logger shield off, just focus on what you have for that frizting setup
Way ahead of you on that one
IT WORKS NOW.
(╯°□°)╯︵ ┻━┻
😄
(I'm serious.)
I2C addresses found: ['0x5c']
Add the logger: I2C addresses found: ['0x5c', '0x68']
ah. posting photos scared the bug away. sometimes that works.
Except for the part where I'm now convinced it's going to be super flaky and work about half the time. Ugh.
that solder work looks fine btw
The first one I tried has a pretty well melted sensor. I assume it's the housing only but who knows. I mostly missed the sensor on this one.
couldn't get the other one to jumper. Didn't know to use wires across them.
Which is hilarious because I can jumper pins like a pro when I don't want them to be. 😄
were you power cycling the feather?
Physically hitting the reset button but not unplugging it completely.
hmmm. and it just started working?
Yes.
Well enough that I just set the RTC, evidently.
That's difficult to get right
I'm 1 second off. And planning to leave it.
well. i'd say keep moving forward and if it happens again, worry about it then.
Yep
and try to remember what the near term series of events were that led up to it
Right. Unplug it.
Photograph it and then plug it back in. 😄
And thanks for looking at the soldering. 😃
i think you need to post the photos as well
Ohh right, follow the whole thing.
just taking them doesn't work
@slender iron false alarm on the itsybitsy - rebooting my linux box solved the problem - just loaded current (as of 5 minuts ago) 3.0 master to istybitsy_m0 and all is well.
Everything is mpy'd, it's failing on import.
I deleted every other file I could off the feather, still exact same failure.
Trying 3.0, but I don't think that'll work for this project.
Failed memory allocation even harder.
which libraries are you using?
import board
import busio
import adafruit_pcf8523
import adafruit_sdcard
import adafruit_am2320
import digitalio
import storage```
Needs register, and bus_device
It's an I2C humidity/temp sensor, Adalogger Featherwing with RTC and SD card.
It was failing 160 bytes with 2.2.4, now with 3.0 it's 628 bytes.
I think I need to use 2.2.4 for this anyway for now, so I'm going to reload it.
I can't see the sdcard repo on adafruit's github?
That's weird? It's in the lib bundle
ah, it's called just SD
Ok 2.2.4 loaded, 160 bytes failing.
called adafruit_sdcard.mpy in the /lib folder.
so understandable confusion there.
I'm looking at those libraries, but I can't see any obvious way of reducing their memory footprint
other than rewriting them without the the bus_device and register modules
oi
Is there any trickery with separate files and importing them separately, or is the fact that it's failing on import mean that won't help
you can try changing the order of imports
that might help because of memory fragmentation
but it should be less common with 3.0 now
Tried changing the order of imports and it seems to act the same.
It likes to fail on the set of libs though, regardless of where they are.
the 3 external libs.
there is only so much bytecode that can fit in the memory
Is there a way to use the SD card for some of that?
not that I know of
ok
I was thinking we could write a C driver for sdcards
@idle owl does the i2c scan work without the wing?
I got it to work with it too
After unplugging it, photographing it, posting here, and plugging it back in.
cool cool
Now I can't get all the code to run without memory failures.
Not sure how to get you that.
its probably too much of a distraction
I don't know what to do with this.
failing with a larger number is a good thing 😃
@slender iron is it possible safe mode isn't implemented in master branch for samd devices ?!
This code runs at least, but never gets to inside the SD card part of the loop.
@slender iron okay I guess I should stop chasing my tail about not being able to enter it, then.
@idle owl what line does it fail on?
8 if all the code is uncommented, as that gist is, it gets to line 21, then does nothing
or rather
gets to inside the try, so I guess gets past line 23
I can put a print statement in there and it works
@idle owl try it without the try
hrm, so not memory
(Tried that already)
@slender iron I don't see an issue in circuitpython tracking lack of safe mode on atsamd, may I file one?
@onyx hinge looks like it should work: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/supervisor/port.c#L131
ah, the hard fault handler is different
@idle owl I'd need to dig and see what 30 is
py/mperrno.h:#define MP_EROFS (30) // Read-only file system
@slender iron https://github.com/adafruit/circuitpython/issues/245 has some stuff on it, I used SD Formatter to format it. It's a Sandisk 8GB card. I have larger ones that failed last time I tried so I didn't bother.
Or at least people were getting error 30 there. No one says what it is.
Meh.
30
>>> error.strerror
'Read-only file system'
>>> error.filename
'/Volumes/Untitled/test'```
So format the thing again I guess.
By plugging it into my laptop or using CP
using CP (put the file there with your compy)
There's already a temperature.txt file on there from CP earlier. How do I do that? I've never done it that direction
open with "r" and print (f.read())
try removing the loop
#define MP_ENOENT (2) // No such file or directory
there may be a bug if you open twice
same.
do you need "/sd/text.txt" or something?
without it it'll be relative to your current directory
It's wrong in the main code
that's the OSError
now I'm getting a new error, but at least there's that.
progress!
code.py output:
Logging temperature to filesystem
test print
Temperature: 21.9
Traceback (most recent call last):
File "code.py", line 41, in <module>
File "code.py", line 37, in <module>
File "code.py", line 35, in <module>
TypeError: object with buffer protocol required
Press any key to enter the REPL. Use CTRL-D to reload.```
35 and 37 are attempting to write to the sd card
41 is the pass under "RuntimeError"
temperature is a number but you can only write bytes to a file
oh
print is implicitly converting it for you but write won't
>>> "{}".format(100).encode("utf-8")
b'100'
>>>
probably want an \n too
I have no idea how to translate that to what has to go where in my code...
This is modified from the guide code: print("Temperature: %0.1f\n" % temperature) sdc.write("%0.1f\n" % temperature) print("Humidity: %0.1f\n" % humidity) sdc.write("%0.1f\n" % humidity) But I have a feeling it's not right
it runs
100 is temperature and put it in the write
"{}".format(100) formats the number into a string
and .encode("utf-8") encodes the string into bytes
PyCharm is complaining but the code is running
sdc.write("{}".format(temperature).encode("utf-8"))
print("Humidity:", humidity)
sdc.write("{}".format(humidity).encode("utf-8"))```
what is pycharm complaining about?
"Expected str (Matched generic type to AnyStr) and got bytes"
which matches what you said it should be doing anyway... giving it bytes not a string.
Yep it's running and PyCharm is happy
¯_(ツ)_/¯
we only have so much memory
and have only spent so much energy optimizing it
catching up...is there a way to "unload" an imported module? don't know of its existence in CPython, but space isn't much of a problem there...
I have to head out for this evening. Will likely check in late tonight.
later @idle owl.
unloading a module may be tricky, as all classes keep a reference to it
so as long as you have even one object created from that module, it stays alive
good point. that is a veritable minefield; having to deal with deinits...
the heap graph is useful to understand where the memory is being used
its not a huge priority though given we're quadrupling the heap soon
yeah, too close to the easy answer of "SAMD51" to spend much time on it... 😄
@slender iron on the samd21?
@stuck elbow no 51
but that requires new devices
heap is 20k out of 32k on the samd21 already
yup
it would be good to optimize the libraries but it loses out to getting the samd51 going
i still have an old 540MB HDD laying around. most people would wonder what it could be used for. point being, user will always drive capacity expansion. (queue Agent Smith virus rant)
SPI... RAM? Now THAT is a neat concept.
I wonder what it'd take to get that working with an M0/M4
swapping :)
I'm afraid the arm m0/m4 architecture doesn't have page fault interrupts
though I suppose the python virtual machine could emulate them
@idle owl you can do
print(blah, blah, file=f), where f = open(...) on, say, the SD card. That gives you the advantages of print() without having to do it manually with string formatting. Also note print(..., sep=','), which will print values comma-separated instead of space seprated. sep can be any string (including the empty string).
@sommersoft I agree with @tannewt that this is useful as is. Could you just add some documentation caveat that says this will detect if USB was connected at the time the board started, but doesn't detect disconnect (also connect? -- I don't know the answer) later? Then we'll merge it in.
@dhalbert it does catch the connect scenario (just tested BATT only -> BATT+USB). Just disconnect isn't caught. Working on some wording now.
@tulip sleet @slender iron RE: ^^^^ - Should I make the "no disconnect" note apply to only SAMD? Technically, as it stands now, nRF will never return false; true is hardcoded. I still need to get a new Feather52 and work that...
@raven canopy Sure, just note the limitations for each platform. ESP8266 too?
@tulip sleet i abandoned trying to put this into ESP8266: https://github.com/adafruit/circuitpython/issues/544#issuecomment-372009048
argh! extraneous merge in the commit...
luckily it didn't contain anything old. :phew:
@raven canopy don't sweat it -- as long as it's not in conflict, not worth rebasing or something like that
@lusty tangle here in #circuitpython-dev might be better (though #help-with-projects isn't a bad place either). What is the overall purpose your main.py is running?
@raven canopy thank you for letting me know. All I am attempting to do is make a mouse jiggler that lights up the dotstar while it's running. I did get the idea from the latest adabox however the tutorial that came with it did not work at all so I attempted to go a more traditional route with a bit of code.
I do not, however I can just create a gist real quick
that'll work just as well.
@raven canopy I should have just sent you the link to the jiggler guide: https://learn.adafruit.com/phantom-mouse-jiggler/mouse-jiggler
hehe. i'm on it (spent many o hours in the learn system) but, thanks! 😄
Ok, sorry I just happened to have it up. In case you're wondering what happened with that, when I flashed the uf2 file it seems like the Gemma didn't boot properly.
were you in bootloader (GEMMABOOT) when you flashed the uf2? (sorry for the obvious "tech support" question)
No problem, I know the routine. Yes. At first i couldn't get there so I attempted to upload to circutpy however there wasn't enough space so I read more carefully. (I couldn't get to GEMMABOOT due to the fact I was using a USB hub, once I corrected that I was able to get there)
when you plug the Gemma in, is the DotStar displaying any colors before you open Mu?
yes, multiple colors
what are they?
green 2s
orange 2s
orange .5s
blue x9 or 10 .5 s each
it continues to repeat that loop until I open Mu.
then it turns white?
Then off for 2 seconds, then it repeats
yeah, you're getting an OS error I think. let me try and run your code real quick.
actually, do you have it plugged in and Mu running?
Mu is not running at the moment, but it is plugged in
ok, open Mu, and in the REPL type <ctrl-d>
As soon as I open Mu it goes white. Ctrl + D in REPL causes my code to start running.
and it runs fine?
Correct.
hmm...
I also tried to use flash CircutPython 3.0.0 (alpha) but it couldn't find the usb_hid module so it defeated the purpose of my project.
yeah, still working on HID in 3.x.
Ok, not a problem, but figured maybe there was a bug in 2.2.4 so figured I might try 3.0.0 it see if it that resolved the issue.
@raven canopy by the way if I quit Mu the code continues to run, not sure if that information is of value or not.
what OS are you on?
Windows 10
hmm. the only thing i can see in your code is importing adafruit_hid twice. try removing the first one (import adafruit_hid; line 5).
though i'm not sure how that would still work in Mu, and not without it... 🤔
Just tried that, no luck still getting the flashing pattern.
I have the original main.py let me put that back in place and see what I get from that.
Ok, as soon as I uploaded that (not even opening Mu, just copying from the filesystem) the LED started fading between colors.
Correct, figured I would put that back in place to see if that changed anything. If I said I was familiar with python I would be lying, so feel free to tell me my code is bad and I should feel bad.
hehe. it's not. i'm no python wizard either, but I can't see anything that would be causing it. in your gist at least, no extra whitespace or indentation things that i can see...
I'm going to try with sublimetext instead of Mu, maybe there is weird windows line breaks that Mu is putting in, sorry I hadn't thought of that before.
Mu is pretty good, even on Windows (I'm a Win10 user myself)
Well, I can say that did not resolve the issue.
just pulled out a trinket (no gemma) to test on...
@tulip sleet Thanks! I'm sure I'll end up asking you about that print magic again when I end up wanting to use it
@idle owl sure - could not tell how far you were getting with the write() stuff
@tulip sleet I haven't looked at the file it is supposedly writing yet. But it's running at least.
The file doesn't look right anymore. There's no separation of values at all at the end.
@raven canopy does the blink pattern that I was describing earlier mean anything? I made some minor changes to my code and now the blink pattern has changed
the colors are supposed to mean something. i'm trying to get this trinket running, but i reset too quickly and now have to wipe it and start over. 😄
Oh sorry, I'll see if I can figure out what that blink pattern means then.
Status LED blink pattern? @raven canopy @lusty tangle
yeppers
oh yeah...that exists. i just go to the repo file... hehe.
someone should get an RGB color sensor and make a decoder for that
@idle owl do we have a flash eraser for the trinket? i thought there was a repo, but now i think i only remember the learn guide one (which is feather m0x)
If I am reading the status light correctly.. quick flash of yellow means 'other error'. Then 7 blue flashes, but no way that I'm 700 lines of code in
CYAN is pretty close to the BLUE, in my observations...
thanks @tidal kiln!!!!
ok! so if I get rid of the mouse code it works, so something wrong with my python for the mouse code
Yah sorry, same guide page, further down
my other trinket is SMD'd, so I just use that one lately... 😄
But, the problem is only when it's booting itself up, it's weird to me, but knowing myself it means I'm missing something small and seemingly insignificant.
If I put my code in there, then I unplug it, plug it back in and just save main.py again (no changes) it starts running as expected.
do you have the autorun in window set? i'm wondering if windows is blocking/getting confused on the HID+Storage Device...
I did, I turned that off but it didn't help.
so I'm getting the same results. i did increase it to move 10 pixels just to exaggerate...
I'm glad to know I'm not crazy at least
Based on the blink pattern the problem is mouse = Mouse()
@lusty tangle @raven canopy i'm totally walking in late here, but maybe try to recreate issue through REPL?
@tidal kiln that's the problem, when I open REPL everything works fine
yeah, i did that a minute ago (paste mode). same result.
gotta a link to gist with minimal example of issue? (seems like it may have changed from link above?)
found this issue from way back, but it's not an exact match: https://github.com/adafruit/circuitpython/issues/114
@tidal kiln (not the gist you're looking for)
@tidal kiln I updated it with the latest code that I'm running (https://gist.github.com/PhunkMaster/2e30385a77f7a3c03906da899b4f9ffe)