#circuitpython-dev

1 messages · Page 159 of 1

marble hornet
#

thanks!!!!!!! @stuck elbow it worked!!!!

#

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

stuck elbow
#

why did you rename them?

manic glacierBOT
marble hornet
#

Rotation

#

@stuck elbow

#

I’m working on that next.

stuck elbow
#

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?

marble hornet
#

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.

stuck elbow
#

it isn't supported?

#

but first time I hear about it not being supported

marble hornet
#

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

raven canopy
#

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)

marble hornet
#

so ill have to port out the internals of it, or a ada_gfx could be made for circuit python

raven canopy
#

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...

marble hornet
#

yes, thats what i meant

raven canopy
#

ahh. ok.

marble hornet
#

but that a task for another time, at least ofr me. this works on 2.2.4 for now

marble hornet
#

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

marble hornet
#

anyone in?

slender iron
cunning crypt
#

I'll be... Going to the airport then.

#

Plane leaves at 130

#

And I am actually currently in Pacific time

slender iron
#

😃 let me know if you are ever in seattle

manic glacierBOT
cunning crypt
#

@slender iron Likely will be in May

slender iron
#

ok keep me posted! I'll be in cleveland for pycon in May but should be here otherwise

manic glacierBOT
#

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.

cunning crypt
#

I'll be there the 18th through 20th if I go

manic glacierBOT
slender iron
#

to seattle? I get back from the midwest on the 19th

manic glacierBOT
slender iron
#

@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?

cunning crypt
#

The con I am (probably) going to is right near the Seattle airport

slender iron
#

👍

manic glacierBOT
stuck elbow
#

@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

manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

@stuck elbow Pin seems more primitive to me if you want to restrict it to pins on the microcontroller

tidal kiln
#

@slender iron internets down out here, wont make meeting

slender iron
#

@tidal kiln okie doke. will record and post later. thanks for your help here on discord @tidal kiln

stuck elbow
#

@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.

slender iron
#

yeah, I agree with that

stuck elbow
#

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

manic glacierBOT
slender iron
#

<@&356864093652516868> meeting starting soon!

raven canopy
#

@twin mica I heard you..

solar whale
#

sorry - I won't be able to participate today - group hug!

slender iron
#

thanks @solar whale !

raven canopy
#

Definitely need some more that...

cunning crypt
#

I am currently heading to the airport to go home. No news from me.

opaque patrol
#

None for me today

timber mango
#

hi text only

slender iron
#

@meager fog any hug reports?

raven canopy
#

What...Dyno got me.

timber mango
#

i gotz a hug for @idle owl for helping noe & pedro with this weeks 3D printing project, the trampoled 😃

raven canopy
#

Yep...

#

Group!? Hehe

#

Thanks Dan!

timber mango
#

boing boing

#

CGrover you got some netlag on your audio.
EDIT: I got about 96 percent of what you said.

errant grail
timber mango
#

I use morse code for status updates via piezo buzzer. ;)

stuck elbow
#

STATUS: ON

opaque patrol
#

@errant grail Is that for the 2017 season?

errant grail
#

@opaque patrol 2018, if I get it done by November...

stuck elbow
timber mango
#

oh you caught me off guard. I'm good. ;)

raven canopy
#

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.

hollow ingot
#

Only just got audio, sorry. Catching up. Audio was hidden in sidebar since so many channels listed.

opaque patrol
stuck elbow
#

@opaque patrol moar flux!

hollow ingot
#

Trying to create some cashflow putting together kits for UK educators, using Circuitpython compatibility layer for NodeMcu-M boards

opaque patrol
#

will clean when done

stuck elbow
#

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)

opaque patrol
#

probably more heat

stuck elbow
#

the more 1s, the faster it is

timber mango
#

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.

hollow ingot
#

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

raven canopy
#

Thanks everyone! #Alpha5 😄

errant grail
#

Thanks!

raven canopy
#

👍

errant grail
#

@hollow ingot excellent suggestion.

timber mango
#

@hollow ingot that's exactly how you compensate for series resistance on the rails. ;)

errant grail
#

power from middle-out. nice.

idle owl
hollow ingot
#

Already sold 30 kits, even though they don't exist yet.

slender iron
#

awesome!

hollow ingot
#

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

slender iron
#

cool! keep us posted!

hollow ingot
#

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

raven canopy
#

Very nice indeed!

#

👋

manic glacierBOT
#

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...

timber mango
#

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. ;)

hollow ingot
#

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.

timber mango
#

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).

hollow ingot
timber mango
#

I liked your site a lot. I should lead with that instead of the one flaw I noticed.

hollow ingot
#

😃 I really value unfiltered feedback, thanks. I'll try to keep the good bits.

timber mango
#

;) 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.

