#circuitpython-dev

1 messages Β· Page 120 of 1

charred blaze
#

mhmmm

tidal kiln
#

and you can double reset into bootloader on that one?

charred blaze
#

mhmmm

tidal kiln
#

yeah, sorry then, i'd guess something's up with the wiring on the green perf board

#

the bootloader is protected, it's pretty hard to accidentally mess it up with just code

stuck elbow
#

or something was shorted for a moment and one of the shottky leds burned

#

@tidal kiln I think it wasn't protected in some early ones

#

shottky diodes

charred blaze
#

huh.... i think one of the traces on the bottom is messed up

stuck elbow
#

not leds

#

photo?

tidal kiln
#

@stuck elbow early m0's?

stuck elbow
#

early uf2 bootloaders

#

now the update_bootloader.uf2 sets the protect bit back, but it didn't

tidal kiln
#

oops

charred blaze
#

bottom right pin. its the usb pin

stuck elbow
#

ok, that's probably it, you must had a short of some kind, and something burned and now it's shorting the whole thing

#

RIP

charred blaze
#

dang

stuck elbow
#

I wonder why the green led shines

charred blaze
#

#sparky right there lol

#

well now when i plug it in nothing happens

tidal kiln
#

i'm not following. what's the last photo?

stuck elbow
#

a desoldered trinket m0 with a burned trace

tidal kiln
#

oh wow, you desoldered it fast

#

so that's the one that was on the green proto?

charred blaze
#

if i connect the usb pin to either the 3v or bat pin the green light comes on. if i connect the usb to 3v pin though the dotstar comes on as well as a solid white but it is not recognised by the computer. plus plugging into either 3v or bat pins makes it get really hot really fast

#

@tidal kiln yes, that was the one on the perf board

tidal kiln
#

"if i connect the usb pin to either the 3v or bat pin the green light comes on"
what do you mean by usb pin ?

charred blaze
#

One of the pins on the trinket is a usb pin, its the voltage directly coming from the usb

#

huh. so i used the voltmeter to check the voltage
usb pin (usb voltage) to gnd- 4.9 volts
bat pin to gnd - 0 volts (because its not being powered an alternate power source)
3v pin to gnd - 0 volts

tidal kiln
#

diode on usb 😦 @stuck elbow called it

charred blaze
#

dang.

#

well the traces on the bottom are still messed up too.

tidal kiln
#

or the trace

charred blaze
#

I checked the backup trinket m0 and there is voltage on the bat pin/gnd.

stuck elbow
#

let me look at the schematic

charred blaze
#

The trace on the bat pin also looks messed up too

tidal kiln
#

lets all look!

stuck elbow
#

no way that green led could be shining with any part of the power broken

charred blaze
#

huh

tidal kiln
#

why not?

stuck elbow
#

because it's on the 3.3V side of the LDO

#

so pretty much same place as the MCU

#

if it got power, mcu got power too

tidal kiln
#

"if i connect the usb pin to either the 3v or bat pin the green light comes on"

#

@charred blaze connect usb to bat and measure voltage on 3v

stuck elbow
#

oh, right, so either D2 or the trace to it

tidal kiln
#

yep

#

applying usb to 3v basically direct injected 5v to the other side of the LDO

#

lit the LED and probably blue smoked the mcu

charred blaze
#

its coming up as 3v

#

well 3.3

tidal kiln
#

so the voltage reg works

charred blaze
#

yup

stuck elbow
#

I have a whole strip of those MBR120 shottky diodes

charred blaze
#

nice

stuck elbow
#

but it might just be the trace

#

could be simply bodged to fix it

charred blaze
#

i think its the trace. theres actually 2 of them that are messed up

tidal kiln
#

samd21 vdd absolute max = 3.8v

#

it probably didn't like seeing 5v

charred blaze
tidal kiln
#

it's when you applied usb to 3v

stuck elbow
#

yeah, that's before the regulator

charred blaze
#

ah

tidal kiln
#

see schematic. usb and bat are before votlage reg. 3v is after.

#

and 3v goes straight to the mcu

charred blaze
#

ahhhhhhh i think i get it now.

#

still a little new to some of this stuff

stuck elbow
#

don't worry, we all started at some point

#

hopefully you won't burn more expensive things πŸ˜ƒ

tidal kiln
#

no worries. good #sparky story. πŸ˜ƒ

charred blaze
#

i mean, ive been playing with some of these things for a year now. but I slowly learn some of it as I go.

stuck elbow
#

I love how the schematics are available for almost everything, it helps you debugging a lot

charred blaze
#

Hahaha i burned up a Flora a year ago. couldnt figure out what the heck happened other than i went to plug it in and a part of it got red hot (literally) and puffed blue smoke at me

stuck elbow
#

and also, I can prototype with modules, and when it's ready, move it all on my own pcb by copying those schematics

charred blaze
#

So basically make sure the 3v pin isnt connected to the usb pin or the bat pin

stuck elbow
#

make sure the usb/bat pin is not connected to any other pin

charred blaze
#

ok. can those 2 be connected at all?

stuck elbow
#

because all other pins are 3.3V and, usb is 5V and bat can be anyting

#

you can connect it to things that have a separate pin for power, such as hobby servos or motor drivers

#

or neopixels, I think

charred blaze
#

ok

#

I made sure to double check all of my connections on my perfboard on last time before soldering the new trinket in place

stuck elbow
#

if you have a mac, make sure to not place the board on the metal case

#

I've seen people do that

charred blaze
#

Nope, im a windows guy :3

stuck elbow
#

I think some surfaces are metal too

meager fog
#

~leeks~ time

charred blaze
#

ALL THE IO!!!!!!!!!!

meager fog
#

yep all io are used!

charred blaze
#

Sweet!

meager fog
#

kinda a replacement for pro trinket

charred blaze
#

ooooohhhhhhhh

meager fog
#

step up from trinket, but not as chunky as a feather

idle owl
#

Good place to be.

glacial bronze
#

I love it

charred blaze
#

Awesome!!

#

not exactly circuit python related i guess i cant use FastLED on my trinket m0 programmed with arduino (for now). something about the FastLED code isnt like by the compiler

meager fog
#

hmm it should! we tried fastLED

#

make sure you have the latest version!

charred blaze
#

huh. yeah i just recently updated.

#

its giving me something about an "invalid pin specified"

charred blaze
#

Ohhhhhhh I got it now @meager fog . I had the version of fastLED from their git. I didnt have the version of it you guys modified

meager fog
#

oops was in another window

#

yah we did submit a PR

#

so it should have been merged to theirs :/

idle owl
#

I found a quirk with CPX. I have one I purchased in at the end of June, and a friend has one she got in the end of September. I'm teaching her with MakeCode and they don't communicate consistently via IR. We thought it was the code, but I have a second one I got in the middle of September, and they communicates perfectly. I don't know if there's anything to be done about it, but it seems like something worth noting somewhere in the event that anyone is using two boards purchased that far apart.

charred blaze
#

@meager fog ahhhh. well it hasnt yet. but hey! i got it working for now!! now i gotta get a second trinket m0 so i can work on circuit python for it. Since I had a sparky moment with it.

meager fog
#

yay nice

#

@idle owl the only difference is the xmitter LED may have changed. the receiver

#

is the same for sure

#

the makecode IR stuff isnt super tested :/

idle owl
#

I noticed the hardware looked a little different

meager fog
#

IR is not great for communication. that's why remotes 'spam' the transmission

idle owl
#

Right

meager fog
#

we do test IR rx/tx in manufacture. so it works, just maybe not as noise-free

idle owl
#

hmm. Yeah it worked once or twice, which is what made me think it was a code issue. It was a last minute idea to try the newer board.

meager fog
#

(we only use it for like, IR remotes n stuff, which are very simple)

idle owl
#

So sending color suggestions is getting more complicated

#

I wanted to include simple IR communication in the CPX API eventually. Might not be so simple. πŸ˜„

meager fog
#

yah

#

i do too! πŸ˜ƒ its just a very gruesome protocol. BTLE is nice because it manages retransmissions for ya

#

also people have a lot of lighting that gets in the way

#

flickery dimmed LEDs and flourescents

idle owl
#

I try to think in terms of using it for teaching, and what would be super awesome to learn as a beginner. And if you're paired with someone, being able to send a simple string to your partner's board seemed like it fit the bill of awesome.

#

Yeah! I had to tell Carter what stray light looked like in the remoteIR code you had us test. He thought at first it wasn't working right.

meager fog
#

hmm i think your best bet is to try and transmit like a maybe 4 bytes max per messgea?

#

and put in CRC

#

and just spam the tx

stuck elbow
#
charred blaze
#

And you could maybe put a line in the code that once they have a first contact then it kinda sinks them up. if you are automating it that is

#

that way you arent always open to new signals, only when you need to be

idle owl
#

@meager fog The other idea was to bake it in to only send a specific message, like MakeCode sending a signal to change the NeoPixels. I don't know how many bytes it actually is to control the NeoPixels though. I know they're 3-4 per LED, but I imagine it's more complicated than that in actually sending the code to change them.

#

I don't know much about coding for IR though. So I'll be learning that as I go with this one.

charred blaze
#

Thats how my past year has been since picking up arduinos/hobby electronics in general

tidal kiln
#

@idle owl instead of trying to have full control of neopixels over ir, could make it where the 4 bytes (or similar small packet) just indicates a desired mode

idle owl
#

@charred blaze Nice! My first Adafruit order was at the end of June. I knew about them before that but hadn't ever ordered for myself. Mostly ordered Raspberry Pi related stuff, and the Circuit Playground Express.

charred blaze
#

I agree with @tidal kiln do kinda like code words sorta thing.

idle owl
#

@tidal kiln So you write code for both of them, waiting to hear mode info, and waiting to execute mode.

#

I like it

charred blaze
#

so like, Sender could send something simple like "blue" and they would all change to blue. or you could even do it in RGB where 120255030 would translate to setting the color to R-120 G-255 B-030 on the Receiver

meager fog
#

