#circuitpython-dev

1 messages Β· Page 117 of 1

umbral dagger
#

@pastel panther Indeed

tidal kiln
#

yep

idle owl
#

@umbral dagger I was there a few months ago, so it's still pretty clear for me πŸ˜ƒ

umbral dagger
#

Though I point people to MakeCode to start with

lofty topaz
#

@pastel panther Your absolutly correct.

pastel panther
#

I learned writing DOS programs which was decent, but there is something extra special about holding a thing in your hand and making it blink cause you told it to

#

It's a bit more tactile than a web app or even command line program

idle owl
#

@umbral dagger I looked at MakeCode and was more confused by it, and Arduino seemed like jibberish to me, so I insisted on going straight for Python.

#

But I've been teaching a friend who just got a CPX a few weeks ago, and she's never coded anything. So I've been learning MakeCode as well as we go.

pastel panther
#

Yea, I took one look at make code, tried to drag some obvious things around and it didn't work so I gave up

#

There is a good oppourtunity there though, I think the app just needs some more love

lofty topaz
#

MakeCode is for beginners, but way too cumbersome for cutting actual code. I tried it just out of curiousity. I would prefer smart flowcharts instead.

umbral dagger
#

@idle owl You'tre not 10 years old, though. I think (cavaet, I haven't been 10 years old is around 40 years) MakeCode is more approachable that writing text into a file.

lofty topaz
#

@umbral dagger I agree with that.

umbral dagger
#

@lofty topaz Exactly. It's a great place for youngins' to learn some basics.

tidal kiln
#

the idea is to provide a spectrum of options, of increasing complexity
MakeCode -> CircuitPython -> Arduino -> gcc and make files

umbral dagger
#

@tidal kiln yup

idle owl
#

@umbral dagger Yeah I think she's learning so much more using MakeCode than she would be using CircuitPython even with the CPX API.

pastel panther
#

I almost think you can leave arduino out of that. Almost

lofty topaz
#

Arduino gives you the C/C++ language. I'd say keep it. For sure.

umbral dagger
#

Arduino provides a gentle approach to using C/C++.

pastel panther
#

I suppose so

umbral dagger
#

Then you can switch over to something more "industrial". I tend to use platformio for that type of thing.

#

The Arduino IDE is horrible to edit code in.

pastel panther
#

How on earth do you get platformio to just have a simple avr project without arduino? I couldn't figure it out

tidal kiln
#

keeping all these options. it's not like any one is seen as a replacement for any of the others.

pastel panther
#

I can do it on the command line but integrating it with atom/platformio was less easy than I would have liked

umbral dagger
#

Exactly, it's a progression: increasing power, at the cost of increasing complexity.

lofty topaz
#

What's going to happen is the migration will be from MakeCode to CircuitPython to CircuitPython with List Comprehensions, Regular Expressions, Iterators, Mutators, etc... ><>

tidal kiln
#

start the journey where ever you want. go as far as you want.

umbral dagger
#

@pastel panther Ya, I use platform IO from cmd line. Emacs to edit.

pastel panther
#

wait, what? I only liked it for the IDE

#

@umbral dagger it must do something that I'm missing. organizing project types, compilers and libs?

umbral dagger
#

@pastel panther I'm close to dropping platformio in favor of makefiles.

#

@pastel panther As most of the stuff I find myself doing at tthat level is for custom hardware.

pastel panther
#

@umbral dagger Are you just using it like a makefile or something else?

umbral dagger
#

@pastel panther platformio run is pretty much all I use... with auto-upload.

tidal kiln
#

@lofty topaz if someone using CircuitPython progresses to the point of being a list comprehension ninja, then moving to full Python on a RPi might be the next best step

lofty topaz
#

@tidal kiln Precisely, and on to become great Data Scientists. Because that's where the work is growing. And Python is the perfect language for it.

umbral dagger
#

@tidal kiln Yes, it depends on where your interests lie. You have options at each step. Which is the awesome thing.

#

Once you move to Pi, you're on Linux which means all the other languages are an option, and you can easily move to pretty much any hardware.

#

@lofty topaz Well, Python is the popular language for it.

lofty topaz
#

Will the day ever come when Operating Systems go the way of the Manual Transmission???

umbral dagger
#

@lofty topaz which is another motivating factor for me to get some python skills: AI & ML.

pastel panther
#

@lofty topaz Meaning only people that enjoy using their computer for fun want them? I think computers will always need an OS

lofty topaz
#

@umbral dagger Good show, never stop learning...

pastel panther
#

well, maybe not.

umbral dagger
#

@lofty topaz yes & no. Ask a typical Mac (or even windows) user about there operating system. Compare that to a typical linux user.

pastel panther
#

Depends on your definition of OS

lofty topaz
#

I'm just asking. Food for thought.

#

@umbral dagger Exactly...

pastel panther
#

@lofty topaz the more I think about your question the quicker it dives into philosophy. Now I'm at: "Do humans have an OS?"

umbral dagger
#

CP is like what Basic on the early micros was. Turn it on & type in some code, run it.

lofty topaz
#

@pastel panther If ya go to far down that rabbit hole, let me know, I'll drop you a line. πŸ˜ƒ

umbral dagger
#

The big difference (other than needing to hook it to a "real" computer) is that for $20 or so you get a machine an order (or more) of magnitude more powerful.

fading solstice
#

@slender iron I notices a small problem with struct documentation. the calcsize method is missing form the readtodocs. There is documentation in the struct/init.c but it looks like there are extra spaces at the beginning of the lines .//| Supported size/byte order prefixes: @, <, >, !.
//|
//| Supported format codes: b, B, h, H, i, I, l, L, q, Q,
//| s, P, f, d (the latter 2 depending on the floating-point support).

//| .. function:: calcsize(fmt)
//|
//| Return the number of bytes needed to store the given fmt.
//|

lofty topaz
#

@umbral dagger Application, it's all about the Application.

fading solstice
#

@slender iron should i report and fix?

lofty topaz
#

I'm embedded and staying here.

slender iron
#

@fading solstice yeah, RST is picky about indentation

#

sure!

pastel panther
#

@lofty topaz the Application or the application?

lofty topaz
#

@pastel panther The application, as in, how the computer is applied.

pastel panther
#

@lofty topaz which requires an application ;P

lofty topaz
#

What work needs to be done?

#

Ahh, yup, yer correct.

#

terminology, ain't it great.

manic glacierBOT
umbral dagger
#

@lofty topaz @pastel panther Agreed. The application. That's partly why I don't agree with the "all kids/people need to learn to code" line. They need to learn how to apply technology to solve real-world problems. That will generally (but not always) involve writing some code. This is where the stuff we're doing (we being folks working on things like CP and related hardware, micro:bit, etc) is game-changing.

lofty topaz
#

@pastel panther Actually, I may beg to differ. You see, I was an Application Developer. But I use to be a computer Programmer. So what's the dif, right? Well, I like to say a programmer is like a carpenter, they will build you a house or a program, but a developer willo build you a skytscraper or a computer application. It's all about size, resources, platform, etc...

#

I use to Build the executable. Now we Compile, Link, and Bind. All as a Build process.

#

But I stay in the embedded world.

pastel panther
#

@lofty topaz I dunno. I think those distinctions are seldom useful, especially if self applied

#

@lofty topaz The concepts you mentioned can be ment by those works but the words don't always decode the same way for everybody

lofty topaz
#

I was on a team that built an application that was over one million lines long. A windows app that is. That sort of coding is way too stressful for me anymore.

#

I built an Andriod app and spent more time on the content then the code.

pastel panther
#

@lofty topaz For example I always thought "Software Architech" is a person who cares more about titles than code. There are people that architect code but that label seems lame to me.

lofty topaz
#

@pastel panther Those people are necessary when developing huge apps. Developers don't design a skyscraper, an architec does.

manic glacierBOT
pastel panther
#

@lofty topaz Of course they are but are you're not going to hire person A over person B just because A's resume says Software Architectβ„’ and person B's says Software Developer

lofty topaz
#

Archetech don't implement, developers do that.

pastel panther
#

So architects can't develop? Developers can't architect? I don't get where that seemingly arbitrary line comes from

#

blah, I'm sure somewhere at the end of a long conversation we probably agree but I ain't got time for that now

#

perhaps some other time

lofty topaz
#

Ah, ok, listen up. I didn't say can't. If I were to stay in the field instead of retiring, I may have moved up or into and architech position to design apps using UML. Let the grunts code it for me.

manic glacierBOT
lofty topaz
#

There's a line od succesion here. I would never hire an architech who had never coded. Yet I will hire a developer who has never architecheded.

slender iron
#

I think this is a interesting discussion for a different channel

pastel panther
#

Agreed. I think however this discussion has outgrown this channel.

#

hah

marble talon
#

@pastel panther As a software architect I always hated the term "software engineering" because I don't think engineering is a very good analogy. But I think architect is much closer. But I'm a hands' on architect, so I code too.

slender iron
#

haha

marble talon
#

Oh, now I'm the guy breaking the rules because we all simul-posted!

slender iron
#

no worries

marble talon
#

πŸ˜„

pastel panther
#

for shame!πŸ””

#

;P

lofty topaz
#

It's all my fault. I started it. So sorry... ><>

#

The channel was dead for a while and /i made the comment "food for thought".

marble talon
#

I think "dead for a while" is relative...

pastel panther
#

No problem brocephus

slender iron
#

no worries @lofty topaz

manic glacierBOT
drowsy geyser
#

@marble talon Like, < 50 msgs/hr?

marble talon
#

Yeah, this channel can get a little nuts!

pastel panther
#

you can partially blame me πŸ˜ƒ

manic glacierBOT
marble talon
#

@pastel panther Done! πŸ˜‰

pastel panther
#

oof

marble talon
#

Only by request!

#

It makes a better product to have more people involved, so it's to be expected that everyone has to ramp up.

manic glacierBOT
solar whale
#

@tulip sleet @formal plover the gcc installed on the Raspberry Pi by apt-get is gcc 4.9.3 - the ARMinARM is 4.8.2. so I am not going to invest the time in building it. If I get really bored I'll try to figure out why the latest build of the toolchain fails, but it won't be at the top of my list πŸ˜‰ Hopefully some guru will provide a working toolchain soon.

#

Interesting to note that the RPi Arduino build use arn-none-eabi-gcc v4.8.3

#

same on MacOS and Linux

manic glacierBOT
umbral dagger
#

@meager fog Got around to playing with the BMP280 lib. Runnign the example, had to tweak the import to import adafruit_bmp280 and it worked.