hollow ingot
#

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.

timber mango
#

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).

hollow ingot
timber mango
#

Thank you! Will do.

hollow ingot
thin marsh
#

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

hollow ingot
#

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).

umbral dagger
#

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.

timber mango
#

@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.

onyx hinge
#

:wonders whereabouts @timber mango is: we had snowfall yesterday here in eastern Nebraska, USA

timber mango
#

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!

onyx hinge
#

@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.

timber mango
#

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.

umbral dagger
#

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.

slender iron
umbral dagger
#

@idle owl Nice looking guide!

idle owl
#

@umbral dagger Thanks!

manic glacierBOT
#

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...

slender iron
#

@tulip sleet looking at your PR now

tulip sleet
slender iron
#

where does args come from?

tulip sleet
#

See the argparse stuff in the link above. I just didn't want to bother to substitute constants in the README, though I could.

slender iron
#

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

tulip sleet
#

@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.

slender iron
#

linking works for me

tulip sleet
#

k, will change

slender iron
#

k thanks!

tulip sleet
#

@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.

slender iron
#

runtime works! gets us closer to doing it dynamically

tulip sleet
#

k, will try that

tulip sleet
#

@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

slender iron
#

Ah. Yeah it’s fine with me if it changes

tulip sleet
#

change for 3.0 or later? I have to change the Python library if it changes

raven canopy
#

👏 🎉 @idle owl 🎉 👏
the guide looks great!!

tulip sleet
#

@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).

solar whale
#

@idle owl nice job on the guide!!

idle owl
#

@raven canopy @solar whale Thanks!

manic glacierBOT
#

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
#

lets see if this works

#

it did!

idle owl
#

@river quest Blinka love!

manic glacierBOT
manic glacierBOT
raven canopy
#

@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. 😄

slender iron
#

@raven canopy I’d be happy to see it added to the gdb samd guide

raven canopy
#

👍 like i mentioned to kattni previously, i take forever to write. definitely won't get it in by tomorrow (tonight?).

slender iron
#

No rush!

tawny creek
#

Is the m4, atsamd51j19? And can a atsamd51j20 be a drop in replacement?

onyx hinge
#

@tulip sleet feel free to put the -Wno-error- flag back that you need, I can work around it just fine.. (but still, sigh.)

tulip sleet
#

@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.

onyx hinge
#

@tulip sleet is it possible you have a new file util.py and forgot to git add it as a part of #738?

tulip sleet
#

util.py is part of circuitpython/tools/usb_descriptor/adafruit_usb_descriptor. Did you git submodule update? It was already there.

onyx hinge
#

@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

tulip sleet
#

it's in the repo. I just cloned a fresh copy onto a laptop. I'm at the airport.

onyx hinge
#

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

tulip sleet
#

did you git submodule update --init --recursive in circuitpython?

#

if you cd into tools/usb_descriptor, what does git log say at the top

onyx hinge
#

travis does what travis always does

tulip sleet
#

oh travis

onyx hinge
#

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

tulip sleet
#

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.

stuck elbow
#

I think I added the command to do that once

#

maybe I forgot to make a pull request with it

tulip sleet
#

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
#

ah, it was some other directory then

#

never mind

tulip sleet
#

@stuck elbow I do remember a problem like that with some other build dir

onyx hinge
#

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

tulip sleet
#

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

onyx hinge
#

what luck, I'm on Linux too 😉

tulip sleet
#

gotta go now

#

thanks for looking, though, this is helpful

onyx hinge
#

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

indigo wedge
#

Got me some merch 😄

onyx hinge
unreal ginkgo
#

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

stuck elbow
#

@unreal ginkgo what are you doing?

unreal ginkgo
#

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

stuck elbow
#

I don't know about you, but dissecting code lets me learn a lot, personally

unreal ginkgo
#

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

tidal kiln
unreal ginkgo
#

yeah, i was fiddling around with it for a different part

#

really bright for whatever reason

tidal kiln
#

that's probably the easiest way to do animation, basically just loop and change with a delay

unreal ginkgo
#

alright thanks

tidal kiln
#

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

unreal ginkgo
#

Well
That works

#

Any tips on how to make it not completely blinding?

tidal kiln
#

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

tawny creek
#

@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

errant grail
#

@idle owl Just had a chance to read your new guide. Wow. Easy to understand with well thought-out examples. Excellent! blinka minerva

#

What's next in the trilogy?

tidal kiln
#

Return of the Blinka?

onyx hinge
#

@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...

manic glacierBOT
onyx hinge
#

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

astral vessel
tidal kiln
astral vessel
#

Oh, just found it

#

I missed it the first time I did help('modules')

#

Thanks for the quick answer anyway!

tidal kiln
#

the core ones are "baked in" (if board supports it)

#