@stuck elbow yep! we'll carry the 1bitsy swd as soon as they are available

stuck elbow
#

I just thought the name and the shape are very similar, are you not afraid of them being confused?

tidal kiln
#

@idle owl main idea is to just reduce the amount of info you need to tx (full control might required too much)

idle owl
#

@tidal kiln Right. And agreed.

meager fog
#

nope - all hardware is similarly shaped πŸ˜ƒ

stuck elbow
#

trinket and cpx are kinda special πŸ˜ƒ

charred blaze
#

Dang, if i hadnt messed up my other trinket m0 i could've used it to make some leds for my Mavic Pro and controlled them with circuit python

meager fog
#

@charred blaze what happened to it?

tidal kiln
#

(scroll up)

charred blaze
#

lol Cater.

stuck elbow
#

3.3V connected to 5V basically

charred blaze
#

yeah what they said

#

personal mistake there

tidal kiln
#

@charred blaze thought you said you had a backup?

charred blaze
#

I do! but one was going to be for personal learning and the other for a simple project for a buddy.

meager fog
#

lol woops - did it go poof?

charred blaze
#

no it didnt! it just stopped working. And Cater and Deshipu deduced that was what happened. Though when i desoldered it and went to pop it off 2 of the traces got pulled off because apparently the solder pads on the bottom werent fully desoldered.

meager fog
#

ahh it happens!

charred blaze
#

oh well! wonder if fastLED would be ok on a regular trinket. Im not doing anything too fancy.

meager fog
#

it should!

#

we use it lots

charred blaze
#

maybe not. i need 4 pins total so one of those would have to share with pin 3/4 as either output to the leds or as input for a button

idle owl
#

I replicated the code that ships with the Circuit Playground Express in Circuit Python.

charred blaze
#

nice!

idle owl
#

People keep asking for the demo it ships with. It ships with MakeCode. But it seems like posting this somewhere might be a good idea. Need to find out where though.

tidal kiln
#

@idle owl the cpx guide, cp section

idle owl
#

@tidal kiln lol I was just typing something close to that.

#

Your idea is better. I was about to say write up a quick guide on it.

umbral dagger
idle owl
#

@umbral dagger Nice!

umbral dagger
#

@idle owl Thanks. For the next batch I’ll try it without trimming the edges... maybe I can just have solder wick through the holes. It’d be a lot faster to do the build and I’m contemplating trying to sell them ... next summer (here in Canada).

idle owl
#

That would be handy.

#

Nice use of the power breakout too.

umbral dagger
#

Maybe using a toggle clamp to hold the Trinket/breakout firmly in place while soldering.

#

Yes, it perfect for this. Makes the code simple AND makes, the whole thing very low power.

idle owl
#

Yeah something would be needed. Trying to get it to wick through without it moving would be a challenge.

umbral dagger
#

Yeah, a clamp would give me two hands to work with. I could go with a fully custom board, but There would still be through-hole components.

#

It was a fun project to go from need to final solution.

#

As mentioned, I need a 3D printer now to really complete it.

idle owl
#

Yeah!

#

We have a humidity sensor setup in the basement, with four zones. We're tracking the data remotely though, so they're running off of Pi0W's.

#

I think it is the same humidity sensor you used.

slender iron
meager grove
#

Neat project idea. I should make something like that to scream and shout if my mandolin case is too dry.

umbral dagger
#

@meager grove The whole thing could be packaged in a well ventallated shell.

#

@meager grove You'd also need to be able to hear it, so something based on e.g. esp8266 that can post to IFTTT or such might be a better approach.

#

The one thing It's missing is a low battery indication. I have to give that some thought (or just recharge them regularly.

cunning crypt
#

@umbral dagger Diode of voltage reducig to 3.3 tops. Run that to analog in. You'll be able to detect when the battery is just about deadn but it's only one component

#

Or the ever-useful voltage divider to read full battery status

umbral dagger
#

@cunning crypt I just need a "recharge now!" alarm.

manic glacierBOT
#

was testing a feather m0 basic on adafruit-circuitpython-feather_m0_basic-20171104-5ff6417 and bumped into this odd issue while testing pin toggling.

on some pins, reading the value does not return the right value?

e.g this code does not toggle:

led = digitalio.DigitalInOut(board.MOSI)
led.direction = digitalio.Direction.OUTPUT
while True:
    led.value = not led.value
    time.sleep(0.1)

but this works:

led = digitalio.DigitalInOut(board.MOSI)
led.direction...
errant grail
#

Beginning to test the next generation of the autonomous string car racer using the Trinket M0 and CircuitPython. Initial tests are working perfectly! The plan is to make it pin compatible with the existing controller board. Using CP simplified the code significantly -- and no more IDE! The previous gen car (Trinket 5v-based) is shown on the right.

idle owl
#

@errant grail That's great!

meager fog
#

@umbral dagger wow thats great!

#

you too @errant grail

#