solar whale
#

@umbral dagger the exaple assumes that adafuit_bmp280.py is in a folder named adafruit_bmp280

umbral dagger
#

@meager fog It's reporting an altitude ~50m higher than the official elevation. Temperature agrees with the thermostat. Barametric pressure matches the official numbers for right now.

#

@solar whale @meager fog Oh.. right.. I just grabbed the py file

solar whale
#

I did the same

umbral dagger
#

@solar whale I'm still getting the hang of imports in Python.

solar whale
#

@umbral dagger I have not even begun to get the hang of it πŸ˜‰

umbral dagger
#

@solar whale I'm at the same time getting the hang of imports in Haskell which use the same word, but are a bit different.

solar whale
#

I am alwasy amused by references to Haskell - My home town was named Haskell - not a hotbed of programming.....

umbral dagger
#

@solar whale Well, good thing it wasn't named after your home town, then.

manic glacierBOT
solar whale
#

yay - DHT22 working on a Trinket M0!!!

manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert\-378\-cdc\_fixes
timber mango
#

@tulip sleet ok ima try and add bmp280 to the bundle

tulip sleet
#

@meager fog sure. do the git submodule add, then run update-submodules.sh, then create a tag, and then build-bundles.py`. Create the tag in advance so build-bundles will label the file with the tag (tags are yyyymmdd)

timber mango
#

hmm ok

tulip sleet
#

build-bundles.py will ask you if you created the tag

timber mango
#

ok i did a git submodule add

tulip sleet
#

@slender iron gah I did a rebase on the circuitpython pull request and now it won't fast-forward in my personal repo

timber mango
#

im on linux tho, so should i commit and let someone update the bundle later?

#

its no rush, i have some other libs

tulip sleet
#

Oh sure, then just commit and push and we'll make a new bundle later. Just run update-submodules.sh` before you do to get everything up to date.

timber mango
#

before i do what, commit?

tulip sleet
#

yeah

timber mango
#

how do i do that on win?

#

i can do it from mingw?

#

i could tr

tulip sleet
#

that script is just four git commands

timber mango
#

o ok

tulip sleet
#

do you have msys-git running a shell? That woudl work

slender iron
#

@tulip sleet yeah, thats why I'm tempted to switch back to merges

tulip sleet
#

@slender iron I tried reverting and doing a squash and it didn't help

slender iron
#

locally?

#

I usually just do a rebase and drop the commits

tulip sleet
#

@meager fog yah; if I've got the workflow wrong I can fix it later; no prob

#

I reverted via github, which created a new PR, and I did a squash commit on github with that. I could revert that one and do a merge.

#

maybe safest to revert on github and squash locally

slender iron
#

why did you revert on github?

tulip sleet
#

cause there was a button to do that; I thought it woudl roll back cleanly

slender iron
#

πŸ˜ƒ

slender iron
#

I'd worry about the github copy more than local

tulip sleet
#

I'll clean up locally and do a new PR. It did the revert with a pairf of undo commits, not a reset --hard

slender iron
#

kk

manic glacierBOT
tulip sleet
#

@slender iron bunch of stupid commits, but it was fast-forwardable (and should be for your too). Was worried squashing wouldn't work. Live and learn.

slender iron
#

kk, now we know

#

thats for fixing it up

#

thanks

tulip sleet
#

<@&356864093652516868> this latest commit to master allows you to ctrl-C main.py. It won't necessarily fix the other issues, and you may still see dropped REPL's or odd issues with MSC, esp on Linux.

formal plover
#

@tulip sleet nice, thanks!

solar whale
#

@tulip sleet appears to work on Linux and MacOS

timber mango
#

@tulip sleet is this re: m4? i can try reloading

tulip sleet
#

@meager fog This is 3.0 for both M0 and M4. I tested on M0; @solar whale tested on M4 (I believe)

solar whale
#

yes - I tested on M4

tulip sleet
#

@slender iron is working on improving the USB descriptors, which may fix some other lingering issues

slender iron
#

🀞

solar whale
#

I got worried becaus my CPU temperature went up - but it's doing a backup!! no udevd activity - whew!

formal plover
#

It probably won't be until tomorrow when I can check. I'm sure it's good though. @solar whale and I had the same symptoms

#

So if it's fixed for him, it's probably fixed for me

slender iron
#

its only checking for the second drive every few seconds

#

it was pretty much constant before πŸ˜ƒ

formal plover
#

@slender iron Haha gotcha

tulip sleet
#

off to dinner; cyl

solar whale
#

enjoy!

formal plover
#

Ditto @tulip sleet

idle owl
#

Ooh new build to make

solar whale
#

@meager fog - FYI _ tried a vl53l0x on the M4 today (ardunio samd51) worked great!

slender iron
#

bye @tulip sleet

umbral dagger
#

Latest CP build seems good.

#

I.e. I can get into the repl whenever I please πŸ˜ƒ

idle owl
#

Hmm, this is new. Bootloader shows up twice in Finder, but it's only mounted once in /Volumes/ on MacOS.

solar whale
#

I'm not seeing that - on MacOS

idle owl
#

Loaded new firmware, reset into bootloader, shows up once in Finder now. shrug

#

Loaded the firmware fine even when 2 showed up. No idea what was going on with that. I didn't think it was a real issue, I figured something on my end.

#

Got to the REPL just fine with main.py running!

#

Repeated the entire process multiple times. Consistently working perfectly!

solar whale
#

just think of all the M4's that will be running blinky tonight....

#

@tulip sleet my backup finished and CPU cooled down - nice to see - no impact from M4 being connected.

umbral dagger
#

@solar whale @tulip sleet I can confirm that as well. My cores are all purring along at under 5%.

slender iron
#

πŸ‘

umbral dagger
#

Is there a statusboard somewhere on what's working/supported on CP3/M4 ?

tidal kiln
#

@tulip sleet latest CP3 works for me as well on M4. main.py runs, ctrl-c to repl works. (on linux)

idle owl
#

@umbral dagger As I'm not even sure what you're referring to, I have no answer. But I would like to know what you're asking about. What do you mean by statusboard?

#

@tidal kiln Nice!

tidal kiln
#
Hello world 10.
Hello world 11.
Hello world 12.
Hello world 13.
Hello world 14.
Traceback (most recent call last):
  File "main.py", line 8, in <module>
KeyboardInterrupt: 



Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 3.0.0-alpha.0-182-g949a8f5 on 2017-10-27; Metro M4 Express with samd51j19
>>> print("hello REPL!")
hello REPL!
>>>
idle owl
#

Yeah!

#

Gets back to the serial connection on ctrl D consistently now too.

pastel panther
idle owl
#

Oh now I get what he was asking. I was thinking a statusboard was a specific tool.

river quest
#

this is super cute

pastel panther
#

that said it's more in 'developer-speak' than normal mortal speak

river quest
pastel panther
#

AAAAW!

#

@stuck elbow Awesome board!

river quest
#

it's delightful

idle owl
#

So true!

stuck elbow
#

thanks, I should have a new version on Monday, without the hole in the neck and with a led in the eye

pastel panther
#

Fact: there needs to be a blinky Blinka running CP

idle owl
#

@stuck elbow That's great!

#

LED in the eye is a lovely touch πŸ˜ƒ

pastel panther
#

so awsome

stuck elbow
#

I ordered purple leds for the purpose

pastel panther
#

weeee

stuck elbow
#

but for now will use an orange one, until they arrive

pastel panther
#

@river quest Throw @stuck elbow some $$$ and put these in the store!

#

I'd buy at least one

stuck elbow
#

I got enough stuff from adafruit already, but the design of course is open source β€” I suspect @river quest could make something better on the backside than what I did

tidal kiln
pastel panther
#

@tidal kiln Sure I can but @stuck elbow put some hard work into it and I would love to support him

river quest
#

we'll work something out together!

#

@stuck elbow once you're happy with the final design let us know

stuck elbow
#

@river quest will do, thanks

river quest
#

keep up the good work, that was delightful to see today

stuck elbow
#

it just had to be done, with osphark's colors

river quest
#

it is unavoidble

meager fog
#

@slender iron heya do you have a min?

slender iron
#

yup yup @meager fog

meager fog
#

im running out of memory importing a non-mpy version of this

river quest
#

-thanks everyone- !

meager fog
#

watit i didnt commit

#

hold on

#

do you see anything that i am doing that is super memory-bad. its running out on import

#

or should ij ust mpycross and be done with it

slender iron
#

nothing jumps out at me

meager fog
#

k i think its just a ton of math - but cant be helped

#

these sensors are very mathy

#

so theres a ton o code

slender iron
#

yeah, it'd be interesting to look at the heap chart for it at some point

meager fog
#

(shrug) ok ill mpy

slender iron
#

yup, sorry

#

and shrug is with a /

#

Β―_(ツ)_/Β―

stuck elbow
#

By the way, I noticed that using slots in the classes saves a ton of memory

tidal kiln
#

@meager fog seems to import ok for me:

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> import adafruit_bme280
>>>
stuck elbow
#

perhaps we should start doing it for the drivers

idle owl
#

@slender iron I thought you just had typing that figured out, I didn't realise it was built in. lol.

slender iron
#

πŸ˜ƒ

stuck elbow
#

I mean __slots__

tidal kiln
#

slots aren't in cp

meager fog
#

@tidal kiln !? really

#

thats odd

stuck elbow
#

sure they are

#

I'm using them

meager fog
#

oh dont forget to use

#

import board
import digitalio
import busio
import time
import adafruitbme280

#

since you need those

tidal kiln
#

ahhhhhh

#
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> import adafruit_bme280
>>> import board
>>> import digitalio
>>> import busio
>>> import time
>>>
#

@stuck elbow really? hmmm. dan and i were talking about that a few days ago. didn't seem to work.

stuck elbow
#

maybe it's a placebo effect

tidal kiln
#

@meager fog still works, i think. maybe?

umbral dagger
#

@idle owl I mean the status of various thing: SPI Flash, I2C, SPI, etc

idle owl
#

@umbral dagger I figured out what you meant when siddacious responded.

pastel panther
#

@umbral dagger Did you see the 3.0 milestone?

idle owl
#

@umbral dagger Thank you though. I was wondering πŸ˜ƒ

umbral dagger
#

@pastel panther open issues.. that pretty much covers it.

slender iron
#

there is a 3.0 beta milestone as well

pastel panther
#

I think thats what I meant

tidal kiln
#