libraries are like add-ons, drivers for various sensors, etc.

tawny creek
#

thanks @onyx hinge noted :}

idle owl
#

@errant grail Thank you!

tepid summit
#

Hi, good evening. 😃

tawny creek
#

@tepid summit o/ good evening

tepid summit
#

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!. 😃

tawny creek
#

@tepid summit hardware wise or you mean software*

tepid summit
#

@tawny creek (software) I currently use a .mpy, but that is a bit to slow for my purpose.

tawny creek
#

what are you building @tepid summit

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. 😉

slender iron
#

@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?

onyx hinge
#

@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

slender iron
#

@onyx hinge what version of the bootloader do you have?

#

it works by setting a particular memory section to a special value

onyx hinge
#

@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

slender iron
#

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

tepid summit
slender iron
#

@tepid summit Thats not what I'm thinking. Have you built CircuitPython yourself yet? What OS are you on?

tepid summit
#

I have always used a prebuild uf2. I have a Xubuntu and Win10. Both 64 bit.

slender iron
#

ok Xubuntu will be easier to use

onyx hinge
#

@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.

slender iron
#

@onyx hinge we can get you one. there are pads on the bottom

gusty topaz
#

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.

slender iron
#

@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

onyx hinge
#

@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

slender iron
#

@onyx hinge 👍

gusty topaz
#

@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.

onyx hinge
#

@gusty topaz it looks like there is micropython for huzzah32 but that's only based on looking at some google hits, not personal experience.

gusty topaz
#

@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.

onyx hinge
#

@gusty topaz that's a bit of a drag

slender iron
#

@gusty topaz Its a prioritization thing. Core to CircuitPython is built-in USB which the ESP32 doesn't have

#

the new nRF52840 has it

tepid summit
#

@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.

slender iron
#

(sorry I'm doing a bunch of things at once)

tepid summit
#

@slender iron I see. No problem. 😃

gusty topaz
#

@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.

slender iron
#

@gusty topaz I'd be happy to help you add support 😃

#

@gusty topaz want to voice chat? I see you are in the channel

gusty topaz
#

@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.

slender iron
#

@gusty topaz I doubt that. We can always help you improve too

gusty topaz
#

@slender iron Kind of hard to voice chat right now (attending a webinar at the office 😉 ).

slender iron
#

kk

onyx hinge
#

@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).

gusty topaz
#

@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?

tepid summit
#

@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?

slender iron
#

@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

manic glacierBOT
onyx hinge
#

@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"

slender iron
gusty topaz
#

@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?

slender iron
#

@gusty topaz Awesome! We'll be here when you have the time. In the meantime you could try the nRF52 build too

manic glacierBOT
#

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.
    ...
tepid summit
#

@onyx hinge and @slender iron Compiling... Thanks so far.

gusty topaz
#

@slender iron I don't have that feather board yet and it is Out of Stock on the store 😦

slender iron
#

ah ok!

onyx hinge
#

Weird, "osterwood" is inside my head.

slender iron
#

lol, thats what I was thinking

tepid summit
#

Hi @slender iron ? Might there be some specific reason, why I can not. Move The firmware.uf2 to the TrinketBoot Drive?

slender iron
#

@tepid summit what does it do? it should work

tepid summit
#

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.

slender iron
#

that looks right

tepid summit
#

@slender iron When, I want to copy and past the firmware.uf2 to the TRINKETBOOT folder nothing happens. Like, nothing. 😉

slender iron
#

it should copy over and reset

tepid summit
#

@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.

slender iron
#

if its in bootloader mode then I'd expect it to load ok

manic glacierBOT
#

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 ...

slender iron
#

goes to eat lunch

tepid summit
#

@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.

stuck elbow
gusty topaz
#

@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)

marble hornet
#

@stuck elbow what are you making ?

tawny creek
#

@slender iron oooh cool! :} also, very nice toaster oven build 😊

slender iron
#

thanks @tawny creek !

unreal ginkgo
#

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

river quest
#

that's for @slender iron

#

blinka serves it up'

tawny creek
#

soup for thought

raven canopy
#

haha. shouldn't it be a toaster oven? 😄

river quest
#

@raven canopy like all temp controls, it will eventually be a sous vide

raven canopy
#

hmmm. sous vide electronics manufacturing. "no more fried circuits". although, buoyancy might be an issue...

river quest
#

oh! so @here we have a 9pm ET adabox unboxing, HOWEVER, would anyone here ... NOW, like to see a #LEEK ?

marble hornet
#

YES PLEASE

river quest
#

ok fine here we go.... #LEEKS

smoky spear
#

go fir it.

river quest
unreal dove
#

go nuts

sick creek
#

leeka

river niche
#

CPX2? 😮

true coyote
#

Here come the puns