(i am taking a little break from routing boards πŸ˜„

idle owl
#

@errant grail What does the autonomous part do for a string racer?

#

Breaks are good!

errant grail
#

... Thanks @idle owl. I have 6 of these "in the field." Upgrading to CP simplifies support tremendously!

idle owl
#

@errant grail For sure!

meager fog
#

yay thats the point of circuitpyhon so im glad πŸ˜„

#

funny story circuitpython is borne from about 10 yrs ago

#

i used to go to burningman and do projects there and haul my pickit around

errant grail
#

I'm a happy camper. Was itching to do this ever since watching you working on the prototype, @meager fog .

meager fog
#

and thought "omg i cannot deal with how hard it is to tweak firmware in the field. this sux. i hope i come up with something better in 10 years" πŸ˜ƒ

umbral dagger
#

@meager fog The original physical prototype (hand wired on prototyping board) and one PCB based unit are β€œdeployed” and running nicely.

idle owl
#

@meager fog Nailed it.

errant grail
#

Yeah, this will help with the makerspace classes, too.

meager fog
#

yah! easy to share code, save backups

#

ok back to pcb routing

errant grail
#

@idle owl : here's a discussion of the autonomous version in the learning guide I wrote.

idle owl
#

Oh! I've seen this guide before! I recognise the photo. Thanks for the link!

meager fog
#

@umbral dagger s'ok for us to blog your project?

umbral dagger
#

@meager fog Looking at it one way a SAMD21 is way overkill for this. Previously I would have used an Arduino ProMini. But for not significantly more $ I can work in Python instead of C, and dropping files onto the usb drive instead of AVRdude. I really need to write a post about the qualitative difference working in CP provides.

#

@meager fog Of course. Feel free. Any feedback on improving it would always be gratefully received.

meager fog
#

yah its definitely a "distruptive" tech - its not more powerful, its much less complex which is not usually what engineers go for. we like to compare it to how people-who-normally-would-have-run-a-nfs-server experience dropbox

#

its like "oh dropbox just...works. its not as complex but...thats ok!"

idle owl
#

@errant grail That's so cool! Makes a lot of sense.

meager fog
#

you saw i designed a trinket m0 express for u right? πŸ˜„

umbral dagger
#

@meager fog haha

drowsy geyser
#

Oh, hey, hi @meager fog ! I was off configuring my OctoCam kit and didn't see you come in. πŸ˜ƒ

errant grail
#

@meager fog Yes! The express version will be great for the more advanced models.

meager fog
#

hihi! im taking a short break from routing a few complex older designs

umbral dagger
#

@meager fog I think I mentioned that I was uninterested in Python until I discovered CP.The language is good, but it’s the CP/MP experience that’s the real win.

meager fog
#

yah yah - i think m4 will be a huge upgrade. the m0 is underpowered, but its all we had

#

i think at the m4 python level its usable for 'real projects'

drowsy geyser
#

Yes, but the M0 was a huge leap forward over the 32u4...

meager fog
#

true, but as a py board it feels like a step back, like an attiny. m4 will make it 'feel' more like a > m328 board

drowsy geyser
#

Good point

umbral dagger
#

I like the move M0->M4, leapfrogging the M3 core. Hardware floating point will be a significant upgrade.

meager fog
#

M3 is older than M0, ironically πŸ˜„

errant grail
#

The M4 will be perfect for upgrading a couple of data analysis and music synth projects.

meager fog
#

M3 came first but is now quite old, which is why you dont see new M3 chips

umbral dagger
#

Yup. We did some cool things with M3 based chips at SteelSeries.

#

STM and Freescale mainly.

#

It was at a fairly good price/performance point... especially as it starting getting older.

drowsy geyser
#

I think the M4 will be an excellent platform. With the M0 I couldn't get my robotics to work since there wasn't enough memory left over after loading the packages I needed....

meager fog
#

ironically, its fixed point. but does use the DSP commands in the M4

errant grail
#

nice -- that opens up some multitrack possibilities for feeding the synth from my DAW.

meager fog
#

yah at some point we will look at porting the PJRC audio lib to the samd51

#

it will be 'fun' and 'enjoyable'

drowsy geyser
#

<sarcasem></sarcasm>? πŸ˜ƒ

idle owl
#

Of course not. πŸ˜‰

meager fog
#

(it will not be fun and enjoyable)

#

(it is a lot of very low level stuff to make it fast)

drowsy geyser
#

I can think of a few of the CircuitPython core team who would probably like the very low level programming.

errant grail
#

okay, thanks @meager fog ! I'm going afk for a bit to redesign a couple of projects. πŸ˜ƒ

meager fog
#

yep later me too

#

ciao!

drowsy geyser
#

See ya!

umbral dagger
#

Ya... that audio lib does actually sound fun & enjoyable πŸ˜ƒ

cunning crypt
#

Truly a sound idea

candid sun
#

I've been playing around with the IR stuff for Circuit Python and got it working to control an Apple TV tonight. Did a quick stream if anyone is interested. Big thanks to everyone working on Circuit Python, I really love working with it πŸ˜„ https://www.youtube.com/watch?v=mm82UZDHuSU

Demoing what I've done so far with the Apple TV IR Remote project and hopefully some pairing of the remote with an Apple TV.

β–Ά Play video
umbral dagger
#

Ok, humidity monitor distraction done for now. Time to get back to M4/CP3. First step is to catch up on the state of SPI/I2C support. I want to hook an AMG8833 and the 8x8 dotstar board to it and do some neural net stuff.

idle owl
#

@candid sun That's fantastic!

candid sun
#

@idle owl thank you!

glacial bronze
#

I should get one of those 8x8 dotstar boards and a trinket M0 and make a Conway's Game of Life miniature desk widget

#

I could have it do both random starts and stable and metastable starts

stuck elbow
#

@glacial bronze get a led matrix backpack

umbral dagger
#

The CP/MP simple debugger is making some progress... mostly in terms of my understanding of the VM. Code to follow.

manic glacierBOT
manic glacierBOT
slender iron
manic glacierBOT
umbral dagger
#

@meager fog I have a meetup Wed night, but I'll think about ducking out early to make an appearance on Show & Tell.

umbral dagger
#

OK, this is getting real... Running MP in GDB. This place looks familiar πŸ˜ƒ

hollow tartan
#

Hello Everyone! ampy is giving me grief. windows 7 running python 2.7 esp8266

#

  File "c:\python27\lib\site-packages\ampy\pyboard.py", line 143, in __init__
    raise PyboardError('failed to access ' + device)
ampy.pyboard.PyboardError: failed to access COM5

stuck elbow
#

access rights?

#

no idea how windows handles access to com ports

hollow tartan
#

RE: ampy it works if I disconnect the terminal (TeraTerm or Putty)

stuck elbow
#

Ah, that makes sense.

hollow tartan
#

So , to be completely direct. I want to determine the workflow (methods and steps) for debugging micropython. If anyone has or knows a resource for THAT. I would happily follow their lead.

manic glacierBOT
slender iron
#

@hollow tartan what are you trying to debug? ampy uses the serial connection so you can't use both at once

hollow tartan
#

@slender iron So, I have discovered. I am getting myself ready to attack the problem you asked me to work on. "ignored arguments"

manic glacierBOT
slender iron
#

awesome! sounds like you are close!

bronze geyser
#

i want to read from a sensor every 15 secs forever. So circuitpython/Huzzah I have a while True: ....the challenge is when i run w/ ampy - just hangs there. If I remove the while True: code, rest works fine...any ideas why while True: hangs ...does there have to be a break? hmm.

slender iron
#

@bronze geyser ampy tries to ctrl-c the main.py but its possible there aren't enough ctrc-c for it to get to the repl

hollow tartan
#

ampy run -n is an option ?

bronze geyser
#

thanks i think @slender iron...i apologize i don't understand what ampy is doing ...you're saying it's running the while loop before repl? Wow...i am clueless.

slender iron
#

ampy uses the serial connection and if your main is already running it tries to stop it just like you would

bronze geyser
#

@slender iron - again, apologize for my ignorance. I do an ampy ls ... there is boot.py and my lib directory on the Huzzah. Where then is main.py?

slender iron
#

I thought that was your while loop. are you using ampy run instead?

bronze geyser
#

yah. ampy run.

slender iron
#

(I don't use ampy much)

#

ah ok

bronze geyser
#

what do you do on a Huzzah? (stay away from using it πŸ˜ƒ )

slender iron
#

yeah, I don't use it much

#

ampy hangs because it waits for the program to finish

#

I think @hollow tartan was right

bronze geyser
#

oh...that's unfortunate....

slender iron
#

-n will tell ampy not to wait for it to finish

bronze geyser
#

i use -n ... it exits, but then the stuff i'm printing doesn't print. Real quick...so i assume nothing is running?

slender iron
#

I'd assume it is runing

#

try blinking an led instead

bronze geyser
#

ampy says run "Run a script and print its output" ...oh, yah...right when in doubt blink (so not Dr. Whoish)

slender iron
#

its tricky with a while loop

#

I'd suggest removing the loop for testing and using ampy run

#

long term ampy put the file so it runs even when not connected

bronze geyser
#

@slender iron ... oh yah...contextually that makes sense. Test lines of code = ampy .... endlessly read the sensor data = load on boot and either blink LED or send messages to know what state firmware is in. Thank you.

slender iron
#

yup yup

#

no problem!

hollow tartan
#

@slender iron Am I to assume that ampy is the only tool available to use in testing micropython. I did see a statement the there are others. Is it the only tool you think I will need?

slender iron
#

@hollow tartan for the esp8266 yes

bronze geyser
#

@slender iron while you're at it...how about radiopython to complement circuitpython? Then us folks connecting to whatever won't feel marginalized πŸ˜ƒ

slender iron
#

we

#

er, we'll do radios at some point. just gotta pick our priorities

#

@hollow tartan for the issue I pointed you to, do a simple test script that triggers the bug that you can run with ampy

#

then, when you change the circuitpython code you can confirm its behavior is fixed

hollow tartan
#

@slender iron Hey, that should be helpful. How do you want to share it with me?

slender iron
#

share what with you?

hollow tartan
#

whoa,, micro or circuit python? the test script I am not sure what to write in the script.

#

Oh sorry misread

slender iron
#

I figured you could write the test script πŸ˜ƒ I think the issue has enough detail in it for it

hollow tartan
#

Ok I will try.

slender iron
#

πŸ‘

hollow tartan
#

but my focus will be running it from ampy or from repl? I have loaded a test.py to the file space on micropython. I am also , by the way, reading a short book about Vagrant.

slender iron
#

whichever way works best for you is fine

hollow tartan
#

the problem is in micropython , circuit python, or both?

slender iron
#

circuitpython only

hollow tartan
#

got it,, thanks.

manic glacierBOT
hollow tartan
#

works in micropython πŸ˜ƒ

#

why? because >>> os.listdir() # returns a list! Can I assume that ```b = country[0].encode("ascii")

manic glacierBOT
tulip sleet
#

@hollow tartan encode doesn't exist for all builds, but you can use str(b'abc', 'ascii') for now. See https://github.com/adafruit/circuitpython/issues/384. There is also an issue filed about os.listdir() returning bytes instead of strings sometimes: https://github.com/adafruit/circuitpython/issues/249

manic glacierBOT
#

So I'm so close to being done with this except for the part where it's totally broken. When I take one of the generated double extension file names and run it (blinky in this case) with pyexec_file(double_extension_filename, exec_result); I see my led blink but I loose the CDC serial in /dev/tty* and CIRCUITPY doesn't show up. I assume it's running the blinky that I had previously uploaded and tested with master (5ff6) successfully since I don't have MSC to upload a new file with.

I'm ...

hollow tartan
#

@tulip sleet Thanks for that. I just tested on my Circuit Python and got a good result. Adafruit CircuitPython 2.0.0 on 2017-09-12; ESP module with ESP8266

manic glacierBOT
#

I've been staring at https://github.com/adafruit/circuitpython/blob/2.x/atmel-samd/common-hal/digitalio/DigitalInOut.c and I am wondering if switch_to_output() is not called then how is self->open_drain initialized? If it is not initialized, then will it behave differently for some pins?

If you just set the direction as in the example, I don't think switch_to_output() is ever called.

manic glacierBOT
tulip sleet
#

@slender iron just a progress report: The I2C freq calculations in ASF4 are wrong, and there appears to be a SAMD51 hardware bug: you must set both the SERCOM's BAUD and BAUDLOW to get the right-shape waveform. On the D21 if BAUDLOW is zero BAUD is used to set the length of both for the low and high parts of the SCL clock pulse. The D51 is documented to do that, but it actually doesn't. The baudrate calculations in the hpl_sercom_config.h know this, but the ASF4 I2C library does not. Also, it seems to calculate the wrong value as well (bad algebra or something).

#

good night

umbral dagger
#

@tulip sleet Nice mike drop.

slender iron
#

<@&356864093652516868> Normal time for the CircuitPython weekly tomorrow (Monday) everyone in #circuitpython-dev and the CircuitPython voice channel. Thats 2pm ET and 11am PT. For those outside the US double check the time because we just switched daylight savings this weekend.

hollow tartan
#

Gotta wait weeks to get my OLED parts though.

#

It was so fast and easy since vagrant is installed and working. Wowzers!

manic glacierBOT
manic glacierBOT
manic glacierBOT
plucky flint
#

Morning... now PyCon UK is over I'll try to be more active on here... except that I won't be able to make this evening's chat because I'm giving a talk about MicroPython here in London. πŸ˜ƒ cc/ @slender iron

solar whale
#

@tulip sleet think of it as "alternative" algebra πŸ˜‰ Nice work!

manic glacierBOT
#

I like that idea @deshipu . Thanks.

class LIS3DH_I2C(LIS3DH):

def __init__(self, i2c, address=0x18):
    import adafruit_bus_device.i2c_device as i2c_device
    self._i2c = i2c_device.I2CDevice(i2c, address)
    # handle name change of method readinto; backward compatible
    self._i2c_readinto = getattr(self._i2c, "readinto", getattr(self._i2c, "read_into", None))
    self._buffer = bytearray(6)
    super().__init__()

def _read_register(sel...
manic glacierBOT
manic glacierBOT
stuck elbow
#

@plucky flint good to aee you here!

plucky flint
#

@stuck elbow πŸ‘‹

stuck elbow
#

I mean "see". Tablet on-screen keyboard, sorry.

tulip sleet
#

@slender iron my diagnosis last night about the I2C BAUD and BAUDLOW issues may be wrong. It seems to have to do with the clock values being wrong. I'll contact you.

manic glacierBOT
#

@deshipu Python 3.5 evaluates both getattr() functions, so when we finally remove the redundant read_into method, the None ensures that the getattr(i2c,"read_into") does not throw an Attribute exception. Maybe we need to add

self.i2c_readinto = getattr(i2c,"readinto",getattr(ic2,"read_into",None))

if both readinto and read_into are not present, then throw exception

if self.i2c_readinto == None: raise AttributeError

your thoughts?

stuck elbow
#

when is the meeting?

#

in 1 hour?

#

oh, 2 hours

tidal kiln
#

yep. in ~2. currently 9:17am local.

tidal kiln
slender iron
#

@tulip sleet ready when you are

tidal kiln
#

@idle owl does your cpx lib have a way to change lis3dh range?

idle owl
#

@tidal kiln No. We chose one to use. I think it would be trivial to add if you think there's a need for it.

tidal kiln
#

was/is there a desire to keep the cpx lib as simple as possible? any reasons for not adding it?

hollow tartan
#

OMG I just had the most strange thought. What if adafruit started promising to give away 1 m4 metro to educational projects around the world just like rPi folks are supposed to have been doing.

slender iron
#

@tidal kiln I doubt it. I think EinsteinUnicorn is back in school

#

feel free to ping the issue and offer to take it up

#

@hollow tartan we're kinda doing that already with the trinket, gemma and circuitplayground givewaways with orders

tidal kiln
#

@slender iron k. thanks.

hollow tartan
#

I am aware of the adafruit big order free products incentives. I like that.

#

@slender iron HA Ha. Here is another idea: AdaFruit could offer an trade-in program: Send in a rPi and get a Metro for half price. LOL.

floral dagger
#

Hey folks. Looks you all are having loads of "fun" with the new hardware. πŸ˜ƒ
Wish I could be more active here, but life, man...you know.
Still working on adafruit.io and MQTT. I also just got a INA219 DC current sensing module that I want to get working with my ESP board as well. I found a few things for micropython. Is there anything for that in CP yet?

hollow tartan
#

Maybe, I should get a Sparky Pin. The 3 OLEDs I ordered for my esp8266 have I2C interfaces for which bit banging will be needed on GPIO pins. I could have and should have ordered SPI interface OLEDs.

#

LOL

#

πŸ˜ƒ

tidal kiln
floral dagger
#

awesome, thanks @tidal kiln Figured I'd double check before doing too much with it.

idle owl
#

@tidal kiln There is a desire to keep it simple. However, if it will work like I think it will, we can have it set to a default that doesn't have to be set unless you want to change it. I don't think it'll alter the simplicity much.

hollow tartan
#

@idle owl What is the strategy in the Educational arena for keeping the students from earning their Sparky badges with the Adafruit boards?

tidal kiln
#

@idle owl do you think the desire to keep it simple is strong enough that you want to minimize the amount of functions you add?

stuck elbow
#

@hollow tartan the bit-banged i2c on the esp8266 is as fast as standard i2c

#

I mean, 100kHz is not hard to reach on a 80MHz mcu πŸ˜ƒ

hollow tartan
#

That's good. The refresh rate on the OLEDs is about 80 ms which is only 12.5 Hz. Did you know that they can have "8 bit high SCAN line artifacts" if updated too quickly using u8g2lib driver? LOL

stuck elbow
#

@floral dagger it should be rather easy to write a driver for that

#

@glacial schooner if you send 128x64 pixels, you still get about 50Hz in theory

floral dagger
#

thanks @stuck elbow I may give that a try then.

stuck elbow
#

@hollow tartan sorry, that was meant to you

floral dagger
#

never actually wrote a driver before πŸ˜ƒ

stuck elbow
#

@floral dagger we can help

idle owl
#

@tidal kiln I think it depends what it looks like once it's added. If it's just a matter of an optional parameter in the current function, I think it would be fine. If it means adding more than that, then maybe not. Memory is also a significant concern, though I'm not sure it'll affect that.

slender iron
#

@floral dagger I think @bronze geyser was doing current sensing from a ESP8266. It was a different chip though I believe

floral dagger
#

oh, good to know @slender iron thanks

idle owl
#

@hollow tartan I think a huge part of avoiding Sparky is in the design and function of the Circuit Playground Express, as you can do quite a lot without soldering or having the option to cross wires that would smoke something.

tidal kiln
#

@floral dagger seen scott's guide? (on writing lib)

floral dagger
#

@stuck elbow I'd imagine it's a lot like most other things. I usually learn about 800 ways that it DOESN'T work, before accidentally stumbling backwards into one that does. πŸ˜ƒ

idle owl
#

@hollow tartan Past that, I think we all earn Sparky badges while learning. It's part of the process in and out of an education-specific environment.

floral dagger
hollow tartan
#

@idle owl thanks for you thoughts. I gotta go eat a little bite. see you all at 1 pm CT

idle owl
#

@hollow tartan You're welcome. See you in a bit!

stuck elbow
#

@floral dagger yes, that's pretty much how it works for all of us

tidal kiln
stuck elbow
#

the trick is to be more patient than the computer is

tidal kiln
#

is round supported in cp? i'm getting this:

>>> round(3.14)
0
stuck elbow
#
>>> round(3.14)
3
#

what version do you have?

tidal kiln
#

2.1

stuck elbow
#

mine was 2.0

tidal kiln
#
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> round(2.1)
0
stuck elbow
#

maybe that math functions removal took the round() too

idle owl
#

@tidal kiln I get the same thing as you with the same version.

stuck elbow
#

you can always do int(3.14)

#

that does the floor

tidal kiln
#

@stuck elbow that truncs, want round

stuck elbow
#

int(3.14 + 0.5) maybe? πŸ˜„

tulip sleet
#

@tidal kiln that looks like a bug! Could you file an issue?

tidal kiln
#

@tulip sleet sure. in cp repo, right?

tulip sleet
#

yes, tnx

tidal kiln
#

will do

#

@idle owl thanks for sanity checking

idle owl
#

@tidal kiln Absolutely!

manic glacierBOT
tidal kiln
#

related to a more general question - how to convert float to int in cp? i was trying to use:

int(round(3.14))
stuck elbow
#

that should work

cunning crypt
#

The CircuitPython weekly chat is in about 5 minutes, right?

slender iron
#

yup!

cunning crypt
#

I'm actually home for one of these things

slender iron
#

πŸ‘

idle owl
#

@cunning crypt Hah! You're one of us now!

cunning crypt
#

One of us!

tidal kiln
#

@stuck elbow works, but wondering if that's the accepted way?

stuck elbow
#

that's the obvious way, and python is usually all about the obvious ways

manic glacierBOT
stuck elbow
#

I'm in a browser and it works

#

Chromium, if that helps

hollow tartan
#

hello

#

now I can hear

cunning crypt
#

Negative, not at the moment

#

Also, fiddling with mic...

floral dagger
#

none for me

cunning crypt
#

Discord does not enjoy my mic having its own self mute...

idle owl
#

@cunning crypt I find it eventually gets over it. I mute my mic, not Discord.

hollow tartan
#

ditto ... Group Hug!

pastel panther
#

HRs to @slender iron and @solar whale for testing the metrowing, RC2 coming soon!. Also thanks to @umbral dagger for helping me with some C questions. Also thanks to @meager fog, @tulip sleet and @tannwet for encouraging me to work on my first CP commit.

#

πŸ’’ 🏰 πŸ’’

#

hmm @meager fog "stole" my extremly obvious QSPI upgrade idea πŸ˜›

floral dagger
#

just got an INA219 breakout, and want to start working on my first Circuit Python library for it. I will probably have loads of silly questions for you all.

cunning crypt
#

Silly questions are the best questions.

floral dagger
#

awesome!

stuck elbow
#

@cunning crypt can you switch the mike off?

cunning crypt
#

@stuck elbow My mic's muted.

idle owl
#

It's not Andon's.

hollow tartan
#

FYI I found a really good Python book on O'Reilly Safari: Python Crash Course By: Eric Matthes Publisher: No Starch Press Pub. Date: November 20, 2015 Print ISBN-13: 978-1-59327-603-4 Pages in Print Edition: 560

stuck elbow
#

@cunning crypt it doesn't show you muted

cunning crypt
#

@stuck elbow Physical mute button.

idle owl
#

@stuck elbow It won't if you physically mute your mic, and don't click mute in Discord.

cunning crypt
#

There.

stuck elbow
#

thanks!

idle owl
#

My mic is also physically muted, Discord is not.

#

I'm typing on a cherry mx keyboard, and you're not hearing endless clicking πŸ˜„

cunning crypt
#

clicky clicky

timber lion
#

phew i think discord is loading for me now

#

but it's really slows for some reason

stuck elbow
#

@idle owl I was thinking the echo might be coming from the client, not necessarily thourgh the physical microphone

timber lion
#

can't hear audio either :/

cunning crypt
#

@timber lion It doesn't show you as in the audio channel... Oh, wait, there you are

timber lion
#

yeah it's kinda coming and going

stuck elbow
#

I can only hear Scott

#

not the other half of the conversation

tidal kiln
#

@stuck elbow hang up and reconnect

stuck elbow
#

@tidal kiln thanks, that helped

tidal kiln
#

@stuck elbow it's a "feature", i have to do same

hollow tartan
#

This book seems to offer explanations to get me prepped (as I am new to Python) to help out with Circuit Python. Would someone care to thumbs up this book or point out a superior one or other resource? Python Crash Course By: Eric Matthes Publisher: No Starch Press Pub. Date: November 20, 2015 Print ISBN-13: 978-1-59327-603-4 Pages in Print Edition: 560 πŸ˜ƒ

#

thanks

pastel panther
#

I should have a PR tonight to support double file extensions. I don’t have it working quite how I would like but I think it’s good enough to be useful. I’m slowly relearn everything I’ve forgotten in the last 10+ years since I’ve touched any C code which ends up being just about everything useful :)
If anyone has good C for programmers books let me know
As far as I can tell CDC and MSC are working fine in master. My most recent issues were self-imposed code issues that have since been fixed.

Lastly I just finished hand soldering headers to my JD-T1800 TFT so hopefully I can test with it soon. Pro tip: probably just buy the breakout? Also they’re delicate so don’t solder on it upside down and crack your screen 😦

timber lion
#

great list of resources there

#

there are nice video courses free online you might check out

#

also has some book recs

#

zed shaw's C book is my current favorite

stuck elbow
#

I just got my copy of the "Programming with MicroPython" by @plucky flint

timber lion
#

i can't get audio, it's super choppy

slender iron
#

any other updates besides what you hipchatted me?

timber lion
#

but yeah nothing new from hipchat, working on guide updates to have circuitpython code

tidal kiln
#

yes

pastel panther
#

tuesday is fine

timber lion
#

yeah tuesday is good

cunning crypt
#

Don't think Tuesday will be any different than Monday for me - Probably will be working

pastel panther
#

back to the salt mine for me. Enjoy the rest of your day! πŸ‘‹

idle owl
#

@pastel panther Have a good one

tulip sleet
stuck elbow
#

@tulip sleet awesome, thank you!

floral dagger
#

have a good one everyone

hollow tartan
cunning crypt
timber lion
#

drivers aren't working without busio first though

#

yep i totally am @cunning crypt ahhh that must be my problem

#

it's written in the .travis.yml file

#

read the comments there

cunning crypt
#

I've been having some intermittent issues today as well. Ran across a tweet with that link a few minutes ago.

timber lion
#

@tulip sleet @granite oak check the comments in the .travis.yml files

#

let me know if they don't show enough details

#

it explains you need to add the GITHUB_TOKEN

#

yeah it's a separate config to add GITHUB_TOKEN unfortunately

#

it's state travis stores separately by design

#

because it has to be secure, you can't store the token in the repo

#

anyone with that token has your full control to github

tidal kiln
#

🐱 - mew!

#

(looked behind me, thought a cat walked in)

idle owl
#

@tidal kiln I always check to make sure it's not mine we're hearing πŸ˜„

timber lion
#

nope unfortunately not, travis needs each repo to have an individual .travis.yml

solar whale
#

that was my cat - beating down my door...

timber lion
#

it could first step clone a yaml but it can't produce release artifacts without an explicit list

#

the list of release artifacts to attach has to be in the repo's .travis.yml unfortunately

#

the outputs

#

the "adafruit_vs1053.mpy" etc in it

#

its ability to attach to releases is limited to just whats' in the travis yml

#

i broke the script out as much as i could otherwise, it actually does download a shell script

#

for building the zips

#

yep

#

one for single files and one for multiples

#

the multiple builds a zip, excludes init.py from mpy generation (old bug)

#

etc

#

no unfortunately not it has to have an explicit list of release artifacts

#

it could maybe replace the 2-3 commands

#

but there isnt much to the files

#

yep :/

hollow tartan
#

@timber lion I do have free access to Zed Shaw's books and Videos. thank you for pointing them out! blinka I said to Tony: "Tony, please be more careful on those trails. okay?"

timber lion
#

oh nice, yeah i like his stuff a lot.. it's opinionated but in a good way IMHO

#

his python books are good too

#

oh wow yeah safety is actually #1, i haven't had any trouble yet but am always on the lookout πŸ˜ƒ

stuck elbow
#

Is there a meaning for the different charcters? I know Sparky is for the blue smoke, but the others?

tidal kiln
#

@stuck elbow not really meaning, like blue smoke, but they all have their own personalities.

manic glacierBOT
tidal kiln
solar whale
#

@cunning crypt thanks for the xfinity link - I was having trouble for the past hour or so as well - perhaps that is why....

cunning crypt
#

Yeah, it seems to be pretty widespread.

#

I was having issues with some sites earlier this morning, but it seems to be resolved for me

solar whale
#

me too.

umbral dagger
#

@hollow tartan @timber lion Ya, Zed is a bit of a jerk sometimes, but an awesome guy.

tidal kiln
#

@idle owl i think this has been discussed, not sure where it stands - how to get a value from a single axis of the accelo? (using cpx)

#

this syntax works cpx.acceleration[2] to get Z for example. maybe good enough?

tidal kiln
#

@idle owl also, what about analog in?

manic glacierBOT
tidal kiln
#

is this expected behavior? why 0 for third case?

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> import time
>>> t1=time.monotonic(); time.sleep(0.1); t2=time.monotonic(); print(t2-t1)
0.0976563
>>> t1=time.monotonic(); time.sleep(0.01); t2=time.monotonic(); print(t2-t1)
0.0078125
>>> t1=time.monotonic(); time.sleep(0.001); t2=time.monotonic(); print(t2-t1)
0.0
cunning crypt
#

Looks like time.sleep() isn't ultra-precise, and 0.001 falls underneath that precision.

#

If I were to guess, at least.

tidal kiln
#

@cunning crypt my guess also, esp. given the values for the other two

cunning crypt
#

Yeah. 0.097whatever is pretty close to 0.01, but 0.0078ish is significantly less close to 0.01

#

@tidal kiln I'm assuming M4?

tidal kiln
#

no. m0. good point. i'll edit and add banner for context.

cunning crypt
#

I get similar results.

#

On CircuitPlayground Express

tidal kiln
#

yeah, but that shouldn't matter

cunning crypt
#
>>> import time
>>> t1=time.monotonic(); time.sleep(0.1); t2=time.monotonic(); print(t2-t1)
0.098999
>>> t1=time.monotonic(); time.sleep(0.01); t2=time.monotonic(); print(t2-t1)
0.00900269
>>> t1=time.monotonic(); time.sleep(0.001); t2=time.monotonic(); print(t2-t1)
0.0```
tidal kiln
#

looks a little better, but still 0 on last

#

similar on trinket m0

cunning crypt
#

Running the 0.01 sleep a few times, and it's often 0.0090332

#

Lowest is 0.00891113, highest is 0.0100098

#

Definitely looks like 0.001 is outside of its range

#

Or not. Just got 0.000976563

split ocean
#

@idle owl or anyone w ideas on this, I've got a quick (I hope) question on a simplio module error

cunning crypt
#

It hits 0.0 very often, but it does occasionally hit real numbers.

tidal kiln
#

@split ocean go for it, ask away...

floral dagger
#

time.monotonic is not purely time based. It relies on clock cycles in some cases iirc, so can sometimes be ever so slightly off.

tidal kiln
#

that's probably it, first time i've tried to crank things down this low

floral dagger
#

it returns a fractional representation of time passed, so it could also be in the math

split ocean
#

thanks @tidal kiln I've got a pretty simple bit of code started and as soon as add importing of simpleio I'm getting a memory allocation error

tidal kiln
split ocean
#

Traceback (most recent call last):
File "main.py", line 5, in <module>
File "libraries/helpers/simpleio/simpleio.py", line 225, in <module>
MemoryError: memory allocation failed, allocating 136 bytes

#

here's the code:

#

I'm going to use servo, btw

#

I'm on CircuitPython 2.1 on a CPX w latest bundle

tidal kiln
#

one thing right off - you can access the neopixels via the CPX library

#

line 15 coudl be cpx.pixels[i] = ((R, G, B))

idle owl
#

@tidal kiln Re: accel, I think that syntax might be good enough. But it might be better to have something clearer. Analog in is not included, I hadn't thought about it until trying to write up examples using the CPX library for all the code in the Intro to CPX guide.

slender iron
idle owl
#

@split ocean Checking out your code now.

tidal kiln
#
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> import time
>>> from adafruit_circuitplayground.express import cpx
>>> import neopixel
>>> import board
>>> import simpleio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'simpleio'
>>>
#

recreated, at least

#

oh wait.

idle owl
#

Is simpleio not built in?

tidal kiln
#

forgot i had a paired down set of stuff on my CPX

#

@split ocean did you just drag over all the bundle contents as is? or have you deleted and/or mpy-cross'd anything?

#

ok...that's the error droid i was looking for:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 5, in <module>
  File "libraries/helpers/simpleio/simpleio.py", line 225, in <module>
MemoryError: memory allocation failed, allocating 136 bytes
split ocean
#

I dragged over the unzipped bundle lib directory without any changes

idle owl
#

Does it help to mpy-cross it?

split ocean
#

FWIW, simpleio worked when I ran just the servo code and nothing else as I was working on this

pastel panther
tidal kiln
#

can get away with it in REPL:

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> import time
>>> from adafruit_circuitplayground.express import cpx
>>> import neopixel
>>> import board
>>> import simpleio
>>> 
#

@split ocean "just the servo code" probably had fewer imports?

split ocean
#

yes, many fewer

idle owl
#

I've tried uncommenting a lot of what looked like commented out code... I'm not having memory allocation issues. But I don't know if I've added all the code you're trying to run.

split ocean
#

oh, of course, I'm eating up ram w cute ascii art ;)

idle owl
#

Also, I have 2 micro servos, will one of them work to try to replicate your setup?

#

One is continuous, the other is not.

split ocean
#

yes, I'm not doing anything proper w it yet in that code though

slender iron
#

@tulip sleet get the clock going?

tidal kiln
#

@idle owl so you deleted code comments from the gist?

idle owl
#

I pasted the entire thing in, and uncommented what looked like code. I didn't delete anything.

split ocean
#

was just getting to that. but for now, if you had the servo move to one position when the CPX is rotated CW 90 degrees and another when rotated CCW 90 degrees that would be a good test. Orientation of CPX is like a clock on a wall

tulip sleet
#

@slender iron yeah, but the I2C is twice as fast on the SAMD51, despite the constants being the same. I should double-check gclk1 on both. For a requested 400 kHz clock, '21 is 350-ish, '51 is 735-ish

#

oh wait, maybe a typo

tidal kiln
#

@idle owl i'm getting same memory error as @split ocean if i just paste as is and use the bundle as is. are you doing something different?

idle owl
#

I only copied simpleio.mpy out of the library bundle into my lib folder. So all that's in there is adafruitcircuitplayground/ and simpleio.mpy

#

Let me copy the rest of the bundle in

tulip sleet
#

@slender iron all better - I forgot to change the clock source in one place. Identical clocks on both now. Now to test a fancier device like the accelerometer

slender iron
#

w00t!

tulip sleet
#

maybe a pull request soon! can you do the asf4 pull I have on tap?

idle owl
#

Memory allocation error.

#

Wait!

tulip sleet
#

take two mpy-cross's and call me in the morning

slender iron
#

@tulip sleet yup, will look now

manic glacierBOT
idle owl
#

@tidal kiln If the bundle is there as-is, it means that lis3dh is included, and it's already frozen into the firmware for the CPX.

#

If I delete ONLY that from the bundle, it works fine.

#

You can't have it duplicated. It was frozen in because the acceleration module was too much to be run from the lib folder.

tulip sleet
#

@idle owl the frozen one is last on sys.path. If there's one in lib it will take that one first

idle owl
#

@tulip sleet So it seems!

tidal kiln
#

hey. wasn't this discussed today? board specific bundles?

idle owl
#

@split ocean You have to delete lis3dh from the bundle for it to work.

split ocean
#

got it.

manic glacierBOT
idle owl
#

It's been discussed previously as well πŸ˜ƒ

tidal kiln
#

is there a good decoder ring for what to remove from the full menu for each board? or is cpx the only outlier?

split ocean
#

this is for an AdaBox 006 project guide -- is the current thinking that there won't be board specific bundles? in that case, I'll include a step where people remove that module.

idle owl
#

I think it's the only outlier for included libs. The trinket and gemma issue is just space and only importing what you need vs. having a board "specific" bundle for them.

#

@split ocean I would include the step for now. We talked about doing board specific bundles but there are a number of reasons why it's still up in the air.

split ocean
#

roger that

#

Thanks @tidal kiln and @idle owl that worked!

idle owl
#

Yay!

tidal kiln
#

np @split ocean , good job @idle owl

tulip sleet
#

@slender iron thanks on asf4! lis3dh returns acceleration on CPX! That's a good exercise. I'll look at your clock fixes, merge that in, retest, and submit a PR.

slender iron
#

πŸ‘

manic glacierBOT
tidal kiln
#

@idle owl the CP classic just used arduino libs to do analog and digital io. so in that same style, maybe no need for anything in the CPX lib. just use core modules.

idle owl
#

@tidal kiln Ok keen. I wasn't sure whether it was something worth looking into. In my mind, the CPX lib uses in some way everything built into the board and once you're past that, you're to a point that using core modules is easier to understand.

split ocean
#

on that note, do we have a debounce built into the cpx.button_a check?

idle owl
#

So the lib works with the board stand-alone and as you start adding external sensors an so on, you start using core modules.

slender iron
#

@tidal kiln I can voice or video chat with you about the ADC in the next couple hours if you like.

idle owl
#

@split ocean I don't know. I didn't write the button code, so I'm not as familiar with it. @slender iron do you remember?

split ocean
#

it seems to work really well, but just want to make sure I show best practices in this

slender iron
#

@split ocean it doesn't debounce. it just runs slowly. let me know if you see weirdness with it

split ocean
#

cool. no weirdness thusfar ;)

slender iron
#

k, then its ok as is πŸ˜ƒ

#

@stuck elbow introduced gamepad with debouncing if you want to track button presses that happen between checks

manic glacierBOT
split ocean
#

@idle owl @slender iron on that topic of how much simplification is introduced w the adafruit_circuitplayground.express import cpx action:

#

do I still need to import DigitalInOut, Direction, Pull if I'm using cpx.button_a?

#

or is that implicit

idle owl
#

Nope. Implicit.

split ocean
#

SNAZZY

#

Oh, I see same goes for neopixel, as well. excellent.

idle owl
#

@split ocean Yep, and brightness works. You can set it before your while loop or in it.

tulip sleet
#

@slender iron another asf4 PR before the circuitpython PR

slender iron
#

needs a rebase

tulip sleet
#

@slender iron the CONTAINER_OF changes are redundant

split ocean
#

got it. and you were saying earlier that simplio is still a separate module to import because it's not based on sensors that are physically on the cpx?

tidal kiln
#

and just so you know, this x = int(xF) truncates

>>> print(int(3.99999) )
3
slender iron
#

@tulip sleet merge it as you like I just approved

idle owl
#

@split ocean Not exactly. It just hasn't been frozen into the firmware. The reason for including or not including something in the CPX lib is in design discussions, I was simply explaining how I think about the library. I feel like we could expand it to include the options available with the Educator's pack, which I believe includes a servo, but we haven't gotten to that point yet.

split ocean
#

Cool.

tidal kiln
idle owl
#

As time passes, we'll definitely expand it to include new things as we find that there are new use cases for it. The more people use it, the more we learn what types of things people want to do with it.

tidal kiln
#

@split ocean some of what @idle owl was saying may have been related to the discussion about analog in and how to use it with CPX

idle owl
#

@tidal kiln Looping back to earlier, what was your reason for needing access to the lis3dh range?

tidal kiln
#

so it could be changed for different applications

#

for example, wanted to crank it down to 2G for better accuracy

#

or up to 16G for something super shaky

slender iron
#

@tidal kiln for the ads change I'd just suggest documenting ADC_Channel

tidal kiln
slender iron
#

and removing the stuff thats commented out because it moved

tidal kiln
#

@slender iron want to talk?

slender iron
#

I can if you like

idle owl
#

I don't think it will be as simple as exposing the parameter. So I wanted to know whether it was a general thing or whether you'd come up with a specific use case.

#

Yeah we picked one of the range levels in the middle.

tidal kiln
#

@slender iron need to set mic up....one sec...

slender iron
#

kk

#

it just shows as connecting for me

tidal kiln
#

same

manic glacierBOT
#
  • Added asf4_conf/samd*/hpl_sercom_config.h
  • Adjusted clocks in peripheral_clk_config.h.
  • Put some frozen libs back in CPX for testing.
  • Implement common-hal I2C.
  • Re-enable resetting SERCOMs in port_init(), so SERCOM's get reset on soft reboot.
  • Add samd*_peripherals.h in parallel with samd*_pins.h for common
    functions and data.
  • Store SERCOM index in pins table for convenience.
  • Canonicalize some #include guard names in various .h files.
slender iron
cunning crypt
#

Does CircuitPython have any sort of sleep functionality? IE, all-but-shutoff the M0?

idle owl
#

Not at the moment.

cunning crypt
#

Not surprised.

slender iron
#

@cunning crypt I glanced at it a bit but it didn't seem easy

#

I'd love it if time.sleep() was smart enough to manage it

cunning crypt
#

That'd be cool

idle owl
#

@slender iron Send me the neopixel update.

slender iron
#

πŸ˜ƒ

#

1 sec, updating everything first

idle owl
#

Np

slender iron
#

need a uf2 or bin?

idle owl
#

uf2 please

#

@errant grail Congrats!!

slender iron
#

building now @idle owl. you'll be the first to test

idle owl
#

@slender iron Nice!

slender iron
idle owl
#

@slender iron Woah! That's noticably faster!

#

Already had rainbow animation code and a neopixel strip wired up.

#

REPL working fine.

slender iron
#

oooh perfect!

#

I expected it to crash πŸ˜ƒ

idle owl
#

It's not mounting on reset though.

slender iron
#

what do you mean by reset?

umbral dagger
#

Update time. Here's the file running that's loaded/running: acc = 0 for i in range(10): acc = acc + i debugger() and here's a trace: MicroPython Debugger DD> acc acc 0 DD> i i 0 DD> :c :c CONTINUE MicroPython Debugger DD> acc acc 1 DD> i i 1 DD> :c :c CONTINUE MicroPython Debugger DD> :c :c CONTINUE MicroPython Debugger DD> i i 3 DD> acc acc 6 DD> :c :c CONTINUE MicroPython Debugger DD> :c :c CONTINUE MicroPython Debugger DD> i i 5 DD> acc acc 15 DD>

idle owl
#

If I eject it, and either press reset or unplug it and plug it back in, it doesn't show up in Finder. It took 2 resets once to get it to show up, but after that it's not showing up again. I can get to it via serial, but it's not mounting circuitpy drive

slender iron
#

@idle owl master does this too right?

idle owl
#

It had stopped doing this I thought.

slender iron
#

its based on the latest master

idle owl
#

Ok this time it popped up. Hmm.

#

Now it's mounting consistently.

#

Except when Finder crashes, lol. Wondering if it's something odd on my end.

#

I can reboot, but this is what it was doing before the last USB fix. Finder just crashed again. I'll reboot.

slender iron
#

a bug is totally possible

#

please file an issue with instructions to reproduce

#

I don't think resets on the USB side are handled well

idle owl
#

Ok repro'd after reboot.

#

Ejecting and physically removing was working until it popped up as NO_NAME and my code stopped running. And apparently erased the board.

slender iron
#

hrmmm, crazy!

idle owl
#

Ooh. So it let me get to the bootloader and drag the firmware you sent me to it, rebooted it like it worked, and came back up as no_name.

#

Even with no_name mounted, I can at least temporarily get to and interact with the REPL

slender iron
#

thats weird its no_name

#

when it updates it won't rewrite the file systems

idle owl
#

I was able to copy main.py and neopixel.py to no_name and have it run, at least while I'm connected via serial.

#

And I can import main.py inside the REPL and it runs.

slender iron
#

ok, so the name of the disk just got corrupted

idle owl
#

It erased my code and module files, I had to copy them back.

#

But they're working now.

manic glacierBOT
idle owl
#

Hmm.

#

Also a file called _NEOPi~1.PY was on the cleared drive when it mounted again as no_name. Containing somewhat jibberish. That acted really weird when I tried to paste it in here, so I'll include the file if you want, but I don't want to crash anything with weird non-code..

slender iron
#

yeah, I think the filename is stored in the same place as the disk name

idle owl
#

So... jlink? And try to repro?

#

Because reflashing the firmware.uf2 isn't resolving the issue.

slender iron
#

yeah, you need something to erase the file system flash for you

#

do you all know how to erase with jlink? I don't actually

idle owl
#

No. I know how to reflash. I was going to reflash the bootloader, and then reload the uf2.

slender iron
#

the bootloader isn't working?

idle owl
#

It is. But that's the only way I know to clear everything would be to reflash the bootloader.

#

I guess I could try using the jlink and a .bin firmware

tidal kiln
#

erase spi flash?

#

via jlink?

idle owl
#

We have flash eraser files for the M0 boards, I don't know how they work or whether they'd work on the M4 though.

#

Those work through the bootloader.

#

I mean they're uf2 files, I assume that's how they work.

vague monolith
#

They're available on readthedocs page under troubleshooting for circuitpython

tidal kiln
#

cause i don't know either. theres erase but that's just for on chip

idle owl
#

I know but I don't know if they'd work on the M4 board. They're designed for the M0 boards.

tidal kiln
#

afaik

slender iron
#

all filesystems are on chip now

tidal kiln
#

oh. then erase

idle owl
#

How does that work

tidal kiln
#

run JLinkExe

#

connect

slender iron
#

that will erase the bootloader if you've never updated via the self-updater uf2

tidal kiln
#

then erase

slender iron
#

the self-updater sets the protection bits

idle owl
#

@slender iron I didn't because you said it made doing things with the jlink more difficult.

slender iron
#

it does a little

#

it might be easier than reloading the bootloader though to do a chip erase

vague monolith
#

What is jlink?

tidal kiln
idle owl
#

Well, I've always got the jlink to reload something if I break it, lol. So I'll do erase

tidal kiln
#

@vague monolith a programmer for ARM core chips

#

@slender iron you can get around any protection bits using the jlink, correct?

slender iron
#

yeah

vague monolith
#

Nice

slender iron
#

its just one command you have to remember to run

idle owl
#

It's been a while, how am I connecting to it again?

#

Not jlink, connecting to the M4

tidal kiln
#

command wise?

idle owl
#

Yeah

slender iron
idle owl
#

connect -somethingspecific

tidal kiln
#

try just running JLinkExe

#

should get a prompt?

idle owl
#

Yep

tidal kiln
#

connect

idle owl
#

Oh. I thought I had to tell it things.... oh wait, it asks inside JLinkExe doesn't it

#

I had forgotten

tidal kiln
#

you do, but this way you do so interactively

idle owl
#

speed is 1000 right?

tidal kiln
#

i've gotten away with 4000, so dunno

idle owl
#

hmm ok

tidal kiln
#

SWD

idle owl
#

I remembered that one

#

I.. think it worked?

manic glacierBOT
#

I don't think you need these three things. SPI.CTRLA.bit.SWRST is the same memory location as I2CM.CTRLA.bit.SWRST because SPI and I2CM are members of a union. Instead, I think you had "in use" errors because the reset takes time and the M4 is faster than the M0. You can wait on the state of SYNCBUSY.bit.SWRST. It'll be 0 when the reset is finished.

tidal kiln
#

when you're back to the prompt, then do erase

idle owl
#

So just type erase?

#

ok

#

Done.

tidal kiln
#

loadbin foo.bin, 0

idle owl
#

foo being the bootloader?

tidal kiln
#

yep

idle owl
#

@slender iron Other than the self-updater one, is the bootloader.bin I have from 24 October still the most up to date? Or should I just load the self-updater.

slender iron
#

I think so

#

I haven't changed anything recently

tidal kiln
#

INFO_UF2.TXT:

UF2 Bootloader v1.23.0-14-g3db9182 SFHR
Model: Metro M4
Board-ID: SAMD21G19A-Metro-v0
#

^^ thats whats on my M4 fwiw

#

@slender iron i think i remember i did this:

chan0 = adc[0]
chan0.value
#

so that you could then show how one could pass chan0 to something else

#

and it would work the same as analogio

slender iron
#

right, maybe use it in a loop after that instead with an analogio example commented out?

tidal kiln
#

yeah. i can make a stab at something. and can always comment once pr is made.

slender iron
#

sounds good!

tidal kiln
#

gotta run. @idle owl , you set?

idle owl
#

@tidal kiln Yeah looks like it! Thanks!

tidal kiln
#

cool. you can do all the interactive stuff via command line to expedite if you want.

#

i've just been running in that interactive mode for now

idle owl
#

Makes sense. I had forgotten it did that.

tidal kiln
#

but now you're back to bootloader goodness and can move forward from there (without jlink)

idle owl
#

Yep! Firmware loaded happily. Now I'm back to ejecting and reseting. πŸ˜ƒ

slender iron
#

aka back to breaking it again πŸ˜›

idle owl
#

Exactly!

#

Isn't that the point? I thought it was the point.

tidal kiln
#

but can pwn and fix with jlink, so no worries.

idle owl
#

Yep!

slender iron
#

sure πŸ˜ƒ I do wish you had usb logs to go with it

manic glacierBOT
idle owl
#

Doesn't that require another piece of HW? Or am I hoping to get that from dmesg

slender iron
#

dmesg error would help

#

I use a beagle to get it. If you have a linux box it could get close too

idle owl
#

It's mostly not returning dmesg errors. Every so many times I get this: USB device 239A802114130002 - fConsecutiveResetCount = 1. SmartBattery: finished polling type 4 disk3s1: device/channel is not attached. disk3s1: device/channel is not attached. disk3s1: device/channel is not attached. disk3s1: media is not present. USB device 239A802114130002 - fConsecutiveResetCount = 2. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. disk3s1: media is not present. USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1

#

There's a lot of other messages, but I guess I'm not entirely sure what all would be related.

slender iron
#

I think the disk3s1 messages are ok

idle owl
#

There aren't really any errors. I have an older linux laptop I can fire up.

slender iron
#

wireshark can be used to capture usb on linux

#

I gotta go do a few chores before dinner with tony

#

thanks for the help and testing!

idle owl
#

For sure!

manic glacierBOT
#

Thanks for the info! I didn’t look just thought there might be.
On Mon, Nov 6, 2017 at 5:49 PM Kevin Townsend notifications@github.com
wrote:

@tannewt https://github.com/tannewt Feel free to correct me, but I've
never seen a QSPI display ... it's normally only used for very high speed
flash memory access, such as an MCU with external flash where you want to
execute code directly off the SPI flash device. As such, for anything
display related I don't think it's worth waiting or ...

manic glacierBOT
#

sercom_clock_init is new by me (it's in samd*1_periphals.c). I do need the clock lookup table (maybe not the SLOW), because the numbers are random.

I think we could get rid of the _i2cms configuration table in hp_sercom.c, but it means changing the semantics of the library somewhat. I was trying to make minimal code changes to ASF4 aside from fixing bugs, so that we could merge more easily later.

The compiler can't inline the values because they're looked up by an index computed...

manic glacierBOT
manic glacierBOT
#

Batch basis is fine with me!

On Mon, Nov 6, 2017 at 6:39 PM Dan Halbert notifications@github.com wrote:

Merged #413 https://github.com/adafruit/circuitpython/pull/413.

β€”
You are receiving this because your review was requested.

Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/413#event-1328873287, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AADNqZD3XyAcMQJEmLF_NiG0SeLPlhbDks5sz8LHgaJpZM4QUHiF
...

manic glacierBOT
#

This is a great talk, and GameBoy is certainly a very well engineered system β€” though they drove their LCD display directly, not with a luxurious chip that we have nowadays, so the timings had the be exactly right.
I haven't heard about quad-spi displays β€” I think at that point you would simply use a parallel 8-bit or 16-bit interface, that most such displays support. We might add support for that at some point, but it will have to be in the C module. I did try to make it just fill the buffe...

manic glacierBOT
manic glacierBOT
#

I fixed the unnecessary SERCOM reset and removed the unused routine. I have some ideas for getting rid of the configuration tables. But are you willing to defer that for a little while and take the current implementation so people can start testing with I2C devices? I'll come back to the configuration stuff when I start implementing the next part of busio.

manic glacierBOT
cunning crypt
#

I mean no offense, guys, it's a great problem to have... but I think I need to set up an email strictly for GitHub

floral dagger
#

good afternoon everyone. I am running through the library example on learn. When I try to run this line:
cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
I get this error:
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/adafruit/cookiecutter-adafruit-circuitpython.git']' returned non-zero exit status 128.

#

Anyone have any insights on what could be thecause?

tulip sleet
#

@floral dagger can you run git clone https://github.com/adafruit/cookiecutter-adafruit-circuitpython.git from the command line? That's all the above is doing.

floral dagger
#

@tulip sleet yeah, that works without a hitch

#

Is that all I need to do, or does the cookiecutter command do more?

tulip sleet
#

no, that's just the first part; it asks you a bunch of questions and then fills in some slots in the cookiecutter template. what os is this on, and how do you have git installed?

floral dagger
#

windows 10. I installed git from the command line, and I have the windows gui program installed too

tulip sleet
#

I don't know if the script works on windows. If you just type git in a CMD window, does it do anything?

#

it may not be in your path

#

gotta leave for an appt - sorry

floral dagger
#

Yeah, git seems to work fine. It shows all the commands

tulip sleet
#

consider using WSL (windows subsystem for Linux), which will let you do all this inside a real Linux env in Windows

floral dagger
#

I'd really prefer to not do that if possible. Any other options @tulip sleet ?

tidal kiln
#

i've run into a use case issue with using _FOO = const(99)

#

since _FOO becomes hidden, it limits how you can break things up into multiple files

#

which is my use case:
base_class.py contains the base class and all the consts
some_class.py imports above and derives, but can't access the consts

manic glacierBOT
#

@mrmcwethy yeah, I was confused thinking we were changing CircuitPython's methods.

I think that we should just switch the libraries over to readinto. Lets leave read_into in the I2CDevice class for a little while for any other libraries to catch up.

I want people to grab libraries out of the bundle instead of separately because we can then verify bundled libraries always work with each other.

stuck elbow
#

the issue is that git is a special animal and returns non-zero exit status on success

#

because Linus said so

tidal kiln
#

multiple flavors of success?

stuck elbow
#

yeah, I think the commands that modify something return 2

#

or something like that

floral dagger
#

The text returned:

  File "path\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec)
  File "path\runpy.py", line 85, in _run_code exec(code, run_globals)
  File "path\cookiecutter.exe\__main__.py", line 9, in <module>
  File "path\core.py", line 722, in __call__ return self.main(*args, **kwargs)
  File "path\core.py", line 697, in main rv = self.invoke(ctx)
  File "path\core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params)
  File "path\core.py", line 535, in invoke return callback(*args, **kwargs)
  File "path\cli.py", line 120, in main password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
  File "path\main.py", line 63, in cookiecutter password=password
  File "path\repository.py", line 103, in determine_repo_dir no_input=no_input,
  File "path\vcs.py", line 99, in clone stderr=subprocess.STDOUT,
  File "path\subprocess.py", line 336, in check_output **kwargs).stdout
  File "path\subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/adafruit/cookiecutter-adafruit-circuitpython.git']' returned non-zero exit status 128.```
#

had to replace the actual path with "path" to get under the discord character limit

#

it looks like the git command completes as expected, but it fails in other places

#

(all files are present in the destination folder)

opaque patrol
#

FYI, I test the cookiecutter using the git bash and got the same errors

tidal kiln
#

just to sanity check, ran on linux, all ok:

~/test$ cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
You've cloned /home/foo/.cookiecutters/cookiecutter-adafruit-circuitpython before. Is it okay to delete and re-clone it? [yes]: yes
library_name: test_library
depends_on_bus_device []: y
depends_on_register []: n
author: Foo Bar
company [Adafruit Industries]: 
~/test$ cd test_library/
~/test/test_library$ ls
adafruit_test_library.py  CODE_OF_CONDUCT.md  LICENSE     readthedocs.yml
api.rst                   conf.py             README.rst  requirements.txt
solar whale
#

well - there you go - problem soved πŸ˜‰

glad hazel
#

Is it possible to record some audio from the on board mic on the Circuit Playground express using circuit python? I'm having trouble getting the right API to record audio πŸ˜•

manic glacierBOT
#

I was looking at the Circuit Playground Express tutorial. It is obviously not done. It is huge with lots of useful info but it looks like a lot of cut and paste was done. It needs some editing for things that need to be changed for inclusion in this specific tutorial. I try to give feedback when I notice things. It would work if the tutorial pointed to the bin files. It said "this is how to recover with a bin file" but no pointer to bin files. I went to the release area and no bin file.

tulip sleet
glad hazel
#

@tulip sleet Thank you! Do you think switching to C++ would work more reliably, or will this be enough for a simple record and playback?

tulip sleet
#

@glad hazel You'll probably have to do some experimenting. As that issue discusses, there is some signal processing you may want to do on the result. Here is some more doc for CircuitPython: https://circuitpython.readthedocs.io/en/2.x/shared-bindings/audiobusio/PDMIn.html. And here is a tutorial for a similar mic with Arduino and Rpi info: https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/arduino-wiring-and-test. Also note that the CPX is supported by MakeCode, which has microphone support: https://learn.adafruit.com/adafruit-circuit-playground-express/makecode

Make faster and easier than ever with MakeCode, CircuitPython or Arduino!

bronze geyser
#

anyone recovered from this w/o reinstalling circuitpython? ampy.pyboard.PyboardError: could not enter raw repl

#

I thought I could ctl-d or something...but so far not successful.

stuck elbow
#

can you enter repl normally?

bronze geyser
#

yah. I just (seems slowly) thought to go to a screen.

stuck elbow
#

raw mode is ctrl+b iirc

floral dagger
#

Ok, well since I can't use cookiecutter in windows apparently. Is there another reference I can use?

manic glacierBOT
#

This is off point for the issue but there was a bigger problem in the tutorial. I probably didn't need bossa. I tried to load circuitPython and the behavior didn't match the tutorial. Bright lights flashed, two popups appeared indicating that both CIRCUITPY and CPLAYBOOT had been improperly removed and CIRCUITPY was not on the desktop as promised.

It turns out that in spite of the weird behavior circuitPython was actually running. CIRCUITPY was mounted (according to 'df' and 'ls /Volumes/*...

bronze geyser
#

@stuck elbow ok. I can get into raw then repl using screen.... but ampy can't get to raw repl?

stuck elbow
#

your don't have your screen running at the same time, do you?

bronze geyser
#

no.

#

if i did, it would be access error instead of could not enter raw repl....

stuck elbow
#

true, just making sure

#

do you have anything running there? any main.py?

bronze geyser
#

yes indeedy. i have main.py....i stupidly put a While True: so I assume this is choking access...

stuck elbow
#

can you rename it with os.rename()?

bronze geyser
#

ooh. clever. i will try this. thanks.

stuck elbow
#

use os.listdit() to see if it worked

#

listdir()

manic glacierBOT
bronze geyser
#

@stuck elbow THANKS! Brilliant. I shoulda but didn't think of that! I appreciate and am grateful for your cleverness.

stuck elbow
#

it's more like I just had all those problems before and someone told me the solution, but you are welcome

bronze geyser
#

i dunno...in some ways i love bumbling into these kind of challenges because it makes me happy knowing there are very clever people all around us.

manic glacierBOT
#

I just tried the uf2 boot process again and much of the weirdness is gone. I only got a single unmount warning popup for CPLAYBOOT. None for CIRCUITPY this time. Even better CIRCUITPY was on the desktop. And the finder sidebar CIRCUITPY worked. I was able to drag the uf2 file to it. If it had been doing this Saturday I wouldn't have been fiddling with bossa. I think I rebooted the Mac in there somewhere. OSX must have been in a bad state.

stuck elbow
#

as long as they don't take too long to resolve β€” I just fixed a bug I was working 2 weeks on 😦

manic glacierBOT
fading solstice
#

@tulip sleet Have you had the following problem builid cpxcleanmake?

#

Generating build-circuitplayground_express/genhdr/mpversion.h
GEN build-circuitplayground_express/genhdr/qstr.i.last
QSTR updated
GEN build-circuitplayground_express/genhdr/qstrdefs.generated.h
Traceback (most recent call last):
File "../../tools/mpy-tool.py", line 593, in <module>
main()
File "../../tools/mpy-tool.py", line 581, in main
raw_codes = [read_mpy(file) for file in args.files]
File "../../tools/mpy-tool.py", line 448, in read_mpy
raise Exception('incompatible .mpy version')
Exception: incompatible .mpy version
../../py/mkrules.mk:132: recipe for target 'build-circuitplayground_express/frozen_mpy.c' failed
make: *** [build-circuitplayground_express/frozen_mpy.c] Error 1
make: *** Deleting file 'build-circuitplayground_express/frozen_mpy.c'
make: *** Waiting for unfinished jobs....

tulip sleet
#

@fading solstice you need to build mpy-cross explicitly. You're using a previously built version that's old. Just cd mpy-cross;make

fading solstice
#

ok

tulip sleet
#

we should probably fix it so that it rebuilds automatically; there was a reason once upon a time...

fading solstice
#

yep, that worked!

fading solstice
#

@tulip sleet or @slender iron After building and loading CPS .uf2 onto a CPX board. the number of byte left on the drive is super low. 10K byte free. Do i need a new bootloader for CPX board?

tulip sleet
#

@fading solstice do you mean in CIRCUITPY? That size is not affected by the size of the .uf2.

#

or do you mean the size left as reported by the build process

fading solstice
#

Yes the CIRCUITPY: drive has total byte of 47k and 10K left free. i thought the drive used to be bigger

tulip sleet
#

For 3.0, we're not yet using the SPI flash chip on the CPX. We have to write the code to do that. So for now, the 256k flash is divided into 192k for the firmware and 64k for the filesystem. That's how it is on Gemma/Trinket M0, Feather M0 basic, etc.

#

(boards without SPI flash)

fading solstice
#

ok, thanks

meager grove
#

If the brown truck doesn't arrive soon...

#

I just want to play with CircuitPython.

idle owl
#

@glad hazel Did you get sorted with your audio recording? I have a slightly modified version of the CircuitPython code that Dan linked from GitHub that works to record a few seconds of sound and play it back using the Circuit Playground Express. I don't know whether this would help or not - you may have already found a solution to your need.

meager grove
#

I was punished for my impatience by a summons to jury duty.

solar whale
#

@tulip sleet Is there any magic to be done to test i2c for M4? I built master and created new adafruit_bus_device and adafruit_register .mpys - so far i2c.scan() is not fiinding anthing. ```>>> import board

import digitalio
import busio
import time
i2c = busio.I2C(board.SCL, board.SDA)
i2c.scan()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Function requires lock.
i2c.try_lock()
True
i2c.scan()
[]

#

this was on
Adafruit CircuitPython 3.0.0-alpha.0-1151-g9060df5 on 2017-11-07; Metro M4 Express with samd51j19

tulip sleet
#

@solar whale no that's exactly how I tested. Let me try again with an M4. The default I2C freq is 400kHz, not 100 KHz. I was testing with an SHT31 humidity sensor and with the accelerometer on the CPX.

solar whale
#

I am trying a BMP280

#

I can try it on an M0 as well - just went for broke πŸ˜‰

tulip sleet
#

i did try both

solar whale
#

I need to go off for a bit - be back in an hour or so - no rush - just though I't try some tests.

tulip sleet
#

I don't have a BMP280 - should get one, since it's so popular. I have to leave in 5 mins also, back about 8:30pm

#

i will try once

#
>>> import busio
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> i2c.try_lock()
True
>>> i2c.scan()
[68]
>>> 
#

68 ix 0x44, the SHT31

#

I don't have many other I2C devices except output-only ones like HTK1633, etc.

solar whale
#

I hookedi up a mcp9008and it sees it!```>>> import board

import digitalio
import busio
import time
i2c = busio.I2C(board.SCL, board.SDA)
i2c.try_lock()
True
i2c.scan()
[24]

#

i'll test more devices - and check my wires!

tulip sleet
#

Try i2c = busio.I2C(board.SCL, board.SDA, frequency=100000) if you think it might be too fast. I don't know what the BMP280 is spec'd for, but if it worked before on 2.x, it's probably OK.

#

ttyl

solar whale
#

thanks - will do