wait. no. weird. @meager fog import order matters. :(

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> import board
>>> import digitalio
>>> import busio
>>> import time
>>> import adafruit_bme280
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: 
>>> 
thin badge
#

Hey everybody... So... I'm all about learning some circuitpython... I swear I am. However.. tomorrow being trick-or-treat... I'm kind of under the gun. How can I "un-circuit python" my gemma M0? I can't seem to get the arduino IDE to load to it (I think it's because it's mounting as a drive.)

"If it wasn't for the last minute... nothing would get done."

meager fog
#

that is weird

tidal kiln
#

so. uhhh. just import it first?

meager fog
thin badge
#

Thanks... I did some searching (I swear), but was in a panic.

umbral dagger
#

@stuck elbow @digital urchin I'd buy it. It'd be awesome to hand out to people who are curious. CircuitPython on a PythonCircuit.

lofty topaz
#

Having lots of fun with my CPX. With all that hardware included, it's simply "Code-n-Go". Gotta love embedded. ><>

true coyote
#

What can this thing do?

tidal kiln
#

@stuck elbow we were talking about using __slots__ as a way to prevent accidentally creating a new member variable due to a typo

#

using python3:

>>> class C:
...     __slots__ = ('a', 'b')
... 
>>> c = C()
>>> c.a = 23
>>> c.a = 42
>>> c.c = 3.14
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'C' object has no attribute 'c'
>>>
#

but on cp:

>>> class C:
...     __slots__ = ('a', 'b')
...     
...     
... 
>>> c = C()
>>> c.a = 23
>>> c.b = 42
>>> c.c = 3.14
stuck elbow
#

but it does seem to use less memory

#

maybe it's still using a dict, but setting the default size differently?

tidal kiln
#

interesting. we weren't looking at that aspect.

slender iron
#

@pastel panther you around?

pastel panther
#

@slender iron Yup

stuck elbow
#

I actually also removed inheritance, so that might have been it

#

I know this is very unscientific, sorry

slender iron
#

made one tweak to the cdc descriptor

pastel panther
#

@slender iron Will do; I'm about to head home so I'll report back in 15 minutes or so

slender iron
#

kk thanks!

tidal kiln
#

@thin badge did that work?

thin badge
#

Im going through it right now. (Grabbed dinner quick)

#

Im all about re-visiting the python aspect, just time got away from me and... well you know the rest of the story Im sure.

tidal kiln
#

you should be able to go back and forth anytime you want

thin badge
#

πŸ‘

#

I've got another 4 gemma M0 waiting... I went WAY too overboard with halloween this year. lol

tidal kiln
#

only danger is loosing any python programs you've stored on a non-express device when going to arduino.

thin badge
#

My profession has been focused around SCM for the last 15 years (now admin'ing a github enterprise instance.) If I lose code, I deserve to be publically flogged and/or shamed... πŸ˜‰

#

BOOM! working great. You guys kick all sorts of butt... Thank you so much. πŸ˜„

tidal kiln
#

excellent

idle owl
#

@thin badge That's great!

formal plover
#

Back from dinner. Appears that @slender iron has been busy

tidal kiln
formal plover
#

@tidal kiln happy to be in the same page as everyone now?

tidal kiln
#

am i?

#

or just 1 day back instead of 2?

thin badge
#

@tidal kiln FANtastic... πŸ˜ƒ

formal plover
#

M4 Flashed with current firmware and whatnot

idle owl
#

@tidal kiln I'd say you're with us.

tidal kiln
#

maybe i just missed all the early adopter fun

idle owl
#

Hours of fumbling. Not sure how much I even learned. It did mean a lot of repetitive commands... so that helped.

formal plover
#

This is still early adopter fun. Can't purchase the board yet, thats pretty cool in itself

thin badge
#

oh nice... not having to hit the bootloader button on the M0 is a much welcome improvement... πŸ˜ƒ

#

thanks again guys... going back to the "hard part" (assembly)...

idle owl
#

@thin badge Have fun!

tidal kiln
#

@thin badge good luck πŸŽƒ

pastel panther
#

@slender iron No dice:

USBMSC Identifier (non-unique): 0x00000000 0x239a 0x8021 0x100, 1
       0        0 AppleUSBCDCACMControl: getFunctionalDescriptors - Descriptors are incorrect, checking...
       0        1 AppleUSBCDCACMData: start - Find CDC driver for ACM data interface failed
       0        1 AppleUSBCDCECMData: start - Find CDC driver for ECM data interface failed
AppleUSBCDC: Version number - 4.3.2b1
slender iron
#

ok thanks for trying!

#

I'LL KEEP POKING AT IT

pastel panther
#

hah

slender iron
#

hello caps

idle owl
#

Loudly. πŸ˜ƒ

pastel panther
#

I mean, seems appropriate

tidal kiln
#

well, that is how your keyboard sounds

pastel panther
#

true

slender iron
#

πŸ˜ƒ

pastel panther
#

@slender iron let me know if you need more data

slender iron
#

kk, I'll keep poking next week. I'm done for now. just waiting for mario to come πŸ˜ƒ

pastel panther
#

@slender iron If I try to use my m4 with arduino, will it bork the bootloader you gave me?

slender iron
#

nope! they should work together

solar whale
#

@pastel panther you do have to manually enter the Bootloader every time you want to upload a new sketch in Arduino. Otherwise it works fine.

pastel panther
#

@solar whale thanks

solar whale
#

Assuming you installed the adafruit samd51 support for arduino

pastel panther
#

yea, working through it now

solar whale
#

On Linux or mac

pastel panther
#

mac

meager fog
#

anyone here wanna try my BME280 driver??

solar whale
#

Should work fine. Also work on Linux but a few minor reesks

#

Sure

meager fog
solar whale
#
Humidity: 53.6 %
Pressure: 1016.2 hPa
Altitude = -25.09 meters

meager fog
#

onto BME680

#

@solar whale seems...reasonable?

solar whale
#

yes - pressure is a tad high

meager fog
#

whats the weather station say?

solar whale
#

just a sec

#

actually looks OK - weather statin say its up to 1018.2

pastel panther
#

@solar whale the instructions say dragging the CMSIS Device folder from the zip to the same in the Arduino Library will cause them to merge but OSX wants to replace the original. Should I replace it or find the diffs and apply them?

solar whale
#

@pastel panther go ahead and replace

#

@meager fog bmp280 says 1017.2 - bme280 is 1016.3 - weather station a few miles away ia 1018.2

meager fog
#

thats...not too bad

#

thx for checkin!

solar whale
#

temp amd humidity look OK

meager fog
#

yah

#

πŸ‘

solar whale
#

You're welcom - thanks for the drivers!

#

@pastel panther on linux I found it best to delete the old folder and replace!

pastel panther
#

I should have just mv'd it but I think finder did the same

solar whale
#

yup

pastel panther
#

we have blinks!

idle owl
#

@pastel panther Nice!

pastel panther
#

now I just need something to do to amaze myself with how fast the M4 is

#

thanks for the help @solar whale

umbral dagger
#

Hmmm.. BME280 looks nice. I was planning to add a BMP280 to my sdesign that already has an Si7021. BME 280 looks like a nice alternative. A touch more $ overall, but simpler board design and lower part count. I feel a largish order coming on.

normal mica
#

Question pulse green on the 16bit neopixel what does that mean?

pastel panther
#

@normal mica Do you have any context? I'm guessing it means a neopixel should be expected to glow increasingly then decreasingly green

#

or rather glow green with increasing then decreasing brightness, probably in a cycle

normal mica
#

Im making the clockwork goggles and not even one pixel are in the ring

formal plover
#

@normal mica in CircuitPython?

normal mica
#

Yes

formal plover
#

Ah yes, okay

#

Knew once I saw the photo haha

pastel panther
#

@formal plover 's got your back

idle owl
#

@normal mica Can you post your code please?

formal plover
#

This is from a John Park project isn't it?

pastel panther
#

put it in back ticks ` for good formatting

normal mica
#

Yes

pastel panther
#

three in a row for a block of code

#

like
```
code here
```

formal plover
#

Sorry, just posting the references

normal mica
#

Yes and im doin it on jemma m0

pastel panther
#

Speaking of those goggles, I think Rezz uses a pair

idle owl
#

It needs to be called main.py - is that from you uploading it that it's got 2 .py's ?

normal mica
#

@idle owl you rock

idle owl
#

Ooh did that fix it?

normal mica
idle owl
#

@normal mica That's great!

pastel panther
#

wew!

formal plover
#

Niceeeeeee!!!

normal mica
#

p.s this my first project on python

formal plover
pastel panther
#

congrats!

formal plover
#

Well that's awesome @normal mica

idle owl
#

@normal mica Yeah! Great job!

umbral dagger
#

@normal mica Nice. I'm not far behind you in that respect.

pastel panther
#

Now that it's working you can learn more about things like loops and if/else statements to animate the rings

normal mica
#

πŸ˜„

pastel panther
#

Though I think there are some built in animations in the neopixel library

split ocean
#

@normal mica yay! So glad you’ve got them working β€” I’m honored!

normal mica
#

@split ocean im excited yayyyyyyy sorry bg kid minerva

idle owl
#

@normal mica Never be sorry for that! πŸ˜ƒ

#

We're all excited for you!!

normal mica
#

how can i make the pattern go a bit faster?

idle owl
#

Looking at the code.

normal mica
#

def brass_cycle(wait, patternL, patternR):
# patterns do different things, try:
# 1 blink
# 24 chase w pause
# 64 chase
# 96 parial chase
# 128 half turn
# 230 quarter turn w blink
# 256 quarter turn
for j in range(255):
for i in range(len(stripLeft)):
idxL = int ((i * patternL / len(stripLeft)) + j)
stripLeft[i] = cog(idxL & 64) #sets the second (brass) color
idxR = int ((i * patternR / len(stripRight)) + j)
stripRight[i] = cog(idxR & 64) #sets the second (brass) color
stripLeft.show()
stripRight.show()
time.sleep(wait)

while True:
brass_cycle(.00001, 1, 1) # brass color cycle with 1ms delay per step
# patternL, patternR

idle owl
#

You changed the right thing. Changing the first number after brass_cycle should have sped it up.

#

When you paste code, surround it with three backticks - the one in the upper left corner of your keyboard. A single backtick makes it inline code and surrounding it by three backticks on either side makes it a codeblock

normal mica
#
    # patterns do different things, try:
    # 1 blink
    # 24 chase w pause
    # 64 chase
    # 96 parial chase
    # 128 half turn
    # 230 quarter turn w blink
    # 256 quarter turn
    for j in range(255):
        for i in range(len(stripLeft)):
            idxL = int ((i * patternL / len(stripLeft)) + j)
            stripLeft[i] = cog(idxL & 64) #sets the second (brass) color
            idxR = int ((i * patternR / len(stripRight)) + j)
            stripRight[i] = cog(idxR & 64) #sets the second (brass) color
        stripLeft.show()
        stripRight.show()
        time.sleep(wait)

while True:
    brass_cycle(.00001, 1, 1)     # brass color cycle with 1ms delay per step
                                    # patternL, patternR
idle owl
#

Yeah! Nice!

normal mica
#

oh cool i wondering what was you talking about but i got it 😊

lofty topaz
#

@idle owl and I quote, " It needs to be called main.py". hmmmmm. Why not code.py? πŸ˜‹

#

Sorry, just poppin' in to cause trouble. ><>

normal mica
#

code.py (code.txt and main.py also work)

umbral dagger
#

@normal mica As will main.txt

manic glacierBOT
normal mica
#
import board
import neopixel
import time
try:
    import urandom as random  # for v1.0 API support
except ImportError:
    import random

numpix = 24        # Number of NeoPixels
pixpin = board.D0  # Pin where NeoPixels are connected
strip  = neopixel.NeoPixel(pixpin, numpix, brightness=0.3)

mode     = 0  # Current animation effect
offset   = 0  # Position of spinner animation
color    = [255, 0, 0]       # RGB color - red
prevtime = time.monotonic()  # Time of last animation mode switch

while True:  # Loop forever...

    if mode == 0:  # Random sparkles - lights just one LED at a time
        i = random.randint(0, numpix - 1)  # Choose random pixel
        strip[i] = color   # Set it to current color
        strip.write()      # Refresh LED states
        # Set same pixel to "off" color now but DON'T refresh...
        # it stays on for now...bot this and the next random
        # pixel will be refreshed on the next pass.
        strip[i] = [0,0,0]
        time.sleep(0.008)  # 8 millisecond delay
    elif mode == 1:  # Spinny wheels
        # A little trick here: pixels are processed in groups of 8
        # (with 2 of 8 on at a time), NeoPixel rings are 24 pixels
        # (8*3) and 16 pixels (8*2), so we can issue the same data
        # to both rings and it appears correct and contiguous
        # (also, the pixel order is different between the two ring
        # types, so we get the reversed motion on #2 for free).
        for i in range(numpix):  # For each LED...
            if ((offset + i) & 7) < 2:  # 2 pixels out of 8...
                strip[i] = color    # are set to current color
            else:
                strip[i] = [0,0,0]  # other pixels are off
        strip.write()    # Refresh LED states
        time.sleep(0.04) # 40 millisecond delay
        offset += 1      # Shift animation by 1 pixel on next frame
        if offset >= 8: offset = 0
#

i would like to add a second neopixel ring how can i do it ???

glacial bronze
#

You would need to create a second NeoPixel object. E.g. copy and past the declarations for the first one and do something like pixpin2 = board.D1 # Pin where NeoPixels are connected strip2 = neopixel.NeoPixel(pixpin2, numpix, brightness=0.3)

umbral dagger
#

@normal mica @glacial bronze Or you could chain the rings together (Dout of first to Din of the second) and make numpix twice as big. The first half of strip will be the first ring, the second half will be the second ring. This is one of the joys of neopixels (and dotstars)

manic glacierBOT
solar whale
#

woohoo! - thanks @umbral dagger ```
Adafruit CircuitPython 2.1.0-3-gbd7abcd on 2017-10-28; Hacked Feather M0 Express with 8Mbyte SPI flash with samd21g18

/dev/sdc1 8155 185 7970 3% /media/jerryneedell/CIRCUITPY

formal plover
#

@solar whale time to hook up every sensor you own. Haha

umbral dagger
#

@solar whale @formal plover It doesn’t help with ram, though 😦

formal plover
#

@umbral dagger that's true

solar whale
#

no - but it makes my feather m0 special

umbral dagger
#

@solar whale @formal plover Which is why I’m really hoping to see a board with a SAMD51x20 for the full 256k ram.

solar whale
#

also nice for datalogging

umbral dagger
#

@solar whale not so much πŸ˜ƒ I have 2 at the moment. One to test it out, and another since I neglected to take pics while I made the first one.

formal plover
#

@umbral dagger well then you need the other top secret board.

umbral dagger
#

@solar whale Also great for const data: sounds, images, neural net link weights πŸ˜ƒ

formal plover
#

Feather code name wompus

umbral dagger
#

@formal plover just wait until 3.0/M4 supports SPI flash πŸ˜‰

formal plover
#

@umbral dagger Haha that's true

umbral dagger
#

I’m wondering how much work it would be to add some of the quad spi flash. @tulip sleet sounds like he might be familiar.

solar whale
#

be careful if you buld 2.x from current master - it breaks many i2c and SPI drivers. I have a workaroud for i2c, but not SPI yet

formal plover
#

I have to make sure I have the bootloader ready to go for the M4. It only takes a couple mins to drive up the CPU on my Pi till its locked up

#

Grab the file and go lol

umbral dagger
#

@formal plover @solar whale The other advantage to using an x20 chip is a full Meg of flash onchip. Given that these boards are aimed at smallish, single purpose use a meg should be plenty (other than needing a ton of data)

formal plover
#

So I was looking at the Adafruit Blog feed... Most recent post is about Mu Python editor: https://codewith.mu/ @plucky flint and Carrie Anne Philbin

umbral dagger
#

The idea makes sense for beginners. Which is also why the Arduino IDE is good: simple, basic, no bells & whistles. Just enough to get the job done.

#

Which is also why I can't stand it πŸ˜ƒ

formal plover
#

Haha yeah, awesome that there's something available like this for beginners though

umbral dagger
#

Exactly

#

It's all about lowering the barrier to entry, but having a path to follow as you gain experience.

solar whale
#

@formal plover if/when you want to try arduino on the M4 - I have modified the guide ladyada made for the Mac to include a few notes for linux. You also need an updated Pi version of bossac which I can provide if you need it or you can build it from the link in the readme (just make sure you build the arduino branch) - the modified instructions are at https://github.com/jerryneedell/ArduinoCore-samd/blob/samd51/README.md

umbral dagger
#

@solar whale I am looking forward to that. So. Much. Room.

#

@solar whale I mean, I made a smarthome sensor node with a handfull of sensors, and an RF mesh network, Led and Neopixel output, all on a ATMEGA328. Imagine what more I can do on an ATSAMD51! Audio I/O and a people detector using the AMG8833... for starters.

#

I’m really curious about how much of that I can do in CP.

formal plover
#

Thanks @solar whale. I have to spin up a new Pi first, then I'll probably give it a try

manic glacierBOT
meager fog
#

@solar whale plz submit a PR with your fixes πŸ˜ƒ

solar whale
#

@meager fog I'll submit the linux update now - still working on the Pi permissions so I add that when I figure it out. The installation is the same as Linux.

formal plover
#

@solar whale I had a lot of problems getting boards to communicate in Linux due to security. I think I was using Mint or elementary. When I use Arduino on the Pi I didn't have any issues.

solar whale
#

@formal plover the only prblem I am seeing is that Arduino claims it does not have permission to access /dev/ttyACM0 I did not have this probem before the update so it may be related. - I can force it by setting the permission manually before I try an uplaod, but I'd like to find a cleaner fix. user pi should be a member of group dialout and /dev/ttyACM0 should ahave group write permission for dialout, but something does not get set up correctly.

tulip sleet
#

That will fix permission problems.

formal plover
#

@tulip sleet sure did. Always ran into issues. I would have to apply the rules multiple times or launch the app as root. This was quite some time ago

#

I just made the comment because it looks like @solar whale is having similar issues

solar whale
#

@tulip sleet No! had not seen tht - I'll give it a try - thanks

#

@tulip sleet I have never had permission issues before so I had not looked into it.

formal plover
#

It should fix the problem @solar whale. This was back when I was really into tinkering with Linux and I'm sure my experiments interfered

#

Lol

tulip sleet
#

I found I had to use the second set of commands to enable the rules without rebooting.

solar whale
#

@meager fog How do you want to get the linux bossac out there. Can I make aPR to add it to the release page?

formal plover
#

If you haven't noticed, I have a lazy factor and tend to try to do everything on the same box. I have like 6 Raspberry Pis, but do everything on just one.

solar whale
#

@meager fog linux bossac may be more complicated - I tried executing my Ubuntu bossac on a CentOS system and it failed to find some dynamic libs - Let me see if I can build a static version or else users can just clone BOSSA and build it locally

formal plover
#

But thank you @tulip sleet for having that link handy for @solar whale

tulip sleet
#

@formal plover yw. I was at my son's swim practice and had 5 mins to jump in.

umbral dagger
#

Has anyone here gotten MicroPython building on Linux? Not a cross compiled CP, but MP to run on linux.

stuck elbow
#

sure, many times

#

the tests use that

umbral dagger
#

Cool.. I think I see my issue. mpy-cross has to be built separately?

tulip sleet
#

@umbral dagger yeah you have to build it explicitly, for some reason.

bronze geyser
#

spi

idle owl
#

Hello @bronze geyser

bronze geyser
#

Ugh... sorry @idle owl I'm back to attempting writing a SPI library for circuitpython (ESP826). So...um...I type SPI...i guess i think that should write the lib all by itself :-)...anywho, i recall a link at one time to a github that would make my life swimmingly easier for spi lib creation...do you happen to know the link?

idle owl
#

I don't, unfortunately. I can try to help look for it though. Do you have any more specifics?

#

Are you going to try to port it from Arduino or are you looking for one in Python?

bronze geyser
#

Oh..I don't want to be a bother. Awhile back Scott posted a link I can't find it...it's a port from Arduino. I'm looking at TonyD's for an I2C that was in the learning section...just thought there might be a specific for SPI. ...perhaps that is the link. I'll check but I though spidev was for like Raspberry Pi...of course, I am clueless. Which can be a problem at times...

idle owl
#

It's no bother! It could be for RPi, I'm not sure, I only scanned it. spidev rang a bell for me from somewhere, so I grabbed it. I could be remembering it from working with RPis.

bronze geyser
idle owl
#

Ah, ok, nice!

bronze geyser
#

oops...i apologize...it is challenging getting older.

idle owl
#

It's understandable! The bot can be finnicky sometimes.

#

My library writing knowledge is limited, and my Arduino knowledge is none. So other than general searches, I'm not sure what else to look for. If you're still struggling by Monday, check back in here. It's usually pretty quiet over the weekends.

umbral dagger
#

Further adventures in the MP compiler πŸ˜ƒ This will be quite a rabbithole.

bronze geyser
#

again, thank you for your kindness. i am pretty sure i can get stuff working at this point.

idle owl
#

Ok, that's great!

#

@bronze geyser If you do find the link you're thinking of, let me know so I have it for future reference. Sounds like a good thing to have. πŸ˜ƒ

#

@umbral dagger Anything specific today? Or just more diving

bronze geyser
#

@idle owl will do. Please have a most excellent weekend and find many things to smile about.

idle owl
#

@bronze geyser Thank you! You too!

umbral dagger
#

@idle owl I'm fiddling with the idea of adding a debugger.

idle owl
#

Oh nice

umbral dagger
#

So really, more digging into the runtime than the compiler. But it's all related

idle owl
#

Gotcha

manic glacierBOT
umbral dagger
#

OK, I've figured out how to add a builtin function to MP.

idle owl
#

@umbral dagger Nice!

umbral dagger
#

Simple, yet convoluted.

#

Loads of preprocessor magic. Horrible, but it does let you do a lot at compile time, and this environment understandably focused on runtime efficiency.

idle owl
#

That's really neat. This is definitely way outside my skill set but I understand what you're getting at

tulip sleet
#

@umbral dagger how 'bout them QSTR macros - there are special expansions for non-identifier characters (we didn't invent all that)

umbral dagger
#

@tulip sleet That’s some crazy stuff.

#

Now to dig into the runtime itself. Scopes, closures, etc.

tulip sleet
#

actually, i realize a lot of the qstr stuff is in the in the py/*.py preprocessor files.

we have had to do essentially nothing to fix any python language problems: that part is quite robust and stable

idle owl
#

That's handy

umbral dagger
#

@tulip sleet It looks it.

bronze geyser
#

My goal is to use SPI on circuitpython to send a byte containing the register address and receive the contents of the address. here is my SPI config: spi.configure(baudrate=200000,phase=0,polarity=1) In Arduino, I can also say MSBFirst -> SPISettings settings(200000, MSBFIRST, SPI_MODE2); I don't seem to be able to setup the SPI config in circuitpython to take into account data order. What am i missing?

stuck elbow
#

do you really need to change the data order?

#

if so, you might need to reverse the bits in the bytes you are sending yourself

bronze geyser
#

HI @stuck elbow I don't know. I'm getting 0xff's back from the read...so I was trying a few things. I'm challenged right now because I don't have a logic analyzer with me...

#

while not spi.try_lock():
pass
try:
spi.configure(baudrate=200000,phase=0,polarity=1)
cs.value = False
usleep(10)
ATM90_SysStatus = const(0x01)
spi.write(bytearray([ATM90_SysStatus]))
usleep(4)
result = bytearray(2)
spi.readinto(result)
cs.value = True
finally:
spi.unlock()
print(result)

stuck elbow
#

0xff at polarity 1 means the wire is just low all thetime

#

are you sure you don't have to wiggle the cs to acknowledge the transfer?

bronze geyser
#

i'm clueless on what "wiggle the cs" means to do.

stuck elbow
#

release it and assert again

#

switch to high and then to low

#

by the way, 0xff with reversed bit order is still 0xff...

bronze geyser
#

thanks. So wiggling didn't do anything (assuming I am correct in understanding by wiggling you're thinking every time i read/write I turn from hi/lo /reset the CS pin)

#

spi.write(bytearray([ATM90_SysStatus]))
usleep(4)
cs.value = True
cs.value = False
result = bytearray(2)
spi.readinto(result)

#

i'm also used to in arduino goo to use xfer instead of write then read. I was wondering why there was no xfer in circuitpython's SPI library?

stuck elbow
#

if you need to do a read at the same time as write, there is write_value parameter for the readinto

bronze geyser
#

ok. Thank you. I will give that a go. Perhaps I am "stuck" until I can get to my logic analyzer...

idle owl
#

@bronze geyser I hope you've managed to make some headway with your project! πŸ˜ƒ When you paste code, if you surround it with backticks (the one in the top left corner of your keyboard), it'll format it as code. One backtick on either side makes it inline code and three on either side makes it a codeblockIt helps with readability

bronze geyser
#

result = bytearray(2) spi.readinto(result, start=0, end=len(result), write_value=ATM90_SysStatus) usleep(4)

idle owl
#

@bronze geyser Yeah!

bronze geyser
#

ok. I hope to remember. Thank you.

idle owl
#

It took me weeks to figure that out... πŸ˜„ So I try to share it when I can.

#

@bronze geyser You're welcome. How goes the project?

bronze geyser
#

oh. thanks for asking. Didn't get it to work. I'd like to use a logic analyzer. i won't be able to until Tuesday. So i'm pretty much wasting time at this point...

idle owl
#

Oh, yeah, having the right tools can mean everything. I know that feeling though, half the time I still keep poking at it thinking something will change even though I know it won't.

bronze geyser
#

yah - and then at the end of it all i feel kinda sleezy....as if i ate alot of oily food. but no, it's just because i'm fixated...knowing nothing is going to change...but still doing it...um...wait a second...that is EVERY DAY OF MY LIFE πŸ˜ƒ

idle owl
#

πŸ˜„ I totally get it. Getting hyperfocused into something.

hollow tartan
slender iron
#

@hollow tartan I don't know what micropython.exe is

#

@idle owl @bronze geyser I'm around for a bit if you have questions. I'm not sure where you are at on the SPI stuff

#

we don't have transfer yet because its rarely used. we do need it for an upcomign product though so we will be adding it. there is a bug with a 2.x milestone for it

solar whale
#

@slender iron finally had some time to fire up the nrf52840 Dev Kit --- demos are working fine and I'm trying to wrap my head around the SDK - so far made a blinky!!

formal plover
#

Yeah I dunno what micropython exe is either @hollow tartan

bronze geyser
#

@slender iron thanks for the shout out. My challenge is I need to send the register value then read the two bytes. Is it possible for you to write a small bit of code that tells the chip to send the two bytes within register 0x01?

hollow tartan
#

@slender iron I am looking for the link. xtensa-lx106 gets blown away at the end of the compile because of some environment variable(s) that messes the installation up.

bronze geyser
#

@slender iron here's what i'm doing: `import board
import busio
import digitalio
import time

usleep = lambda x: time.sleep(x/1000000.0)

#ATM90_SysStatus = const(0x01)

cs = digitalio.DigitalInOut(board.GPIO0)
cs.direction = digitalio.Direction.OUTPUT
cs.value = True

spi = busio.SPI(clock=board.SCK,MISO=board.MISO,MOSI=board.MOSI)

while not spi.try_lock():
pass
try:
spi.configure(baudrate=200000,phase=0,polarity=1)
cs.value = False
usleep(10)
ATM90_SysStatus = const(0x01)
spi.write(bytearray([ATM90_SysStatus]), start=0, end=1)
result = bytearray(2)
spi.readinto(result)
usleep(4)

cs.value = True

finally:
spi.unlock()
print(result)
`

hollow tartan
#

I am currently on my 5th go around on the installation of ubuntu et al.

#

I need some ideas for work around. I could make a archive of the /ports/esp8266 folder and some other folders within linux. Or I could have VirtualBox make a backup of the entire BOX.

formal plover
#

@hollow tartan so you're actually trying to build micropython?

hollow tartan
#

@Kurt Yes, I am. Although, I would rather be racking my brain against the M4 Metro.

solar whale
#

@hollow tartan I don't understand why you are using mingw if you are doing the build in an Ubuntu VirtualBox. Did you give up on the vagrant installation?

hollow tartan
#

@solar whale Ok. maybe it is not mingw, but the error is the VERY similar.

#

yes, I have and am following the learn.adafruit instructions for compiling micropython using Ubuntu VirtualBox. No, I have not given up - yet. But, if it crashes on me again, I probably will.

solar whale
#

@hollow tartan I did enter a "feedback" note regarding the rro about the new ports/ directory , but I think you are aware of that. Can you provide some detaisl about what step is failing - did make axtls work OK - is it failing in make?

hollow tartan
#

@ jerryn I am glad you did that. Yes, the "make axtls" is exactly where it runs into problems. What is the link for that github feedback? I would like to follow their responses.

solar whale
#

@hollow tartan you are running make axtls in ~/micropython/ports/esp8266 -- correct?

hollow tartan
#

yes.

solar whale
hollow tartan
#

I was thinking what I could do to help that . maybe $cp -r ./ports/esp8266 ./

umbral dagger
#

@solar whale Ah cool. I can use that guide! I just got the ESP8266 breakout.

solar whale
#

why do you need to do anything - just leave it as is

solar whale
#

@hollow tartan you don't have to fix anything - just cd to micropython/ports/esp8266 and run make axtls

hollow tartan
#

I want to save myself the time of rebuilding the files again and again. and I know axtls is going to break it.

umbral dagger
#

My exploration of the MP/CP runtime continues. What features would y’all like in a debugger?

solar whale
#

I don't understnad - you dont have to. You only do the make axtls once anyway

#

@hollow tartan once installed I just run make clenn then make in ports/esp8266

#

nothing has to be rebuilt

hollow tartan
#

@solar whale and if I modify some of the micropython source to test "the ignored arguments" issue - do I not have to run the axtls part again?

solar whale
#

@hollow tartan If you ony moidufy things in the esp8266 code then I don't see why you would need to - I don;t know what you are changing - I am running an install myself now

hollow tartan
#

@solar whale the trouble with axtls did not come into play until I wanted to install vagrant 2.0 so I would have Ubuntu 16.x

solar whale
#

@hollow tartan I just ran a clean install in an Ubuntu Virtual Box and it all warkes as inthe guide - the only change is the cd to ports/esp8266 for the make axtls and the final make of the esp8266 image.

#

where did you have to choose vagrant2.0 doesnt it get instelled by the steps in the guide?

hollow tartan
#

@solar whale you got a clean .bin under Windows ubuntu VB? and which Vagrant did you install?

#

in the archive of older Vagrant releases.

solar whale
#

I am not using windows, but the virtual box should be system independent.

#

what do you mean which Vagrant? - I installed teh one in the guide git clone https://github.com/adafruit/esp8266-micropython-vagrant.git cd esp8266-micropython-vagrant

hollow tartan
#

You may have spotted my bad assumption right there.

solar whale
#

??

hollow tartan
#

or the 2.0 one in ADDITION TO git clone ....

solar whale
#

@hollow tartan ah - I recommend atarting over and doing it just as in the guide - (win the extra ports/ ) It does not take very long.

#

@hollow tartan I have to go for awhile -- good luck - belive me - it really works!!

hollow tartan
#

Darn it all.

#

I need to go ride my bike and loose some of this pressure I have put on myself.

solar whale
#

Don't give up - just take a break - It'll go much more smoothly next time.

slender iron
#

@bronze geyser that seems like it should work to me.

#

@hollow tartan keep trying, getting a vagrant VM up and running will be good for the M0 and M4 as well. In fact, you can try building the samd variant even though you don't have a board yet

hollow tartan
#

@solar whale will be getting a big HUG for helping me with my personnal vagrant challenge.

slender iron
#

πŸ˜ƒ @solar whale is awesome

pastel panther
#

@slender iron Stupid question: can/should bossac be used to flash .bins spit out by arm-non-eabi-gcc when compiling ASF4 example code?

slender iron
#

the only thing to make sure of is the offset in your linker script

#

m0 = 8k, m4 = 16k

pastel panther
#

That specifies the offset in memory to avoid the bootloader?

#

Hm. no clear 8k specification in the .ld file but I should see something in the docs

pastel panther
#

aaaaaah, I got it (I think). Just read the samd21x18-bootloader.ld and realized that 0x2000 in hex = 8k

#

so adding shifting the rx/rom start by 0x2000/8k leaves 8k for the bootloader at the start of the rom

#

Once again I learn things by reading the code of folks smarter than me

slender iron
#

yup, exactly @pastel panther

pastel panther
#

@slender iron well, i got it compiled and flashed seemingly successfully but the code does not seem to work πŸ˜•

slender iron
#

with arm-gcc directly?

pastel panther
#

ya, with the makefile that came with the example. It's one of the START examples. Supposed to be a blinky but it doesn't blink. Suspiciously the D13 led pulses instead.

#

I fixed the pin mapping to match the metro but no bueno

slender iron
#

is it on an m4 or m0?

pastel panther
#

m0

#

hmm....

slender iron
#

hrm, the led fading is the bootloader still

pastel panther
#

like it's not getting to the code for some reason?

slender iron
#

yeah

#

the bootloader will check the validity of the reset vector location and not jump to if its out of range

pastel panther
#

What would I look for to confirm that? Is it something in the linker script?

slender iron
#

yeah, I think its usually the linker script isn't right

pastel panther
#

That wouldn't surprise me; I modified the script that came with the example and subbed in the MEMORY section from the samd21x18-bootloader.ld from the CP repo

#

I wonder if the change threw off some math elsewhere

slender iron
#

whats the top of the file look like?

#

its also worth triple checking thats the file used

pastel panther
#

The top of the linker script I compiled with?

slender iron
#

yup

pastel panther
#

ooh, just saw a warning

#

./samd21a/gcc/gcc/samd21j18a_flash.ld:119: warning: memory region `ram' not declared

#

seems not great?

slender iron
#

FLASH (rx) : ORIGIN = 0x00000000 + 0x2000, LENGTH = 0x00040000 - 0x2000 thats the bit you want

pastel panther
#

here's the top: ```OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions /
MEMORY
{
/
Leave 8KiB for the bootloader, and 64k for the flash file system. /
FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000 - 0x2000 - 0x010000
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x008000 /
32 KiB */
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(stack_size) ? stack_size : 0x2000;

#

It might look familiar :p

slender iron
#

what was it originally?

pastel panther
#
OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions */
MEMORY
{
  rom      (rx)  : ORIGIN = 0x00000000, LENGTH = 0x00040000
  ram      (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
slender iron
#

ah ok, so its the names on the left that matter

pastel panther
#

aaaaaah

slender iron
#

you just need origin 0x2000 and length - 0x2000

#

(the length doesn't matter unless you have a bunch of code

pastel panther
#

just do the math you do but keep the names?

#

ah

slender iron
#

exactly

#

then names are used again further down

pastel panther
#

of course they are. This is what I get for copy-pasting

slender iron
#

you don't need the - 0x1000... because thats for the internal filesystem

pastel panther
#

!!!!!!!!!!!!!!!!!!

#

I owe you infinite beers

#

I never loved an LED so much

slender iron
#

πŸ˜„

pastel panther
#

Dude, you don't even know. I've been trying to get to this point for almost a month. Given, I haven't been trying that hard/smart but none the less...

slender iron
#

πŸ˜ƒ glad you got it going! feel free to ask me more about it

pastel panther
#

I'm sure I will but now I'm probably going to a) have a beer (I'll pour one out for you) b) look at some of the more useful examples to finally get some experience with some of the sweet peripherals

#

I feel like I have two ends of a bridge now, one side is the simple blinky and basic code examples and the other side is the 3.0/ASF4 CP code and hopefully I'll be able to close the gap before too long

slender iron
#

don't be afraid to jump into circuitpython either

pastel panther
#

I'm not all that much but I feel like I need a slightly better idea of what's going on so I can know what a reasonable visible change would be. Does that make sense? Like I can compile and flash CP fine, but I wouldn't know what to change to know that I had done something that made a difference, useful or not. My one idea was changing the text on the REPL but that's not an option just yet

slender iron
#

if you have any ideas let me know and I can point you the right places

#

the issue list is a good starting point too

pastel panther
#

ok, will do

#

thanks again man, you're the best

slender iron
#

no problem, good work!

slender iron
#

<@&356864093652516868> We're on for our normal meeting time tomorrow (Monday) at 11am PT / 2pm ET. We'll do the normal State of CircuitPython, Hug Reports, Status Update and then open discussion. Thanks!

rain charm
#

Is this chan strictly for citcuitpython/python help or can I ask for coding help on Arduino IDE?

formal plover
solar whale
#

@slender iron I plan to attend today’s meeting as long as batteries hold out. No power due to storm last night.

drowsy geyser
#

+1 what @formal plover said, @rain charm

formal plover
#

@drowsy geyser yeah @rain charm posted there right after I mentioned it.

#

You might have an answer to the question.

fading solstice
#

@slender iron @tulip sleet i tried adafruit_lis3dh (from bundle 2.1) on a 3.0 CPX build. I got an " module ustruct does not exist" error message. I was surprised since bundle 2.1 was built after I made the struct to ustruct changes. I did a little research and saw that 2.1 was built with tag 0.1.2, which was created on jun 19, i.e., older code. i assume this was intentional.

drowsy geyser
#

Not to nag (really), but what's the status on the busio port to 3.0? Just curious; I have a couple of sensors I want to test but am blocked on busio (and don't have the chops to port it myself). πŸ˜ƒ

manic glacierBOT
#
[adafruit/circuitpython] branch deleted: revert\-378\-cdc\_fixes
slender iron
#

@drowsy geyser dan was starting to look into busio. my focus is getting usb solid still

#

and I don't believe you when you say you don't have the chops to do it πŸ˜›

drowsy geyser
#

Thanks, @slender iron. Appreciate the information! And the confidence!

formal plover
#

@slender iron I won't be available for CircuitPython the weekly 😿

slender iron
#

@formal plover thanks for all of your help anyway! I'll record it as always

formal plover
#

Hug report: Hugs for, I be giving out hugs like Oprah.
I'm happy that the M4 high CPU usage has been resolved. πŸ˜ƒ blinka

#

Thank you @slender iron!

slender iron
#

@formal plover are you still having trouble with a bootloader?

formal plover
#

I just got another Pi imaged, I haven't flashed the new bootloader yet, I was just judging it was resolved based off of what @solar whale has reported

slender iron
#

yeah, in circuitpython I fixed it with linux

#

I didn't know a bootloader was having trouble though

formal plover
#

Is it? Lol

slender iron
#

I thought you said it was

#

I haven't seen any issues with it

formal plover
#

When did I say that?

#

If I reported it, it had to of been on an older version of the bootloader, not the current

#

Any Linux issues have been in line with Pi issues. I haven't seen any Raspberry Pi specific issues yet.

#

So if the bootloader is good with Linux, it's good with the Pi. So far at least Haha.

slender iron
#

ok perfect!

formal plover
#

πŸ˜ƒ

lofty topaz
#

@formal plover @slender iron Sorry for kibitzing but this discusion brings back memories of meetings with whiteboards and flowcharts and code snippets and version discussions etc. Now it's done this way with Discord. If you guy's only knew how good you got it. Keep up the good work. My CPX projects are doing fine thanks to your porting. Make a good day. :)

<>

slender iron
#

lol, from the forums: "Aha! Success! Just in case anyone else needs this, I had to change the third line -> neopixel.NeoPixel (capital N)

Also: 255 is BRIGHT"

#

yup yup @lofty topaz! I never thought I'd be a project manager

#

glad you are enjoying it

cunning crypt
#

Has anyone tried getting REPL on an Android device?

lofty topaz
#

Python on my phone? Sure, why not? It's a computer, right? Can't help ya tho. Sorry.

cunning crypt
#

I'm poking at it now, seeing what sort of apps are good for it

slender iron
#

@cunning crypt I think @timber lion has tried it but the terminal apps on android are sad

cunning crypt
#

Just wondering if anyone had tried

manic glacierBOT
#

Testing this to see if I can fix it another way. I'm using an SHT31 humidity sensor at I2C 0x44 (no library, but it doesn't matter).

import board,busio
i2c = busio.I2C(board.SCL, board.SDA)
i2c.try_lock()
b0 = bytearray(0)
i2c.readfrom_into(0x44, b0)

hard-crashes only the first time the device is referenced. If I press reset without power-cycling, I get an OSError the second time. I have to power-cycle the SHT31 to cause a hard crash.

cunning crypt
#

I am.... not surprised

solar whale
#

@formal plover @slender iron the only lingering issue I am aware of with the Bootloader is that arduino requires manual Bootloader entry for every load. That fix is still pending.

slender iron
#

@solar whale yeah, dean and I discussed it last week. he was using a different magic number in the bootloader than we are in circuitpython to tell the bootloader to not launch the app

#

we'll sort it out

solar whale
#

No rush, works fine

cunning crypt
#

Well, I kinda got it. If it's in bootloader mode, the various serial terminals will see it and "connect" to it

#

but if it's in CP mode, none of them see it as a USB device that can be conneted to

#

It shows up in the file manager under USB so you can do normal CP files with it, but no REPL

timber lion
#

yeah android terminal apps are really bad i've found

#

they have to package in their own drivers so it's a real mess if one app supports a FTDI chip vs. SiLabs etc

#

and they're all just barebones apps that are effectively a reskin of a sample program google made

#

but with very confusing options etc

#

it's been about 6 months since i looked at them though

#

so perhaps someone has made the 'one true serial terminal app' to rule them all

#

but don't expect something polished like inbox, facebook, etc :/

lofty topaz
#

Hey! Tony, how ya doin? Can you please tell me when your webcasts are? I keep looking for them on Friday nights. What am I missing?

timber lion
#

hey, yeah I haven't done them in a while.. life got busy and folks have other priorities for me πŸ˜ƒ

#

hopefully coming back soon

lofty topaz
#

Ah, no wonder! Ok, thanks for the info. Do what ya gotta do, right. But please come back soon. Code is my forte, hardware is just a medium to execute it with.

cunning crypt
#

@lofty topaz You are pretty much my opposite

lofty topaz
#

@cunning crypt πŸ˜ƒ

cunning crypt
#

Code and I.... Well, I can get it to work, but beyond that I'm not the greatest. Hardware, on the other hand, I can pretend I'm not terrible at.

lofty topaz
#

@cunning crypt Looks like the guys are having their meeting. Yeah, I've been a hardware/software guy since 1977. Built Z80 based micros in the 80's and 90's then went strictly software for Windows, the Web, and Tablets and Smartphones, and then I dropped it all, retired, and went back to hardware with the Arduino. I love it. Now, CircuitPython is the name of the game. It's great.

cunning crypt
#

I've always been tinkering with things. Very few of the electronic toys that my parents got me when I was younger survived completely, because I always ended up taking them apart. And then trying to modify them

manic glacierBOT
lofty topaz
#

Bingo, hacking at its best. Now I just play with my projects. The hardware is practicly Plug-n-Play and then you just have to Code-n-Go. And best of all, with Arduino and CircuitPython, NO OS. That's why I will have nothing to do with Raspberry Pi. I got one, played with it. Command line? Seriously? Forget it. No thanks.

cunning crypt
#

Heh

#

I have many pis. I do little with them.

#

On the other hand, I have boxes full of prototype PCBs. Just.... circuit boards on ciruit boards

#

Most don't even have any components on them. I only needed one board to test, but it's cheaper and easier to get 5 or 10

tulip sleet
#

@fading solstice adafruit_lis3dh 0.1.2 was put in the bundle because that's the last release with a tag. The commits after that haven't been tagged. So we need a release.

slender iron
#

<@&356864093652516868> starting the meeting!

tidal kiln
#

mic issues again1?!?!?!

pastel panther
#

HR to Scott for helping me with getting my ASF4 code flashed and for putting in work to get my (not so) ancient mac working with the M4.

marble talon
#

re: CircuitPython, I'm an interested party but I don't have "skin in the game" like the rest of you on the call who are actually hacking on CP!

pastel panther
#

I’ve been dorking around with my LED matrix and re-found the Adafruit::GFX Arduino lib. Would it be worth porting? If so would it make sense to do it as pure CP or to try and leave some parts in C?

Otherwise I’m doing ASF4 tomfoolery trying to become more familiar with the framework. With luck I’ll be able to work on some simpler CP commits before too long.

#

hah

#

yay! GJ @timber lion

lofty topaz
#

@pastel panther CPMM, Copy, Paste, Meld, Morph. Copy what you need, Paste it where you need it, Meld the data, then Morph the code. Build, Test, Commit. Bingo, bango bongo, as we used to say!

tidal kiln
timber mango
#

hey im late but here in text!

#

i could make a trinket m0 express

tulip sleet
#

we're talking about updating libraries in bundles with new versions smoothly

timber mango
#

i was going to maybe route something like that today. see if i can make it fit. will be a few $ more than trinket m0

#

thats my only news

pastel panther
#

awesomesauce

lofty topaz
#

Do I smell a solid state hard drive addon board in the future?

timber mango
#

basically next step is SATA

lofty topaz
#

2 of these and you have 1MBytes. Nice. 10 and you have....

#

Bingo!

timber mango
#

πŸ‘

pastel panther
#

@slender iron I like the idea but I as much as I like CP I don't know that I could set aside the money for a ticket to get there

tidal kiln
marble talon
#

Gonna drop off...

idle owl
#

@marble talon Glad you could join us!

marble talon
#

Hungry!

slender iron
#

thanks @marble talon

marble talon
#

Thanks, guys!

manic glacierBOT
#

I just noticed that this feature was missing on the non-express builds as I tried migrating some code to a smaller board. I'd love to see it there. If ultimately not, would it be possible to update the error message?

Currently it was something along the lines of Error: bytearray index assignment not supported. (paraphrased, my uc isn't connected at the moment). This was confusing as this isn't index assignment, it is slice assignment. But even improving the error message would consume...

slender iron
cunning crypt
#

@timber mango A trinket M0 express would be amazing

tulip sleet
manic glacierBOT
#

The decode method for converting from bytes to str is missing in non-Express builds. This makes it awkward to take data from I/O and print it. It seems like this should exist, obviously the codec is ignored on a microcontroller but being able to switch immutable data types from one that iterates as ints to one that is printable and iterates as one character strings is desirable. Depending on the micropython gc internals both could share the same data buffer behind the scenes (I haven't loo...

slender iron
idle owl
#

Thanks @slender iron!

slender iron
#

no problem!

idle owl
#

@slender iron Hah! On a hunch, I checked. pixels.brightness already works. cpx.pixels.brightness works. So only need to update the doc examples to include it.

slender iron
#

πŸ‘

formal plover
#

Thanks @slender iron!

#

Hope <@&356864093652516868> & company had a good CircuitPython weekly!

slender iron
#

yup, went well

manic glacierBOT
formal plover
#

Good deal. I'll take a listen to the recording later tonight

manic glacierBOT
idle owl
#

@split ocean Brightness level works. Inside your loop include cpx.pixels.brightness = and the same numbers between 0-1 that you would include in pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=#) and you can set the brightness level.

split ocean
#

Grazie! @idle owl

idle owl
#

@split ocean Prego!

manic glacierBOT
slender iron
#

@pastel panther ping me when you are around. I'll have a test build for you

idle owl
#

@slender iron I was going to change the NeoPixel example in the API to include brightness. Sound good? I figure that would be the best way to do it since it's not a parameter. Also does :alt: NeoPixel order diagram need to be included in the rest of the API docs? Or was it carryover from copy/pasting the NeoPixel doc for formatting purposes.

slender iron
#

Sounds good to change the example. The alt text should describe the image in case someone can't see the picture

idle owl
#

Ahhhh ok. So it was definitely something copied. I'll update all of those as well.

slender iron
#

thanks! you rock

idle owl
#

Thanks! πŸ˜„ As do you!

slender iron
#

πŸ˜ƒ

manic glacierBOT
#

Just documenting base error: ASF3 does not handle an i2c read request of length zero. CPy/Mpy passes in a zero length bytearray as a buffer starting at 0x0, with length 0. The read request eventually gets passed into asf/sam0/drivers/serceom/i2c/i2c_sam0/i2c_master.c, routine _i2c_master_read_packet. There is some handling of a zero length request, but critically at the end of the while read loop, there is this code:

		/* Save last data to buffer. */
		_i2c_master_wait_for_sync(m...
idle owl
#

@slender iron I.... forgot how to build sphinx. I'm getting command not found with sphinx-build -b html . _build/html

slender iron
#

make sure you have the venv enabled

idle owl
#

ohhh right. Thank you!

timber lion
#

well drat @tulip sleet I just had a cexp running 2.1 erase itself when plugging in battery :/

#

it always happens when i'm getting a project ready to show people it seems

#

bad luck

tulip sleet
#

@timber lion Ugh! So maybe it's saggy voltage on the connect. Was the battery freshly charged or weak?

formal plover
#

@timber lion has cursed LiPos

timber lion
#

freshly charged actually

#

yeah it always takes a second to plug in the JST

#

i wonder if in that time it's getting eratic voltages

#

maybe i'm just bad at plugging in πŸ˜ƒ

formal plover
#

@timber lion could be, they can be a pain to plug in

#

Maybe some kind of like brown out causing problems

tulip sleet
#

maybe we should wait a bit (a second or two) before erasing the fs. That would give time for the contact to be firmed up. Could also check operating voltage before erasing.

timber lion
#

not a bad idea

tulip sleet
#

maybe two bugs here. I can trying plugging in a few times and see what happens

tidal kiln
#

probably difficult to reproduce / correlate, but maybe that would help?

timber lion
#

yeah those would work but it doesn't fit in a lot of projects

tidal kiln
timber lion
#

i do notice this cplay express has a really tight JST connector recepticle

#

take a very planted and firm push to get the connector in

#

easy to waffle around a second

tulip sleet
#

@tidal kiln I have one of those on/off cables, so I'll try with and without that

slender iron
#

@timber lion thanks for the report! Please follow up on the issue. @tulip sleet don't let this distract you

#

time to climb. byeee!

formal plover
#

@slender iron have fun!

idle owl
#

@slender iron Later!

formal plover
#

Byeeeee

tidal kiln
#

on belay!

timber lion
#

yeah I'll put a bug in 2.1 for this issue, i think it's worth looking at for 2.1 if it really is a simple fix to delay before erase FS

#

and if folks want to try slowly or badly pluggin in a JST to a cplay express to repro πŸ˜ƒ

tulip sleet
#

@timber lion you can reopen #280

manic glacierBOT
#

So this goes back to the previous issues of losing the entire SPI flash filesystem on express boards in low power conditions. With the latest 2.1 firmware I've noticed it unfortunately still occurs, just now I plugged in a JST battery to a cplay express with 2.1 and it erased the entire filesystem (was left with a blank root and boot_out.txt file). Talking in chat one possible explanation is that jittery power on startup could cause a filesystem erase from brownout conditions. This fits my...

idle owl
#

@timber lion Repro'd.

#

I had to lightly touch the connector to the jack repeatedly before plugging it in to get it to repro. The status LED and D13 flashed each time I did that, and then when I plugged it in completely, it had erased.

timber lion
#

oh nice good you can repro

#

i think the priority of this one is a little higher then

#

it's super easy to misplug in a battery

manic glacierBOT
#

This has been confirmed with another independent repro, from Kattni:

"@tdicola Repro'd.
I had to lightly touch the connector to the jack repeatedly before plugging it in to get it to repro. The status LED and D13 flashed each time I did that, and then when I plugged it in completely, it had erased."

Priority-wise I think this is worth looking at for the next 2.1 release. It's super easy to misplug in a battery and could frustrate a lot of folks (losing all your code unexpectedly).

idle owl
#

If I plug it straight in, I can't reproduce it. But if I repeat the steps above, it's reproduced. I tested a few more times.

timber lion
#

280 might be a separate thing, that was originally when the battery died while it was running and the FS erased on next boot

#

i'm pretty sure it wasn't from a jittery plug-in power then.. i remember the two times i've had jittery plugins (now and a previous one with circuit walker sneakers)

#

the power reactor on show and tell is the classic battery ran out and FS erased thing

#

which i think is fixed in 2.1 but will play more to see

#

this one i think is the jittery power on startup so probably makes sense as a separate issue

sturdy furnace
formal plover
#

@timber lion I don't think anyone can say they are good at plugging in jst connectors.

#

Hi @sturdy furnace, can you post your code? Use ` in the beginning and end of your code so it displays here properly, or use something like paste bin.

sturdy furnace
#

Yep!
`import array
import audiobusio
import board

Prep a buffer to record into

b = bytearray(200)
with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA) as mic:
mic.record(b, len(b))`

Note: I have it working in Arduino

#

Also I've tried the circuitpython uf2 2.0 and 2.1 versions

idle owl
#

@sturdy furnace I get the same result. I don't think the demo code is written to work with the CPX. I'd have to dig a bit more to figure out why, but you're not missing anything. It doesn't work.

#

Or at least I'm getting the same reboot into safe mode.

sturdy furnace
#

Ok that's good to know, I'll jump in as well.
There is an open issue (#156) but from what @slender iron posted I assumed it wasn't broken.

idle owl
#

Can you link that issue please?

sturdy furnace
#

there's some test code I ran.

idle owl
#

Thank you

sturdy furnace
#
import audioio
import audiobusio
import digitalio
import time
import array
import math

buf = bytearray(8000)

print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
print("recording", time.monotonic())
trigger = digitalio.DigitalInOut(board.A1)
trigger.switch_to_output(value = True)
with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA) as mic:
    mic.record(buf, len(buf))
trigger.value = False
print("done recording", time.monotonic())

for i in buf[:10]:
    print(i)
print(min(buf), max(buf))
time.sleep(0.1)

speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker_enable.switch_to_output(value = True)
trigger.value = True

length = 16000 // 440
b = array.array("H", [0] * length)
for i in range(length):
    b[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15 - 1) + (2 ** 15))

print(b)
with audioio.AudioOut(board.SPEAKER, b) as sample:
    sample.play(loop=True)
    time.sleep(1)
    sample.stop()

trigger.value = False

time.sleep(1)

trigger.value = True
print("playback", time.monotonic())
with audioio.AudioOut(board.SPEAKER, buf) as speaker:
    speaker.frequency = 8000
    speaker.play()
    while speaker.playing:
        pass

trigger.value = False```

Try that, I tested it and measured the analog output (A0) on my oscilloscope and I just get an 8kHz sine wave.
idle owl
#

@sturdy furnace If you surround your code with 3 backticks, it makes it a codeblock - It's easier for longer code snippets.

#
b = array.array("H", [0] * length)
for i in range(length):
    b[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15 - 1) + (2 ** 15))``` This creates a sine wave. I've used it previously to make tones with the onboard speaker.
sturdy furnace
#

Oh didn't realise markdown worked in discord. Thanks

idle owl
#

Yeah! I forget to just call it markdown, most of that time that doesn't mean much, but it would be much easier to mention that first. You can edit your messages too.

tidal kiln
#

can also add code type for syntax highlighting

idle owl
#

It seems like the code is supposed to take the recorded sample and play it back, but it looks like it generates a tone and tries to play that back instead?

#

I haven't done anything with recording yet so I'm trying to understand it based on other things I've done which isn't always the most efficient way, heh

#

You're right that the issue doesn't seem to imply it shouldn't work.

sturdy furnace
#

@idle owl I ran this and nothing broke!

import audioio
import audiobusio
import digitalio
import time
import array
import math

buf = bytearray(8000)
print("recording", time.monotonic())
trigger = digitalio.DigitalInOut(board.A1)
trigger.switch_to_output(value = True)
with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA) as mic:
    mic.record(buf, len(buf))```
idle owl
#

Nice!

sturdy furnace
#

Seems that the trigger is necessary. Not sure why though?

idle owl
#

Yeah I'm not sure either.

sturdy furnace
#

(btw this is @slender iron s test code in issue #156)

idle owl
#

It means that it needs board.A1 to be output, but I don't get why that would be either.

#

(Yeah I noticed πŸ˜ƒ )

#

I can run the test code in it's entirety and nothing breaks. It returns a tone and a static silence type sound.

sturdy furnace
#

@idle owl hmm, There seems to be a DC offset, maybe needs some amplification too?
I'll do some quick and dirty DSP and see if I can improve the signal.
But it is only 8 bit right? I can't imagine the quality is going to be amazing

#

ok nvm, I have no idea how to do any DSP in python without numpy or scipy 😒

idle owl
#

@sturdy furnace At 8 bit, no, it probably won't be.

#

Oh no! I've never dealt with it so I wouldn't have known to mention the lack.

sturdy furnace
#

I'll jump down to Arduino, It seems there is the same offset problem at least

tulip sleet
#

@sturdy furnace I believe the trigger code in the @slender iron's example was just there to trigger his scope or logic analyzer, so he could capture the inputs and outputs without a lot of blank space on either side. There's nothing in the schematic that turns on the microphone based on A1.

sturdy furnace
#

@tulip sleet Thansk for the heads up. I tried the readthedocs example again, this time with a buffer of 8000. no issue.

import audiobusio
import board
b = bytearray(8000)
with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA) as mic:
    mic.record(b, len(b))
#

A buffer overflow was the culprit then?

idle owl
#

Nice catch!

tulip sleet
sturdy furnace
#

Will do

slender iron
fading solstice
#

here's a stupid question. i finally got the smaller cable for the mini j-link . The metro M4 board connector has a notch in it, so it is clear how the connector fits, but on the j-link board, the connector can go either way. How do I correctly connect the mini j-link to the cable?

slender iron
#

@fading solstice I don't have the mini jlink but I think its a matter of lining the red stripe on the cable to the pin 1 location

#

its should be labeled

#

@sturdy furnace thanks for finding that bug!

drowsy geyser
#

There's a diamond on the M4 board and a "1" printed on the mini JLink. You just make sure those are lined up.

tidal kiln
#

red = 1

pastel panther
#

@slender iron

Adafruit CircuitPython 3.0.0-alpha.0-1037-g996130f05-dirty on 2017-10-30; Metro M4 Express with samd51j19
>>> print("It works!")
It works!
>>>```
slender iron
#

πŸ‘

#

thanks for the test!

#

now I just have to get the m0 going again....

fading solstice
#

Thanks guuys!

pastel panther
#

Are the changes chip-specific or could the same changes be build for the m0?

slender iron
#

it should be agnostic

#

but for some reason the mass storage was broken by my descriptor changes

pastel panther
#

Strange

slender iron
#

yup, one part was the cache settings

#

I changed the endpoints so there must be some place the other value is still used

pastel panther
#

Let me know when you get that sorted and I'll test my m0 as well

formal plover
#

@fading solstice that's not a stupid question.

tidal kiln
#

@fading solstice ^^

fading solstice
#

yes that looks like mine now!

#

unfortunately, the j link commander program does not connect

pastel panther
#

Mine shoud show up wednesday! wew

slender iron
#

thanks for the help @pastel panther !

pastel panther
#

@slender iron no problemo

formal plover
#

@fading solstice what are your settings like?

#

Frequency 1000 device etcetera

fading solstice
#

si 0

#

speed 4000

#

device ATSAMD51G19

tidal kiln
#

does not connect to board? or does not connect to jlink?

fading solstice
#

the j-link> con command

tidal kiln
#

J19 ?

fading solstice
#

i don't know what, i guess

formal plover
#

Frequency should be 1000 I believe

fading solstice
#

ok

tidal kiln
#

mine's a ATSAMD51J19, but i think that's just a package difference

#

how are you powering the metro?

formal plover
#

I couldn't copy and paste with the app Lolololol

slender iron
#

@pastel panther m0 build incoming

formal plover
#

So frequency 1000
Device ATSAMD51J19
SWD

slender iron
fading solstice
#

@formal plover I needed to use SWD not JTAG. now it look happy

formal plover
#

@fading solstice Yay!

pastel panther
#
Adafruit CircuitPython 3.0.0-alpha.0-1037-g996130f05-dirty on 2017-10-30; Adafruit Metro M0 Express with samd21g18
>>> print("This works too!")
This works too!
>>>
slender iron
#

πŸ‘ that means I can take a break from USB

tidal kiln
#

@fading solstice yay!

pastel panther
#

weeee

manic glacierBOT
formal plover
#

@fading solstice you have the firmware and bootloader files you need?

fading solstice
#

i was just about to ask for that

#

can i use boosac.exe to install the .bin file? or this jlink stuff?

formal plover
#

@slender iron I'm sorry, can you just plop them here? For @fading solstice

slender iron
#

what do ya need?

formal plover
#

I'd fetch them, but I'm on my phone, not the PC

fading solstice
#

@slender iron i want the bootloader so that I can drop .uf2 files onto a metroM4 board

lost moss
#

@formal plover Use FastHub for Github

formal plover
#

@lost moss so do I

#

Still easier to ask @slender iron hahaha

slender iron
lost moss
#

πŸ˜‚

formal plover
#

Plus I know things are current, in case he's working on something

lost moss
#

Get you...

tidal kiln
#

whats the dif between self-updater and non self-updater (bootloader.bin)?

slender iron
#

the self-updater will unlock, flash and lock the bootloader

#

and can be loaded by the bootloader itself

#

the .bin is loaded directly

tidal kiln
#

but you first need a bootloader that will accept it, right?

slender iron
#

yeah, the metro m4s should have a bossac bootloader to start

manic glacierBOT
tidal kiln
#

ah. that's what it was.

tidal kiln
#

so with a bossac bootloader, use bossac to load update-bootloader.bin, and it will reprogram bootloader to uf2?

fading solstice
#

@slender iron Yah, baby, that's the way its suppose work!

fading solstice
#

@tidal kiln That's what i did. Then I got a METROBOOT drive. Then drop the last .uf2 file

tidal kiln
#

cool. several ways to get there.

#

i just direct injected with the j-link

slender iron
manic glacierBOT
formal plover
#

Woot woot shout outs

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-4