river quest
#

.....

smoky spear
#

😐

true coyote
#

Yep. There it is.

sour hawk
#

heh

river quest
spare thorn
#

leeks :| lol

unreal dove
#

wrong image, or

#

ooh

sick creek
raven canopy
#

TWO LEEKS!!!!

river quest
#

itsybitsy

marble hornet
#

yay itsy

unreal dove
#

can I be the first to say nice

marble hornet
#

on gardening?

true coyote
#

I both love and hate this server for the leek puns.

unreal dove
#

guys we have a leak in the server

marble hornet
#

ha just got that

river quest
#

thus concludes #LEEKS ... in the store sooooooooon

unreal ginkgo
#

didn't notice the swearing

#

sorry about that

slender iron
#

@unreal ginkgo deleted due to the swearing

#

no worries

unreal ginkgo
#

at least i'm doing well with my coding

river niche
#

Ooh looks pretty Teensy-inspired! Love the diagonal header pins on the corners

candid sun
#

yay exciting!

river niche
#

Whoops I guess Itsy Bitsys already exist. Then the special part is that it has an M4?

solar whale
#

@gusty topaz exactly. Nothing about BLE mentioned.

slender iron
#

@river niche yup, m4

river quest
#

yup .. CORTEX M4 with 192k of RAM and 512k flash @ 120 MhZ ... and will not hurt anyone's feelings

raven canopy
#

@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...)

slender iron
#

@raven canopy the array slice thing would do it

raven canopy
#

that was my #1 suspect as well.

slender iron
#

since the assign in the driver is a slice assign

raven canopy
#

ok. time to put my thinking hat on then...

#

looks for thinking hat

fresh knoll
#

Tin foil?

#

😃

raven canopy
#

that's for BBQing.... 😄

fresh knoll
#

lol

raven canopy
#

"Texas Crutch" as its known...

fresh knoll
#

interesting

#

kentucky here

solar atlas
#

Very cool 'Leek' @river quest 😉 bet that'd add zest to any recipe.

unreal ginkgo
#

happy that i seem to have everything working so far

raven canopy
#

so are we!

unreal ginkgo
#

i'll get to the other 2 commands soon but for now i'll get the flashlight command working

manic glacierBOT
unreal ginkgo
#

well! i can finally get this sorted all out properly

unreal ginkgo
#

that feeling when the code syncs up perfectly

sullen axle
#

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.

#

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?

manic glacierBOT
raven canopy
#

@slender iron Trellis fix PR is submitted.

manic glacierBOT
manic glacierBOT
unreal ginkgo
#

welp

raven canopy
#

@unreal ginkgo how many lines total are in that code.py?

unreal ginkgo
#

320

#

so far

raven canopy
#

250 is the approximate max. how many & which modules are you importing?

unreal ginkgo
#

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

raven canopy
#

no worries. you've now entered into the "optimize" phase. 😄

unreal ginkgo
#

let me look up a thing

raven canopy
#

7 is going to be pushing it, most likely. are you using .mpy libraries?

unreal ginkgo
#

uhhhhh

#

i have no idea

raven canopy
#

did you get them from the bundle release page?

unreal ginkgo
#

i have an absolute ton of .mpy files

#

so i guess so

raven canopy
#

ok. good. that'll save you some heap space.

unreal ginkgo
#

neat!

#

how do i use these files?

raven canopy
#
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.

#

there. fixed to the non-board-specific version. (even though it isn't different)

unreal ginkgo
#

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

raven canopy
#

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.

unreal ginkgo
#

alright then

raven canopy
#

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)

unreal ginkgo
#

sadly, a majority of them are different

raven canopy
#
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.

unreal ginkgo
#

nnnnnneat

#

thank you, it'll probably help a lot

raven canopy
#

you're welcome. all part of the process. kind of like writing. outline, draft, proof read, edit, repeat. 😄

unreal ginkgo
#

i'll finish up this for now

#

figuring out everything else comes later

raven canopy
#

yep. small chunks. then before you know it, you have a large chunk that works!

unreal ginkgo
#

things i've got to figure out at some later date:
adding more pixels
sound and the really big wav files

raven canopy
#

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.

unreal ginkgo
#

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

unreal ginkgo
#

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

manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

tfw you left your fuzzer running and now have nearly 500 more crashes to triage

stuck elbow
#

it should also fix them automatically ;-)

regal whale
#

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?

manic glacierBOT
onyx hinge
#

oooh I think my Itsy M0 has been delivered

#

can't wait to play with it

slender iron
#

@sullen axle did you get circuitpython working for you?

sullen axle
#

Hi @slender iron ! thanks for asking, i haven't yet got my servo to obey me

slender iron
#

@sullen axle what servo library are you using?

sullen axle
slender iron
#

k, thats the one I wrote 😃

sullen axle
#

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

slender iron
#

whats the problem?

sullen axle
#

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

slender iron
#

how are they being powered?

sullen axle
#

powering them with the circuit playground

#

thinking i might need another source of power

slender iron
#

with 3v or 5v?

sullen axle
#

tried both

#

i.e. tried connecting to 3.3V pin and the Vout pin, didn't seem to make a noticeable difference

slender iron
#

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)

stuck elbow
#

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

slender iron
#

I was using a separate supply

stuck elbow
#

and the tiny voltage regulator on the cpx definitely isn't

#

and before you try, alkaline batteries are neither

#

especially the weak 9V ones

sullen axle
#

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?

stuck elbow
#

the problem is that battery pack is still 3.3-4.5V

slender iron
#

uses 4 AA

sullen axle
#

ok imma try the AAx4 method real quick and report back

tidal kiln
sullen axle
tidal kiln
#

hmmm. got any male-male jumper wires? for like bread boarding?

slender iron
#

@tidal kiln @sullen axle works at adafruit HQ

#

so I'd assume yes 😃

tidal kiln
#

on the CPX, VOUT is tied directly to the battery input

sullen axle
tidal kiln
#

try the second one, with battery connected to CPX

sullen axle
#

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

slender iron
#

it doesn't wiggle weirdly?

#

(like it did previosuly)

sullen axle
#

i've got JPs example to rotate the SG-5010 smoothly back and forth 180 degrees

#

works fine without extra battery pack, confusingly

tidal kiln
#

extra?

sullen axle
#

it's powered only through micro USB connected to laptop right now

tidal kiln
#

and red clip on VOUT?

sullen axle
#

yeah

tidal kiln
#

you're powering via USB then

sullen axle
slender iron
#

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)

sullen axle
#

oh yea maybe that's the problem. it's fine when I use "board.D5", but anything else (A5, D3) returns an error

slender iron
#

you can do dir(board) to see everything it has

tidal kiln
#

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']
>>> 
sullen axle
#

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 >>> ?

tidal kiln
#

no. just hit enter a bunch.

#
>>> def foo():
...     print("hello world")
...     
...     
... 
>>> 
#

until the ... become >>> again

slender iron
#

I'm gonna do errands. I'll be back a bit later

sullen axle
#

@slender iron thank you for your help!

sullen axle
#

success! i have, despite myself, accomplished a simple project and had fun. taking a break to eat soup 😋

slender iron
idle owl
#

Ooh they're right.

slender iron
#

thanks @idle owl

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 😄

onyx hinge
#

feeling inspired to hook up servos to a circuitpython board tonight

tidal kiln
#

@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?

idle owl
#

@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 😃

tidal kiln
#

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

idle owl
#

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.

tidal kiln
#

remembering to remember? yah. me too.

idle owl
#

😄 Exactly

tidal kiln
tidal kiln
#

nvm. solved.

onyx hinge
#

Adafruit CircuitPython 2.2.4 on 2018-03-07; ESP module with ESP8266 🕶

unreal ginkgo
#

oops

#

well, back to what i was doing last night

solar whale
#

@onyx hinge are you having a problem with the esp8266?

onyx hinge
#

@solar whale no, everything's fine. new addition to the family.

unreal ginkgo
#

something seems weird with the IR remote stuff for me

#

keep getting an error or something saying NEC repeat

onyx hinge
#

@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

slender iron
#

safe mode should start circuitpython without running boot.py or main.py

raven canopy
#

SAFE_MODE just keeps main.py from running.

onyx hinge
#

I get a red LED next to the power connector and TRINKETBOOT as the disk device

slender iron
#

thats not right 😃

raven canopy
#

hardfault?

onyx hinge
#

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

unreal ginkgo
#

in other weirdness
my mini IR remote
seems to be working with my TV?

onyx hinge
#
Model: Trinket M0
Board-ID: SAMD21E18A-Trinket-v0
slender iron
#

@onyx hinge sounds broken 😃

onyx hinge
#

@slender iron I would like for it not to be

slender iron
#

😃

#

me too

onyx hinge
#
    // Set up the defaults.
    _bootloader_dbl_tap = DBL_TAP_MAGIC;```
#

something seems fishy about that, only BOOTLOADER should set DBL_TAP_MAGIC, surely

slender iron
#

ya

onyx hinge
#

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

unreal ginkgo
#

ouch

unreal ginkgo
#

the whole nec repeat thing is still confusing me and i'm not sure what is actually going wrong

unreal ginkgo
#

nnnneat

#

turns out i just had some code in the wrong place

#

everything worked it just
was in the wrong places

onyx hinge
#

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

raven canopy
#

night @onyx hinge. self-tail-chasing is kinda what we do, right? 😄

stuck elbow
#

hmm, the samd21 has a built-in RTC?

#

do we support it?

solar whale
#

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.

manic glacierBOT
raven canopy
#

@stuck elbow in a quick look, the RTC header is in the ASF module. Not sure if/where it may be utilized though...

onyx hinge
#

This feels like a stupid question, but on a Trinket M0, how can I tell whether rebooting to "safe mode" actually worked?

stuck elbow
#

the repl tells you that you are in safe mode

#

and the usb disk doesn't mount

#

iirc

#

(not sure about that last one)

onyx hinge
raven canopy
#

RGB Led should be yellow in safe mode.

slender iron
stuck elbow
#

nice!

#

thanks

slender iron
#

@solar whale I don't know of any issues

#

np @stuck elbow

solar whale
#

@slender iron OK - I'll create an issue later when I can document it better

slender iron
#

thanks @solar whale

regal 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.

slender iron
#

(I don't use it myself though)

regal whale
#

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?

slender iron
#

@regal whale Mu is used most often by folks at Adafruit. @idle owl uses PyCharm. I use Atom and screen in a terminal.

regal whale
#

Thanks! Good to know what other options are popular.

manic glacierBOT
idle owl
#

@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.

regal whale
#

Thanks @idle owl, I'll check that out too.

idle owl
#

blergh. Adalogger not seeing the SD card. Trying another format.

idle owl
#

No dice.

languid sage
#

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

idle owl
#

@languid sage It's in the works! We don't have an ETA though.

languid sage
#

@idle owl OK, I'll grow some more patience

idle owl
#

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.

tidal kiln
#

@idle owl can you link a gist or something?

idle owl
#

Yeah. Give me a second, I just wiped and reflashed the whole board.

#

I'm using I2C scan to try to find the addresses

#

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.

tidal kiln
#

what's the hardware?

idle owl
#

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

tidal kiln
#

what feather main board?

idle owl
#

Feather M0 Express

tidal kiln
#

got any other i2c devices?

idle owl
#

probably, does the adalogger count? Or you mean something else-else

tidal kiln
#

else-else, like another i2c sensor

idle owl
#

I don't know off the top of my head what's I2C and what isn't.

#

hmm

#

searching adafruit

#

joy featherwing

tidal kiln
#

oh yeah, the rtc on the wing is i2c

idle owl
#

Still nothing.

#

Yeah.

#

it found that yesterday too

tidal kiln
#

how are these all stacked up / wired together?

idle owl
#

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.

tidal kiln
#

am2320 inside sandwich?

idle owl
#

sticking out the side

tidal kiln
#

that looks ok...

idle owl
#

Limor thought so too, so that's another vote.

tidal kiln
#

what value resistors?

idle owl
#

10k

#

that's what she told me to put in there.

tidal kiln
#

what happens with i2c scan without the logger wing attached?

idle owl
#

Nothing.

#

I removed it earlier.

#

to try to get to the simplest state possible

tidal kiln
#

and it worked before?

idle owl
#

last night, yes

#

detected both

tidal kiln
#

at this point would want to see photo of real deal

idle owl
#

Sigh ok yeah. It looks terrible. I've never soldered perf or proto board before. I'll do my best to get an image.

tidal kiln
#

you can leave the logger shield off, just focus on what you have for that frizting setup

idle owl
#

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']

tidal kiln
#

ah. posting photos scared the bug away. sometimes that works.

idle owl
#

Except for the part where I'm now convinced it's going to be super flaky and work about half the time. Ugh.

tidal kiln
#

that solder work looks fine btw

idle owl
#

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. 😄

tidal kiln
#

were you power cycling the feather?

idle owl
#

Physically hitting the reset button but not unplugging it completely.

tidal kiln
#

hmmm. and it just started working?

idle owl
#

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.

tidal kiln
#

well. i'd say keep moving forward and if it happens again, worry about it then.

idle owl
#

Yep

tidal kiln
#

and try to remember what the near term series of events were that led up to it

idle owl
#

Right. Unplug it.

#

Photograph it and then plug it back in. 😄

#

And thanks for looking at the soldering. 😃

tidal kiln
#

i think you need to post the photos as well

idle owl
#

Ohh right, follow the whole thing.

tidal kiln
#

just taking them doesn't work

idle owl
#

Agreed

#

womp, womp. Memory allocation failure now.

solar whale
#

@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.

idle owl
#

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.

stuck elbow
#

which libraries are you using?

idle owl
#
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.

stuck elbow
#

I can't see the sdcard repo on adafruit's github?

idle owl
#

That's weird? It's in the lib bundle

stuck elbow
#

ah, it's called just SD

idle owl
#

Ok 2.2.4 loaded, 160 bytes failing.

#

called adafruit_sdcard.mpy in the /lib folder.

#

so understandable confusion there.

stuck elbow
#

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

idle owl
#

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

stuck elbow
#

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

idle owl
#

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.

stuck elbow
#

there is only so much bytecode that can fit in the memory

idle owl
#

Is there a way to use the SD card for some of that?

stuck elbow
#

not that I know of

idle owl
#

ok

slender iron
#

I was thinking we could write a C driver for sdcards

#

@idle owl does the i2c scan work without the wing?

idle owl
#

I got it to work with it too

#

After unplugging it, photographing it, posting here, and plugging it back in.

slender iron
#

cool cool

idle owl
#

Now I can't get all the code to run without memory failures.

slender iron
#

yeah... thats trickier

#

I'd be curious to see the heap graph

idle owl
#

Not sure how to get you that.

slender iron
#

its probably too much of a distraction

idle owl
#

I don't know what to do with this.

slender iron
#

failing with a larger number is a good thing 😃

idle owl
#

Oh.

#

3.0 does.

#

but I don't think it's feasible for this.

#

yet.

slender iron
#

I assume that meant it fit the smaller thing

#

yeah, that seems to be the case

onyx hinge
#

@slender iron is it possible safe mode isn't implemented in master branch for samd devices ?!

slender iron
#

yes, for sure

#

@onyx hinge

idle owl
#

This code runs at least, but never gets to inside the SD card part of the loop.

onyx hinge
#

@slender iron okay I guess I should stop chasing my tail about not being able to enter it, then.

slender iron
#

@idle owl what line does it fail on?

idle owl
#

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

slender iron
#

@idle owl try it without the try

idle owl
#

it fails on OS Error: 30

#

every time.

slender iron
#

hrm, so not memory

idle owl
#

(Tried that already)

onyx hinge
#

@slender iron I don't see an issue in circuitpython tracking lack of safe mode on atsamd, may I file one?

slender iron
#

ah, the hard fault handler is different

#

@idle owl I'd need to dig and see what 30 is

onyx hinge
#

py/mperrno.h:#define MP_EROFS (30) // Read-only file system

slender iron
idle owl
#

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.

slender iron
#

nah

#

start simpler

#

try to read a file off of it

idle owl
#

By plugging it into my laptop or using CP

slender iron
#

using CP (put the file there with your compy)

idle owl
#

There's already a temperature.txt file on there from CP earlier. How do I do that? I've never done it that direction

slender iron
#

open with "r" and print (f.read())

idle owl
#

OSError: 2

#
    with open("text.txt", "r") as f:
        print(f.read())```
slender iron
#

try removing the loop

onyx hinge
#

#define MP_ENOENT (2) // No such file or directory

slender iron
#

there may be a bug if you open twice

idle owl
#

same.

onyx hinge
#

do you need "/sd/text.txt" or something?

idle owl
#

ohh

#

maybe

#

Yes!

slender iron
#

without it it'll be relative to your current directory

idle owl
#

It's wrong in the main code

#

that's the OSError

#

now I'm getting a new error, but at least there's that.

slender iron
#

progress!

idle owl
#
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"

slender iron
#

temperature is a number but you can only write bytes to a file

idle owl
#

oh

slender iron
#

print is implicitly converting it for you but write won't

#
>>> "{}".format(100).encode("utf-8")
b'100'
>>>
#

probably want an \n too

idle owl
#

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

slender iron
#

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

idle owl
#

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"))```
slender iron
#

what is pycharm complaining about?

idle owl
#

"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.

slender iron
#

ah, I don't think you need the encode

#

files open in text mode by default

idle owl
#

Yep it's running and PyCharm is happy

slender iron
#

you can add a "b" to the open to do it in byte mode

#

cool cool!

idle owl
#

this is without the RTC though

#

so

#

still haven't solved the bigger issue.

slender iron
#

¯_(ツ)_/¯

#

we only have so much memory

#

and have only spent so much energy optimizing it

raven canopy
#

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...

idle owl
#

I have to head out for this evening. Will likely check in late tonight.

slender iron
#

no, though I've seen other people wanting that

#

bye @idle owl ! have a good night!

raven canopy
#

later @idle owl.

stuck elbow
#

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

raven canopy
#

good point. that is a veritable minefield; having to deal with deinits...

slender iron
#

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

raven canopy
#

yeah, too close to the easy answer of "SAMD51" to spend much time on it... 😄

stuck elbow
#

@slender iron on the samd21?

slender iron
#

@stuck elbow no 51

stuck elbow
#

but that requires new devices

slender iron
#

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

raven canopy
#

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)

stuck elbow
#

the esp32 has a cool thing: SPI RAM

#

4MB of it

cunning crypt
#

SPI... RAM? Now THAT is a neat concept.

#

I wonder what it'd take to get that working with an M0/M4

stuck elbow
#

swapping :)

#

I'm afraid the arm m0/m4 architecture doesn't have page fault interrupts

stuck elbow
#

though I suppose the python virtual machine could emulate them

tulip sleet
#

@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).

manic glacierBOT
manic glacierBOT
raven canopy
#

@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...

tulip sleet
#

@raven canopy Sure, just note the limitations for each platform. ESP8266 too?

raven canopy
raven canopy
#

argh! extraneous merge in the commit...

#

luckily it didn't contain anything old. :phew:

tulip sleet
#

@raven canopy don't sweat it -- as long as it's not in conflict, not worth rebasing or something like that

raven canopy
lusty tangle
#

@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.

raven canopy
#

do you have a github of your code?

#

i'm pulling up the jiggler guide...

lusty tangle
#

I do not, however I can just create a gist real quick

raven canopy
#

that'll work just as well.

lusty tangle
raven canopy
#

hehe. i'm on it (spent many o hours in the learn system) but, thanks! 😄

lusty tangle
#

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.

raven canopy
#

were you in bootloader (GEMMABOOT) when you flashed the uf2? (sorry for the obvious "tech support" question)

lusty tangle
#

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)

raven canopy
#

when you plug the Gemma in, is the DotStar displaying any colors before you open Mu?

lusty tangle
#

yes, multiple colors

raven canopy
#

what are they?

lusty tangle
#

green 2s
orange 2s
orange .5s
blue x9 or 10 .5 s each

#

it continues to repeat that loop until I open Mu.

raven canopy
#

then it turns white?

lusty tangle
#

Then off for 2 seconds, then it repeats

raven canopy
#

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?

lusty tangle
#

Mu is not running at the moment, but it is plugged in

raven canopy
#

ok, open Mu, and in the REPL type <ctrl-d>

lusty tangle
#

As soon as I open Mu it goes white. Ctrl + D in REPL causes my code to start running.

raven canopy
#

and it runs fine?

lusty tangle
#

Correct.

raven canopy
#

hmm...

lusty tangle
#

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.

raven canopy
#

yeah, still working on HID in 3.x.

lusty tangle
#

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.

raven canopy
#

what OS are you on?

lusty tangle
#

Windows 10

raven canopy
#

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... 🤔

lusty tangle
#

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.

raven canopy
lusty tangle
#

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.

raven canopy
#

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...

lusty tangle
#

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.

raven canopy
#

Mu is pretty good, even on Windows (I'm a Win10 user myself)

lusty tangle
#

Well, I can say that did not resolve the issue.

raven canopy
#

just pulled out a trinket (no gemma) to test on...

idle owl
#

@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

tulip sleet
#

@idle owl sure - could not tell how far you were getting with the write() stuff

idle owl
#

@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.

lusty tangle
#

@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

raven canopy
#

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. 😄

lusty tangle
#

Oh sorry, I'll see if I can figure out what that blink pattern means then.

idle owl
#

Status LED blink pattern? @raven canopy @lusty tangle

raven canopy
#

yeppers

idle owl
raven canopy
#

oh yeah...that exists. i just go to the repo file... hehe.

tidal kiln
#

someone should get an RGB color sensor and make a decoder for that

raven canopy
#

@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)

lusty tangle
#

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

raven canopy
#

CYAN is pretty close to the BLUE, in my observations...

raven canopy
#

thanks @tidal kiln!!!!

lusty tangle
#

ok! so if I get rid of the mouse code it works, so something wrong with my python for the mouse code

idle owl
#

Yah sorry, same guide page, further down

raven canopy
#

my other trinket is SMD'd, so I just use that one lately... 😄

lusty tangle
#

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.

raven canopy
#

do you have the autorun in window set? i'm wondering if windows is blocking/getting confused on the HID+Storage Device...

lusty tangle
#

I did, I turned that off but it didn't help.

raven canopy
#

so I'm getting the same results. i did increase it to move 10 pixels just to exaggerate...

lusty tangle
#

I'm glad to know I'm not crazy at least

#

Based on the blink pattern the problem is mouse = Mouse()

tidal kiln
#

@lusty tangle @raven canopy i'm totally walking in late here, but maybe try to recreate issue through REPL?

lusty tangle
#

@tidal kiln that's the problem, when I open REPL everything works fine

raven canopy
#

yeah, i did that a minute ago (paste mode). same result.

tidal kiln
#

gotta a link to gist with minimal example of issue? (seems like it may have changed from link above?)

raven canopy
#

@tidal kiln (not the gist you're looking for)

lusty tangle
tidal kiln
#

thanks. lemme try...

#

gemma m0, cp 2.2.4, latest bundle libs?