#circuitpython-dev

1 messages Β· Page 121 of 1

manic glacierBOT
solar whale
#

@tulip sleet My mother always said "check the wiring" - bothte BMP280 and MCP9808 work fine on the M4 - sorry for the confusion. Great job on this - nice to have sensors!

manic glacierBOT
slender iron
manic glacierBOT
solar whale
#

@tulip sleet also checked out an mpr121 touch sensor no problems so far.

manic glacierBOT
hollow tartan
#

@slender iron very interesting proposition RE usb descriptors! ... we hope to run the library on CircuitPython itself! That way we can change the descriptor dynamically on boot! We’ll be able to choose between HID, MIDI and other things dynamically.

solar whale
#

@tulip sleet @pastel panther OK this must be close to a tri-fecta - I was able to write text to an ssd1306 on the M4 under 3.0 with the ssd1306 mounted to my metrowing!!! woohoo! So this tests i2c, framebuf and the metrowing!

#

and with the ssd1306 module loaded look at the free memory!! ```

from board import *
import busio

Import the SSD1306 module.

import adafruit_ssd1306

i2c = busio.I2C(SCL, SDA)
display = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
display.text("yowza",0,0)
display.show("yowza",0,0)
display.show()
display.text("yowza",10,0)
display.text("yowza",10,10)
display.show()
import gc
gc.mem_free()
114784

tidal kiln
#

usage question about @ property's:
i'm using a class that has several properties, so you can do:

reading1 = some_class.foo1
reading2 = some_class.foo2

but how can i create a sequence object of properties i'm interested in so i can iterate over them and get their values?

solar whale
#

The metro_m4 is under the metrowing! having way too much fun now that i2c is working!

idle owl
#

@solar whale So cool!

solar whale
#

Wow! running the color wheel demo on a "jewel " (7 neopixels) on the M4 - the update response is so much faster than on the M0!

slender iron
#

@hollow tartan yup yup, your comment made me want to look at the HID stuff πŸ˜ƒ

idle owl
#

@solar whale It's crazy, isn't it?

#

Mine's running a NeoPixel strip. It's so fast!

solar whale
#

It really is great - I switched to a 16 pixel ring and it loops around about 3 times faster than on the M0

manic glacierBOT
slender iron
#

we need a reaction emoticon for speed

drowsy geyser
#

Good Lord! There's some massive github activity tonight! πŸ˜ƒ

manic glacierBOT
#

Wait a couple of seconds before creating a new filesystem if it appears the current filesystem is non-existent or severely corrupted. This will reduce the chance of erasing the filesystem on jittery power.

@tdicola could you try this? I tested with a CPX and a battery. Before this it was easy to erase the filesystem. Now it takes a lot more effort: I have to be really jittery when plugging in the battery and bobble the connector way beyond what would happen normally. I can lengthen the del...

idle owl
#

@solar whale Are any of the externals you have hooked up RGBW? I couldn't get mine to work.

solar whale
#

no - sorry - only RGB's here

idle owl
#

Ok. No worries πŸ˜ƒ

tulip sleet
#

@solar whale thanks for all the I2C testing! Glad it's working out. SPI is probably next.

solar whale
#

@tulip sleet Thank you for getting it going!

idle owl
#

Hm.

#

Set bpp=4, nothing. Change it to bpp=3 and it does the weird three-quarter-light-wrong-color thing it does when you send RGB data to RGBW.

manic glacierBOT
solar whale
#

@idle owl looks like I managed to sorrupt my FS - How to erase the FS on your M4?

idle owl
#

I got it to light up a single color! The issue lies in the animation code.

#

@solar whale JLinkExe, connect, erase, but then you have to reload the bootloader too. loadbin foo.bin, 0 I believe.

#

That's what I had to do yesterday because reflashing just the uf2 failed.

solar whale
#

ok - thanks

idle owl
#

HAH! RAINBOW!

#

(Sorry... really excited.)

tulip sleet
#

@solar whale if you replace the bootloader and then use the update-bootloader.uf2 to overwrite itself, it should set the BOOTPROT fuse to protect it in the future. Unless JLink erase turns those fuses off. You could also use bossac -e with the M4-compatible bossac.

idle owl
#

@solar whale What code did you use for the color wheel on your NeoPixel jewel?

#

@tulip sleet I don't think erase turns it off. Scott posted a link yesterday with the command to run to turn them off if you need to.

solar whale
#

its been too long since I did this - can I upload the update-bootloader.bin with Jlink, or should I jsut use bootloader.bin

idle owl
#

@solar whale Thank you!

#

Both will work with JLink I thought, the update-bootloader is the one that will set protect.

pastel panther
#

@solar whale Awesome! Glad it's working, at least in part! I should have mkii done later this week

hollow tartan
#

@idle owl Oh, I think you mean the changes/updates are applied very quickly. Can you do the math: Actual verses theoretical maximum for the NeoPixel Strip?

idle owl
#

@hollow tartan I have no idea how to do that.

hollow tartan
#

scope measurement and data sheet I think

meager fog
#

@tulip sleet @slender iron im taking a break from some horrible linux stuff. is m4 i2c workin and ready for test?

slender iron
#

@meager fog yup its checked in

#

@solar whale had it working too

meager fog
#

kool yay i also got the feather m4's made if ya feel like making a config for em

idle owl
#

@meager fog oh rad!

solar whale
#

I ran tests on several I2C devices - ssd1306, mcp9808,bmp280, mpr121 -- all good!

meager fog
#

oh yay thanks jerry! thats awesome of you πŸ˜ƒ

slender iron
#

@meager fog I can whip it up now if you like. Will have to bail when becca gets home

meager fog
#

sure

#

its committed - use Rev B2

#

ill test later tonite - i am in some linux stuff i want to get done

solar whale
#

It is fantastic to have memory to play with - have 2 temp sensors running and dispolaying on OLED!

meager fog
#

or cna do tomorrow, no rush

slender iron
#

@meager fog which chip does it have? samd51j19?

meager fog
#

g19

slender iron
#

just loaded it in kicad πŸ˜‰

pastel panther
#

I'm assuming it's on on the adafruit github yet?

slender iron
#

its not

#

pcb designs are made public at launch

pastel panther
#

makes sense.

solar whale
#

@idle owl @tulip sleet whew! reloade and running again. Thanks for the help. I need to do that more often πŸ˜‰

idle owl
#

@solar whale You're welcome! I know the feeling.

slender iron
#

@meager fog want a feather m4 bin?

meager fog
#

uf2 is fine

slender iron
pastel panther
#

swoon

slender iron
#

I also claimed 0x8026 for it in the usb doc @meager fog

meager fog
#

k

slender iron
solar whale
#

How much space should teh be in CIRCUITPY on the metro-m4?

idle owl
#

I'm pretty consistently having eventual USB issues. Which is to say, if I leave it sit for a while and then try to interact with it in Finder or by editing a file in Atom, both freeze and I have to physically reset the board.

#

@solar whale Finder says 244kb.

solar whale
#

@idle owl and how much is free?

idle owl
#

I closed the info window before I could check and now it's not mounting. I want to say 190kb.

#

I have a couple of code files on there, my current main.py has quite a bit in it because I commented out a lot to try different code, and neopixel.py lib is on there.

solar whale
#

nevermind - in finder I see 244kb and on;y 7 in use -- confused on linux - I tried to copy entire /lib to it - not good!

idle owl
#

Ah, yeah

solar whale
#

I'm seeing some funny behavior too, but trying to figure out if it is just me doing silly tings.

idle owl
#

219kb free

solar whale
#

Thanks - sounds right - and my linux box is happier now after I reconnected it.

idle owl
#

I had to plug it into USB2 on Windows again, still reset it about 10 times before it would show up. Changed main.py to something else. Mounted immediately on Mac with USB3.

#

But it's still acting oddly. I don't have the brain to deal with it tonight though.

solar whale
#

I know that feeing - I am about to quit as well.

idle owl
#

@solar whale I deleted all the commented out code from main.py, put it in a different file. Seems to be handling being ejected and reset better now.

hollow tartan
#

@solar whale is the flash drive file system on M4 visible and usable? so you can just copy a .py in and run it from REPL?

idle owl
#

@hollow tartan Yes. It works like all the M0 CircuitPython boards.

solar whale
#

@hollow tartan yes

hollow tartan
#

Very Nice.

#

Is there hope for esp8266 to get that feature?

solar whale
#

@idle owl sounds better - I finally think I have thisgs restored. the M4 does not handle running out of space very well

#

@hollow tartan I doubt it will happen soon if at all. The USB interface to the esp8266 is very different and my understanding is that it cannot be made to work as a flash drive like the m0 and m4.

idle owl
#

@solar whale Good to know about running out of space.

solar whale
#

I need to get to bed - early moning ahead - Goodnight all!

idle owl
#

@solar whale Goodnight!

hollow tartan
#

thanks. nite.

pastel panther
#

'night @solar whale

tulip sleet
#

@idle owl are you doing a sync immediately after writing the file? That may help.

idle owl
#

@tulip sleet No, how and where would I be doing that? I edit in Atom and save files, and sometimes I connect via serial, other times I don't.

tulip sleet
#

Just type sync in another terminal window after you write in Atom. That flushes writes to all disk drives.

idle owl
#

Ah

tulip sleet
#

Or, edit the file locally, and then do cp /foo/bar/main.py /media/<username>/CIRCUITPY; sync

idle owl
#

And you think that will stop it from freezing everything? Or was this in response to a different issue.

tulip sleet
#

If the freezing is due to write delays, it will get rid of that. Scott has pushed several MSC changes recently. If you can pin it down to a specific commit, that would be helpful to him.

idle owl
#

I had significantly more code in main.py than I was using.... I'd say a full 2/3 of it was commented out as I was trying different things to get the rainbow animation to work on both an RGB strip and an RGBW ring. I removed all the commented out code, and it's been playing nice for at least the last little bit of time. But it seems like it just happens over time again, that it freezes and doesn't eject, requires physical removal, and then doesn't mount.

tulip sleet
#

for instance, removing all the comments makes the file smaller, and so it may write completely in one go instead of being delayed

idle owl
#

See, exactly πŸ˜ƒ

tulip sleet
#

but it could just be length of time...

idle owl
#

I'll leave it running, connected to serial overnight and see what happens.

tulip sleet
#

what is your linux box?

#

(OS version, etc.)

#

uname -a

idle owl
#

I'm on MacOS at the moment. But I updated the Linux lapatop last night to 17.04.

tulip sleet
#

I'm on 16.04. But not 17.10?

idle owl
#

Yeah, I was wondering the same thing. I looked to see if it would let me do 16.04 through the GUI, but it offered 17.04. I just checked the updater to see if it would tell me what version I was running, it says 17.04 and offered to upgrade to 17.10.

#

So who knows why it wouldn't go straight to 17.10.

#

So I could run the upgrade to 17.10.

#

(It was on 16.10)

#

I hadn't done anything with it in a while.

tulip sleet
#

i usually just stick to the long-term support releases. I did drop unity for cinnamon (the mint UI), because it was kind of non-obstrusive

coarse barn
idle owl
#

Gemma doesn't have SPI flash.

tulip sleet
#

is this on Windows?

coarse barn
#

I'm on the mac.

#

10.11.6

tulip sleet
#

do you have Arduino installed?

coarse barn
#

I just flashed to CircuitPython 2.1.0 and am trying to update the libs for the Gemma 2.0

#

Yes, I have arduino installed as well.

tulip sleet
#

if you load any Arduino program on the Gemma it will erase the entire flash. Then load CPy again and it will create the filesystem from scratch (empty)

#

so just load blink or similar

#

what kinds of errors are you getting?

coarse barn
#

the filesystem appears to be full, can't save to the fs.

idle owl
#

Gemma will fill up if you try to load the entire library bundle.

#

Did you choose some specific ones and it's still giving you those errors?

coarse barn
#

I should be specifically running the lib directory from gemma_m0_2.0.0 which is a minimal set of hid, dotstar and neopixel

idle owl
#

Ah ok

tulip sleet
#

on the mac, many mac junk files are copied to the filesystem at the same time

#

I'm trying to find Tony DiCola's writeup of how to clean those up or avoid them in the first place.

idle owl
#

Scroll down to "Prevent & Remove Mac OSX Hidden Files".

tulip sleet
#

@idle owl thanks!

#

good night all -sorry!

idle owl
#

@coarse barn I would start by loading an Arduino program to your Gemma, reflash CircuitPython, load the new versions of the three libraries, and see if you're still running into issues. If you are, you can use the info in the guide to remove the Mac OSX hidden files.

#

@tulip sleet Good night

#

And I need to head out as well. It's late here.

coarse barn
#

left out the adafruit_hid and got the python code to run, once I removed the instances of Keyboard from all the demo code.

floral dagger
#

So, been working on trying to get cookiecutter to work, and am getting nowhere. Does it only work on linux?

#

If so, that really should be mentioned in the instructions

coarse barn
#

@idle owl thanks for the help!

slender iron
#

@floral dagger cookiecutter is written by others so I'm not sure of the windows state. its a step you could skip though

#

@coarse barn glad you got it going

timber mango
#

Hi all, I don't know if this is the right place to drop my question (Mike advice me to look here), but has someone managed a working connection with an ethernet module (for example the WIZ820io) in combination with MicroPython/CircuitPython (for example the Feather Huzzah/Feather M0 Express)? For my project I need to set up a telnet connection <> Uart Tx/Rx. The physical connection isn't the problemen, but it's my lack of driver experience (if any exists).
With kind regards, Jeroen

drowsy geyser
#

Hullo, CircuitPython friends. Is anyone else having trouble with tonight's firmware build on Windows? I built the firmware, flashed it, and now I can't talk to the COM port and I don't get CIRCUITPY mounting, regardless of reboots and resets. Just wondering. I'll head off to GitHub and open an issue.

manic glacierBOT
#

I rebuilt the firmware tonight and flashed my Metro M4 Express. Now I cannot get Putty to open a serial connection to the COM port (I get an "Unable to open connection to COM50 Cannot open serial port" error). Also, CIRCUITPY does not appear when the M4 is connected. This behavior is the same regardless of which USB port I use or whether I connect to a USB hub. Rebooting the laptop doesn't change the behavior (this is Windows 10, by the way). No pattern of resetting the M4 or dropping into th...

hollow tartan
#

@timber mango i just looked on github and there seem to be some relevant projects there. go to the main page and search. Sorry but I have no knowledge of that chip.

stuck elbow
#

@timber mango I'm afraid we haven't gotten the drivers for all the radio and network chips written yet

solar whale
#

@drowsy geyser Just did a fresh pull/build on linux box - works ok ```Adafruit CircuitPython 3.0.0-alpha.0-1154-gb4fc464 on 2017-11-08; Metro M4 Express with samd51j19

drowsy geyser
#

Hmmmm, thanks @solar whale !

solar whale
#

sorry 😦

#

dis you make clean first?

drowsy geyser
#

No worries! Yes, I did.

solar whale
#

good luck!

#

I see you havea 3.0.-beta tag - is that something local?

#

I don't see that tag on the repo.

solar whale
#

@tulip sleet @slender iron Just a heads up - not sure if this is somethign to watch. First, I was able to make a 3.0 Bundle - yay! - just made a local tag and then built to it.... Then,I forgot the M4 has only limited Flash space and I tried copying the whole lib/ to it. It did not give me any errors - inidicating it was out of space but ithe FS really got very messed up and eventually I just had to erase the whole thing and reload. It is working now with just the necesary divers loaded. I have not tried to reproduce it. I was just curious if you had any experiece with filling the FS on the M4 yet. Do you want me to explre this and file an issue on it or just chalk it up to alpha testig at this point?

timber mango
#

@stuck elbow no problemen, from Mike I hard the samen answer. @hollow tartan I will search on Github. I can't imagine ethernet and python isn't something that's unique ;)

stuck elbow
#

I guess we need someone who would be interested in using all this networks things and willing to work on them. Most of us so far focused on sensors, displays and actuators. I briefly dabbled with the nrf24l01, but I don't currently have a project that would use it.
Generally, the communication stuff is rather hard and complex, and requires domain-specific experience, so it takes longer than, say, neopixels.

tulip sleet
#

@solar whale (@slender iron) Do you have a non-Express M0 board you could try filling up the filesystem on with 2.1 loaded? See what kinds of errors it gives. It could be that the fs code is not as robust in 3.0. In any case, filing an issue would be great. Thanks!

solar whale
#

@tulip sleet Yes - I'll try it on a gemma or tinket and sse how it goes. I know I have recieved out of space erros on the trinket in the past. Hopefully I can get some testing on it later today. This day job gets in the way πŸ˜‰

manic glacierBOT
#

I ran into an issue last night when I mistakenly tried to load the whole bundle lib/ onto my Metro-M4 with the current master 3.0 build. There was not enough room, but I did not receive any "out of space" errors. instead, the FS became corrupted and would only mount as read-only. Several files were clearly corrupte (truncated). I eventually erased the whole flash and restored it with only the necessary libraries and it was all working again.

I have seen out of space errors in the past wit...

tulip sleet
#

@drowsy geyser I can confirm that the USB drives are not acting right on Windows. On Win10 build 17025, I see two drives without names. On Win7 I see one device with messed-up properties, and no drives in Explorer. I'll do some bisecting to find the cause. I have some ideas but it could be one of several things.

drowsy geyser
#

Thanks, @tulip sleet ! Let me know if you need any data from my system.

manic glacierBOT
tidal kiln
#

@idle owl how do i play silence with cpx.play_tone() ?

manic glacierBOT
#

I also see this problem on Windows 10, and a similar problem on Windows 7.
Some testing data with a Metro M4 on various commits. Note that I have a slow Windows 10 box running Windows Insider build 17025. I had to press F5 in the Explorer window to get Windows to update the list of disk drives promptly.

  • 1893669: just before Python-generated USB descriptors.
    CIRCUITPY drive D:, REPL OK.
  • 4aeef10: introduction of generated descriptors.
    Windows shows CIRCUITPY D: and "Removable disk E:...
bronze geyser
#

I'm collecting sensor data on a Huzzah running Circuit Python. If I do a While True: .... sometimes I can't break in and stop main.py...it just won't. I end up having to erase/reinstall everything. Is there a recommendation for similar to loop() in arduino but with the ability to break? (note: sometimes I can get into repl and os.rename('main.py','foo.py') but not always...then i really don't seem to have any pins left on the Huzzah to insert a button...?

#

..hmmm...i guess since the sensor thing is publishing mqtt, i'll have it subscribe to a control mqtt message and tell the thing to break out of main.py...

opal elk
#

how are you trying to stop it?

stuck elbow
#

@bronze geyser I think adding a sleep() in the loop might help

bronze geyser
#

I was hooking up to serial, opening screen, then ctl-b. Sometimes this worked. But then another time I had a bug in my main.py code, so the code crashed..crashed...kept cycling crashing. I couldn't break in. I thought then it would be great to have a jumper to GND and one of the pins. Then if the pin goes low. ...

stuck elbow
#

even a sleep(0)

#

@bronze geyser you should use ctrl+c

bronze geyser
#

thanks @stuck elbow I had a time.sleep()

#

@stuck elbow I tried ctl-c ...and every other ctl-combo just for giggles.

#

the thing is, the Huzzah refused to release the serial once main.py got upset.

#

screaming "get a grip" to main.py didn't work either...

solar whale
#

πŸ”¨

stuck elbow
#

what do you mean?

bronze geyser
#

@stuck elbow oh sorry. main.py had a bug in it. so it kept crashing...i call this "getting upset." This is because i think of main.py as a little person trapped inside the Huzzah.

stuck elbow
#

that might actually be the reason for it being non-responsive, what kind of bug?

solar whale
#

not sure if it matters for control-C , but other contol characted have to be the first char in al ine to be recognized. Make sure you have not sent anyhting else ahead of it.

bronze geyser
#

i am not sure what was ultimately wrong. It got late yesterday. So I stopped and started today by wiping the Huzzah and installing everything again. I realize this might have been selfish, but i wanted to feel better about all of this....

#

@solar whale thanks. I like the hammer idea too though...

solar whale
#

@stuck elbow do you know if control-c should be recognised any time or just as first char in a line?

stuck elbow
#

@solar whale it only works when your program is running

solar whale
#

good point!

stuck elbow
#

@bronze geyser no worries, but it does look like some kind of more low-level crash than a regular exception

bronze geyser
#

@stuck elbow i think you are right. In the future, is there an action i can take that would benefit circuit python ?

stuck elbow
#

@bronze geyser writing the minimal example program that reproduces the problem and reporting it as a bug

bronze geyser
#

@stuck elbow Thank you. will do.

slender iron
#

@bronze geyser another thing you can do is asking someone like @stuck elbow or @solar whale to reproduce it on their huzzah

manic glacierBOT
bronze geyser
#

@slender iron thank you. Good advice.

manic glacierBOT
#

Ill do it with my windows box
On Wed, Nov 8, 2017 at 9:58 AM Dan Halbert notifications@github.com wrote:

I have no idea either! I thought it might have been a descriptor issue. Do
you want me to take some Windows Beagle USB logs for you with and without
the revert?

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

Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/424#issuecomment-342901370,
or mute the thread
...

solar whale
#

@bronze geyser I'll be happy to give it a try if you have an example.

bronze geyser
#

@solar whale thanks...unfortunately I erased before I put together debugging.

solar whale
#

@bronze geyser No problem - it'll come back πŸ˜‰ anytime.

bronze geyser
#

Yes indeed @solar whale

tidal kiln
#
>>> cpx.play_tone(4000,1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "libraries/drivers/circuitplayground/adafruit_circuitplayground/express.py", line 394, in play_tone
  File "libraries/drivers/circuitplayground/adafruit_circuitplayground/express.py", line 421, in start_tone
ValueError: Unsupported playback frequency
#

anybody know what the supported range is? (having trouble finding it)

#

appears to be 3500 ?

slender iron
#

it'll be dependent on the resolution of the sine wave from the cpx library

idle owl
#

@coarse barn You're welcome! I'm glad you got it sorted.

#

@tidal kiln I was hoping entering a frequency of 0 would work, but it doesn't. I'm not sure how you would use it that way.

tidal kiln
#

@slender iron your link is to core code though, right?

slender iron
#

ya

tidal kiln
#

so how would the cpx lib affect the 350000 cut off?

slender iron
#

@tulip sleet I found one issue where the inquiry response isn't always aligned

#

cpx is play a sample of length n at frequency n * frequency I think

idle owl
#

@tulip sleet I left the M4 connected overnight, and at some point the serial connection dropped, and when I tried to interact with it in Finder, it froze until I physically removed tfhe M4. I ran into the same Windows 10 errors last night when trying to resolve my issue - 2 unnamed drives - but a bunch of resetting eventually got circuitpy to mount.

tulip sleet
#

@slender iron good detective work. do you know the place to fix yet?

slender iron
#

do COMPILER_ALIGNED(4) for inquiry_info and format_capa

#

I don't think this would cause things to half work like @idle owl is seeing

tidal kiln
#

@idle owl for simple melody playback where a 0 could allow for a pause:

melody = (400, 0, 323, 480, 0, 0, 340)
for n in melody:
    cpx.play_tone(n, 0.1)
idle owl
#

@tidal kiln It gave me an unsupported frequency error when I tried to do cpx.play_tone(0, 1)

tidal kiln
#

i'm currently doing something like this:

melody = (400, 0, 323, 480, 0, 0, 340)
for n in melody:
    if n == 0:
        time.sleep(0.1)
    else:
        cpx.play_tone(n, 0.1)
#

@idle owl yep, that's why i was asking how to play silence

slender iron
#

@tidal kiln I like the second form because its clear its not playing a tone

idle owl
#

Ah. Yeah I don't know.

#

Or rather, it's not built in at the moment.

tidal kiln
#

but i'm also having an issue on the high end, can't play anything above 3500

idle owl
#

Is there a theoretical limit for the onboard speaker? Or is that a code issue.

#

Or actual limit, I guess. Theoretical is probably not the right word for my question.

tidal kiln
#

probably code, like @slender iron pointed out, the resolution of the sine wave in cpx

idle owl
#

Makes sense

tidal kiln
#

more resolution = can go higher, but requires more storage

idle owl
#

Ohhh right, I remember talking about this.

#

Or something close anyway.

tidal kiln
#

the arduino lib works much differently, it just uses timer interrupts

#

350000 / 100 = 3500

#

yeah math

opaque patrol
#

the first parameter for play_tone is frequency, I don't think 4000 hz will work

tidal kiln
#

@opaque patrol correct. it won't. for software reasons. apparently.

slender iron
#

@tidal kiln I linked you to the core code earlier

tidal kiln
#

@slender iron yep. thanks. was pointing out other in case docs are out of date or something.

#

or maybe that was the wrong place to start looking?

#

(i was doing that hours ago)

opaque patrol
#

Looks like 4000 should work...

#

in ports\atmel-samd\common-hal\audioio\AudioOut.c
line 546: common_hal_audioio_audioout_set_frequency

if (frequency == 0 || frequency > 350000) {
    mp_raise_ValueError("Unsupported playback frequency");
}
tidal kiln
#

@opaque patrol that's lower level

slender iron
#

@tidal kiln I don't know how read the docs creates code links. I usually just search the code for the error message to find where its coming from

tidal kiln
#

@slender iron me too. it wasn't obvious in this case though.

#

see stack trace above

#

(or is that due to mpy?)

slender iron
#

I don't know

tidal kiln
#

then i really don't know πŸ˜€

tulip sleet
#

@tidal kiln your .mpy might just be out of date with the source

tidal kiln
#

thought of that too, not sure how to confirm though, it's whatever is in 2.1 bundle

#

@tulip sleet that's it. just looked at files from previous commit.

tulip sleet
tidal kiln
#

@tulip sleet thanks. that's a better way to nav there.

#

next question would be how to get to the c code from there?

slender iron
#

@tidal kiln find the code in shared-bindings that matches the module you are using and then find the common-hal code it calls

opaque patrol
#

I think I see the problem...

#

sine_wave is initialized to None self.sample.frequency = int(len(self.sine_wave) * frequency)

#

so it might be possible this is multiplying frequency by 0 which equals 0 and would result in the error message "Unsupported playback frequency"

stuck elbow
#

TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

#

TypeError: object of type 'NoneType' has no len()

tulip sleet
#

@slender iron critical section fixed it! seems to be ok on windows now

#

(I was doing some other paperwork.)

slender iron
#

I'm still seeing some issues

#

on non-debug builds

tulip sleet
#

does the other mscdf_xer_blocks at line 312 also need guarding. it does a final mscdf_send_csw()

slender iron
#

yeah maybe

#

on the beagle I'm seeing it respond with extra read blocks I think

#

and that extra read block is sent as a response to something thats not a read

opaque patrol
#

@tidal kiln I think the max value for frequency in start_tone is 3499 , I don't have an express yet to test myself.

split ocean
#

NeoPixel on CPX question:

#

do we have an equivalent of setting pixel colors and then "showing" them all at once like in Arduino when using the express cpx.pixels method?

#

I'm trying to change all colors at once, instead of w a slight chase effect I'm getting iterating through them

stuck elbow
#

Yes, disable autoupdate when creating the NeoPixel object

lofty topaz
#

@stuck elbow Bingo!
Was just about to....

split ocean
#

since I'm doing this w express I'm not explicitly creating the NeoPixel object.

stuck elbow
#

I guess that forces you to create it yourself instead of using cpx

split ocean
#

crossed streams :)

#

I'm doing this for a Learn Guide, and gonna try to keep it as simple as I can

stuck elbow
#

sorry for slow typing, I'm on a screen keyboard

split ocean
#

ew

#

sorry

#

:)

stuck elbow
#

you might be able to disable autoupdate on cpx.pixels

split ocean
#

I know i can do cpx.pixels.brightness = 0.2 to change the object

stuck elbow
#

Just look at the source to see how the attribute is called

split ocean
#

maybe there's an equivalent for autoupdate?

#

roger that

opaque patrol
#

@split ocean you could try setting the neopixel auto_write to false

split ocean
#

@opaque patrol that's what I'd like to do, and then after setting all their colors do a write/show. just need to figure out the syntax!

slender iron
#

cpx.pixels.auto_write = False cpx.pixels.show()

split ocean
#

thanks @slender iron !!!

slender iron
#

pixels is just a NeoPixel object thats already made

split ocean
#

I dig it

manic glacierBOT
solar whale
#

@tulip sleet thanks for the M4 eraser! It'll be a lot easirer to recover if I can recreate the issue I had last night!

manic glacierBOT
slender iron
#

@solar whale I think I found and fixed your issue

#

I was copying the bundle over and then deleting it to stress test it

solar whale
#

Great! Glad it was real πŸ˜‰

#

Is the fix commited?

slender iron
#

just testing it one last time

solar whale
#

no rush!

slender iron
#

I did get file corruption like you did

tulip sleet
#

@solar whale I tested the erase .uf2's on Gemma, but not on m4. Something not working on m4, so hold on.

solar whale
#

@tulip sleet thanks for the warning.

tulip sleet
#

@slender iron it's still pretty flaky on Win7 and Win10. Sometimes doesn't show name, just "Removable Disk". Try it yourself. I had to reboot to clear some bad state. Very slow to appear if at all. Try to compare it with the reverted version from my pull request

#

btw, I cloned tannewt/circuitpython to build. Surprised that repl said "0.9.0-xxx". Your repo is missing a lot of tags. Maybe do "fetch --tags"?

slender iron
#

Can you post some traces? I’m finishing up lunch

tulip sleet
#

we have to go out in 5 mins or so, I'll be back around 8:30ish ET

slender iron
#

kk

pulsar bloom
#

Maybe a little off topic, trying to program CPE on arduino. Red led breathing, see cpe on com12, verbose turned on and arduino runs F:\Users\ritas\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM12 -U true -i -e -w -v F:\Users\ritas\AppData\Local\Temp\arduino_build_274068/cp-blink.ino.bin -R

#

com12 times out

#

Tried running bossac from command line with same result

slender iron
#

@solar whale ping me if you get a chance to test the pull request

tidal kiln
solar whale
#

@slender iron I should be available in an hour or so.

slender iron
#

ok thanks @solar whale

idle owl
#

@slender iron What do you need tested

pulsar bloom
#

@tidal kiln tried all possible interations of button clicking, multiple usb cables, multiple usb ports, multiple cpe it all seems to point to bossac not working.....

idle owl
#

@slender iron How do I build from something still in a PR?

tidal kiln
pulsar bloom
#

Thanks suspect win10 problem

slender iron
#

you can add my repo as a remote or I can just post a build for you

idle owl
#

Ooh. Build for me. I want to figure out adding yours as a remote but not right now.

#

My friend is currently sewing neopixels at the moment so I have bit before back to teaching. She wrote her first CircuitPython today! And when she tried just threading them together without fabric, nearly smoked one of the NeoPixels. Been a day filled with firsts! πŸ˜„

slender iron
lofty topaz
#

Hello all who flip bits. Kibitzin' again. Amazing stuff. Quick Question? How in the world do you keep from breaking the build? That was sacreligious in my day. Saw developers fired on the spot for breaking the build.

tidal kiln
#

@lofty topaz break in what way? by changing source code?

lofty topaz
#

@tidal kiln By checking in code that does NOT allow the build to perform. You never ever break the build.

#

A syntax bug.

#

I always wondered how "open source" kept from breaking the build.

tidal kiln
#

@lofty topaz in general, by forking the working code and modifying that. then merging it back in to working (main) branch is done once reviewed by those who will make sure it doesn't break. hopefully.

idle owl
#

@slender iron Hmm. Am I testing the USB issues with this update? Or something else... Because it's still acting weird.

slender iron
#

usb

#

what are you attempting with it?

lofty topaz
#

@tidal kiln Sounds like a job for Superman. πŸ˜ƒ

idle owl
#

On the mac first. It mounted ~10 times in a row after the reset button was hit, on the next one, didn't want to mount. Physically unplugged it, Finder complained about circuitpy disconnecting (even though it wasn't mounted). Windows USB3, nothing, Windows USB2, still 2 unnamed drives.

tidal kiln
#

@lofty topaz the tools help a lot. also the fact that we are not pushing live code to a mars rover or something.

lofty topaz
#

Curious tho, in this day and age, do your builds take 3 to 4 hours like ours did over night?

#

@tidal kiln Oh yes, the tools are most helpful. I wish I had the tools back then that we have today.

slender iron
#

@idle owl so you are plugging it in and then hitting reset after it shows up? are you ejecting?

#

@lofty topaz they take 10 -15 minutes and are run by Travis CI

lofty topaz
#

@slender iron Now that's what I call a luxury.

manic glacierBOT
slender iron
#

@lofty topaz thats slow too. we'd love it to be faster

umbral dagger
#

Works been intense this week, but I plan to upgrade to the latest CP3.0 asap and start poking at sensors and such.

#

I'm also aiming to get home in time for Show&Tell tonight.

lofty topaz
#

@slender iron Patients, have patients. The time will come when it takes no time at all.

#

I save to the f: drive and walla, the CPX is running it. In seconds.

#

And to think I used to wait for 30 minutes while the EEPROM bathed in UV light before dumping hex code into it. Then plugging it into the S100 board and hoping the Z80 based system will run.

#

Yeah, I'd say things are a tad easier these days.

slender iron
#

πŸ˜„ I'm happy the iteration cycle is a bit faster now

stuck elbow
#

Nice. I used to compile the kernel for a week on my 386...

#

Kids have it easy today πŸ˜‰

lofty topaz
#

I once esent a 386 to our plant in Mexico and an FBI agent called me and said that technology was too advanced to export. Your under arrest. πŸ˜ƒ

#

We worked it out but my boss wasn't too happy.

stuck elbow
#

I recently had to file some documents to be able to order an infra-red sensor from mouser

#

because they are "restricted export" and they wanted to know exactly what it is for

lofty topaz
#

@stuck elbow I can believe it. Do the paperwork. It pays.

stuck elbow
#

funny thing is that Adafruit is selling them on breakout boards and you don't need any documents for that

#

it was the AMG8833

idle owl
#

@slender iron I was ejecting every time.

slender iron
#

hrm ok

tidal kiln
#

@stuck elbow did you see the post about the AMG being mis-classified?

stuck elbow
#

I have not

tidal kiln
#

(hmmm maybe that wasn't posted)

umbral dagger
#

@stuck elbow I bought some raw AMG8833s from Digikey and had to do the declaration. I believe that requirement got dropped just after I got them.

stuck elbow
#

nice, good to know

umbral dagger
#

MetroM4 is happily updated to master

tidal kiln
stuck elbow
#

thanks, that's interesting

#

I was trying to imagine what they think you could possibly build with this that would be dangerous, that you couldn't build with a bunch of phototransistors

#

heat-homing systems come to mind, of course

idle owl
#

Also after sitting for a bit, it froze Finder. Trying the second build you sent.

#

So here's the other thing that happens whne it starts acting odd and doesn't mount: the main.py that's running loads and runs really slowly.

#

It's a rainbow animation and it goes from zipping along to a really slow fill and slow rotation.

#

But that's even only 1 in 3 times that it didn't mount. And this time, at least if I reset it again, circuitpy shows up. Before once it did that, it wouldn't show up again at all until it had been physically removed.

stuck elbow
#

I noticed that even on 2.x Trinket M0 runs slower when connected to USB

#

especially when doing anything cpu-intense

idle owl
#

Couple of things that look like errors in dmesg: disk3: media is not present. disk3: media is not present. disk3: media is not present. disk3: media is not present. disk3: media is not present. msdosfs_fat_uninit_vol: error 6 from msdosfs_fat_cache_flush USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1

#
USB device 239A802114130002 - fConsecutiveResetCount = 1.
disk3s1: device/channel is not attached.
USBMSC Identifier (non-unique): AF8C5FF815E47535020202D473C480FF 0x239a 0x8021 0x100, 1
SandboxViolation: AssetCache(18795) deny(1) file-read-metadata /Volumes
USB device 239A802114130002 - BOT reset completed with kUSBHostReturnPipeStalled.
USB device 239A802114130002 - fConsecutiveResetCount = 1.```
solar whale
#

@slender iron I can test it now - unless it has already been done.

idle owl
#

Most of the rest of it is the same thing you've told me previously was fine.

#

@solar whale Test it. I'm still having issues with it. Could be on my end.

solar whale
#

@slender iron is it inthe file you posted above or should I download it.

idle owl
#

The first uf2 he posted is the one to try first.

slender iron
#

@idle owl was the latest uf2 better than the first?

#

I'm seeing the issues here too

#

@idle owl and @stuck elbow main gets slowed down by usb interrupts I think

idle owl
#

@slender iron The latest was much smoother for me.

slender iron
#

hrm, smoother how?

idle owl
#

It mounts more consistently, when it stops mounting it at least mounts again after a reset or two, before it didn't. It did freeze Finder once, but mounted immediately again after unplugging it physically.

slender iron
#

hrm

idle owl
#

Let me check Windows.

#

Still nothing on Windows USB3, two unnamed on USB2.

solar whale
#

@slender iron wa thsi the correct version to test ?? ```Adafruit CircuitPython v1.9.3-1401-g971bd7e9a on 2017-11-08; Metro M4 Express with samd51j19

idle owl
#

Oh.

#

When I plugged it into windows, the onboard NeoPixel went white.

#

Plugged back into Mac, and the system's been erased. No files.

slender iron
#

hrm

idle owl
#

Mounted once as circuitpy. On reset: disk was not readable. Took a ton of resetting to get it to mount as circuitpy again, still empty though. Only has boot_out.txt.

slender iron
#

are you copying files to it?

solar whale
#

@slender iron I just overfilled it and it responded correctly - no space on device - recoved fine

idle owl
#

I wasn't at the time of any of this happening. Just ejecting and mounting to it.

solar whale
#

INterstingly, the whole lib/ actually fit - had to copy it twice to fill it

slender iron
#

hmm, sounds troublesome still

solar whale
#

@slender iron why the 1.9.3 tag?

idle owl
#

Tried copying another file to it with a main.py already there that wasn't working, Finder is frozen.

slender iron
#

its the latest tag (from micropython)

solar whale
#

ok - it seems to handle overfilling the FS well - at least for one test

slender iron
#

try that

solar whale
#

who?

slender iron
#

both of you πŸ˜ƒ

#

please

idle owl
#

Mounted 20 times, didn't mount one time, but mounted again after reset on that one. Some error in my main.py apparently, but eh.

slender iron
#

I think the blinky error code is wrong when main is missing

idle owl
#

This seems to be working better than before.

solar whale
#

also works fine for me - reported no space on devive - recoved fie when I made space

idle owl
#

Oh. Also, it erased the code again.

slender iron
#

k, thats with the revert that dan proposed

idle owl
#

So there's no main.

slender iron
#

was there ever a main?

solar whale
#

so far it appears to be automounting much more reliabley on linux.

#

nevermind - ppushed my luck -- not always automounting, but working fine.

idle owl
#

There was before, but it's since been erased.

#

Lost some new code too, lol. Should have known better.

stuck elbow
#

I try to never edit the code on the board.

#

Always edit it in the repo on my disk first, and copy over.

#

Unless it's some trivial experiments, of course

idle owl
#

Yeah I'm usually better about it. But I get complacent over time, and every so often, lose something. Then I'm on it for a while again, repeat.

solar whale
#

I have learned never to assume any system will come back after a reboot ... too many times

#

I haven't learned to proofread my typing....

#

@idle owl waht is the issue you are testing?

idle owl
#

@solar whale USB stability. It just also erased my board in the meantime.

solar whale
#

😦 any particular scenario you want me to try to reproduce?

idle owl
#

I was just ejecting and then pressing the reset button repeatedly. πŸ˜„

slender iron
#

thats why I'm wondering where a main.py would have come from

#

I'm giving up for now

idle owl
#

I had one on there at the start.

#

Then after doing all the resetting, it erased at some point.

#

Then I added another one.

#

But there was error status lights when Finder said the board was empty

solar whale
#

Is teh issue only on windows machines ?

idle owl
#

Mac.

#

Windows it shows up as 2 unnamed drives. Or not at all. For me anyway

solar whale
#

one eject reset cycle OK on my Mac

slender iron
#

I need a medieval break from usb

idle owl
#

@slender iron Sound reasoning, good sir.

slender iron
#

πŸ˜ƒ

idle owl
#

πŸ˜‰

solar whale
#

@slender iron at least the FS is respnding well to overfilling now. Thanks!

slender iron
#

if its ever been solid on usb it'd be good to know what commits it is

solar whale
#

both have worked for me - now using Adafruit CircuitPython v1.9.3-1401-g971bd7e9a-dirty on 2017-11-08; Metro M4 Express with samd51j19

#

I had some funky USB issues last night --- dropped connections and the FS issues - None so far this evening.

slender iron
solar whale
#

is it hte align_usb branch?

slender iron
#

yeah

solar whale
#

thanks

slender iron
#

no problem!

solar whale
#

@slender iron is the cache enbale or disabled with the setting to 1?

slender iron
#

disabled I believe @solar whale

solar whale
#

OK - not intuitive πŸ˜‰

slender iron
#

agreed

#

disabled = true

#

is how it should read

solar whale
#

I guess its a "disable" flag, not an "enable" flag - sigh...

slender iron
#

ya

#

there is a note about it in the errata too

solar whale
#

OK thanks - will take a look ...

slender iron
#

thanks!

royal ridge
#

Is upgrading circuit python to 2.10 going to wipe flash on CPX?

idle owl
#

It shouldn't, but it's always good to backup your code.

manic glacierBOT
royal ridge
#

Hrm. also, the install section directs to 2.0... should it direct to 2.1?

idle owl
#

Can you post the link please?

royal ridge
tidal kiln
#

@royal ridge weird. that link shows 2.1 for me.

slender iron
#

@royal ridge I fixed the download uf2 link

royal ridge
#

I ❀ you @slender iron

slender iron
#

πŸ˜ƒ

#

its an easy fix

idle owl
#

Thank you @slender iron

tidal kiln
#

well. if it's fixed, it's fixed. nvmd.

manic glacierBOT
solar whale
#

@slender iron Do you have a link to the schematic for the Metro_M4 board?

slender iron
#

@solar whale its not public yet but I have a copy

solar whale
#

ah - ok - just curious

slender iron
#

do you have a specific question?

solar whale
#

After reading the errata, I was wondering if there was an exteranl pullup on the RESET - I see one on the Metro_M0 so I assume it is on the M4.

#

my board is under my metrowing - so I can't look at it πŸ˜‰

slender iron
#

yeah, I think they added it in a new rev

#

it should be on your rev

solar whale
#

thanks - I'll verify next time I take the wing off.

slender iron
#

πŸ˜ƒ

solar whale
#

ugh - forgot how small the traces are - I'll take your word for it!

#

really enjoying the RAM on the M4 - I't's great to be able to use the OLED display and be able to runs sensors at the same time! the Metrowing has been a great tool for plugging in boars to test.

slender iron
#

yeah, I think the hardware errata is dealt with

#

we may be able to increase the heap size too

idle owl
#

Science cannot move forward without heaps!

solar whale
#

I have a test ruunnig with 2 Temp sensors displaying temperatures and gc.mem_free on the OLED - it cycles from > 114K down to 15K as it runs

slender iron
#

πŸ˜ƒ

drowsy geyser
#

FYI, I just built new firmware and flashed the M4. Still can't get to the REPL and no mass storage mount.

slender iron
#

@drowsy geyser from master? did you see my branch go by?

drowsy geyser
#

Yessir, from Master. I did not see your branch (sorry). Been in a conference all day.

#

Just got home and tried the build... πŸ˜ƒ

slender iron
drowsy geyser
#

Ahhh, thank you, Scott!

slender iron
#

np

tidal kiln
#

@slender iron just fyi, i closed ads1x15 issue

slender iron
#

thanks @tidal kiln !

tulip sleet
#

@slender iron should I try latest from align_usb branch on Windows?

slender iron
#

if you like, I still don't think its fixed

#

been just getting frustrated with it

#

gonna make this trip a vacation from usb

idle owl
#

Understandably.

tulip sleet
#

that's a great idea. The only reason I submitted the PR this morning was to get Windows working again. Maybe if we just take that for now? and you can come back refreshed

slender iron
#

yup, thats fine with me

#

feel free to have other folks give you reviews while I'm travelling

tulip sleet
#

maybe I will add the alignment fixes to that PR, since those are clearly issues, and then leave it at that. I plan to work on the other busio stuff, and that doesn't need merging soon at all. I am ordering a some breakouts for the other protocols to test (e.g. OneWire.) Anything urgent that comes up I will get someone to test and review

slender iron
#

kk, sounds good

tulip sleet
#

Go eat dinner and pack and relax before your fliight tomw

slender iron
#

πŸ˜ƒ I have chores to do. my mom is staying at our house so I have to do some cleaning. πŸ˜ƒ

idle owl
#

Kitties will have a friend though!

tulip sleet
#

catsitter

slender iron
#

yup yup, and they get to stay home

#

my mom gets a seattle vacation

idle owl
#

Works out all around

tulip sleet
#

I had a lot of coding epiphanies while driving home an hour from Palo Alto to Berkeley instead of being poised over the keyboard. And then I did something else entirely, cause I couldn't work from hoem.

idle owl
#

Those are great!

slender iron
#

yup yup, hopefully I'll figure out all the bugs in NC

#

thanks all!

tulip sleet
#

actually I hope you forget about it for days or at least hours at a time. bye - happy travels!

idle owl
#

I agree with Dan! Have a wonderful time!

slender iron
#

thanks all!

solar whale
#

@slender iron have a great trip !

umbral dagger
#

Loking ahead to the weekend my goal will be to get a rudimentary debugger running on ATSAMD CP (I was experimenting in the Unix port).

idle owl
#

@umbral dagger Nice!

manic glacierBOT
idle owl
#

@tulip sleet I've had the M4 serial connection up, the rainbow animation main.py running a ring and a strip, and main.py open in Atom since before the live streams and they're all still running smoothly. I don't think it made it this long earlier.

#

I'm going to leave it overnight.

pastel panther
#

@idle owl You were having mac problems with the m4, right? Is there something that I should/could test on mine?

idle owl
#

@pastel panther I was ejecting it and pressing the reset button. Repeatedly. Eventually it won't mount, or in a couple of cases, erased the board. A couple of days ago I managed to corrupt it bad enough that it would only show up as NO_NAME - that took the JLink to recover from. But the issues I had earlier were simply from ejecting and resetting. Finder would freeze completely and I would have to physically remove the plug to get everything to work again.

manic glacierBOT
idle owl
#

Then about half the time, when I plugged it back in, it would take resetting 10 times to get the drive to mount.

pastel panther
#

How fast were you reseting? LIke 1hz or so?

idle owl
#

The build I have on there now seems to be much more stable than it was earlier.

pastel panther
#

Is that the build from Scott's fork

idle owl
#

I waited until CIRCUITPY disappeared from Finder before resetting. To give it more of a fighting chance, I would give it a couple of seconds after that for some of the testing.

#

Yeah, he sent it to me, so it's from his repo.

#

I don't know what's been committed to master since.

pastel panther
#

Ok, I'll test it out after I'm done tearing down this TV (yay dumpster gold!)

tulip sleet
#

the commit above is on master and rolls things back a bit so that Windows is usable again, and also includes one obvious fix. When Scott gets back we can try some more stuff.

idle owl
#

Ah ok.

#

I have whatever Scott's last test was on my M4 at the moment.

tulip sleet
#

I wanted to test Scott's latest on Windows but my test Windows box was tied up with an update. Will try again in a a few minutes.

idle owl
#

Ooh! Shows up on Windows 10 USB2 and USB3, immediately.

tulip sleet
#

that's good - I'll be back in a minute after rebooting this machine, which also has windows

idle owl
#

I need to head out. Goodnight!

tulip sleet
#

gn

#

align_usb branch is ok too.

#

<@&356864093652516868> if you wish, try the latest adafruit/circuitpython master, and also https://github.com/tannewt/circuitpython, branch align_usb. Let me know if one seems better than the other and I'll make that one be on master for the next days. @drowsy geyser both seem OK on Windows for now, but only lightly tested

#

the odd v1.9.3 version you see on the align_usb version is just due to merging from micropython. The version uses the latest tag available. I retagged in master so it's back to 3.0.0-alpha.something

drowsy geyser
#

@tulip sleet Maybe I'm doing something wrong (likely), but I did a git pull git submodule update --init --recursive and flashed the new firmware (I did see your new usb module go in). I'm not seeing any behavior change.

#

So Master is still not working for me.

#

Do I need to delete and re-clone the repo?

solar whale
drowsy geyser
#

@solar whale I haven't been able to get it to build. I get tons of errors on make. I'm pretty sure I built my source tree wrong, but I haven't gone back and tried to fix it yet. I just did a git clone from that repo, followed by a submodule update. The build environment looks totally differnt.

solar whale
#

ddi you do git checkout align_usb before submodule update and build?

drowsy geyser
#

Um, no. Not that familiar with git yet.

#

Well now, that's a lot of changes. πŸ˜ƒ

solar whale
#
git clone https://github.com/tannewt/circuitpython
cd  circuitpython
git  checkout align_usb
git submodule update --init --recursive
cd mpy-cross
make
cd ../ports/atmel-samd
make BOARD=metro_m4_express clean
make BOARD=metro_m4_express
drowsy geyser
#

Thanks! Added to my OneNote. πŸ˜ƒ

solar whale
#

the alighn_usb branch is just for this test - with mainline repo always checkout master.

drowsy geyser
#

Yup! I built them in separate directories.

solar whale
#

I finally made separate dirs for master, 2_x- it gets really messy switching between 2.x and master since the layout is differnt.

drowsy geyser
#

@solar whale Results: Scott's branch works fine, whereas Master does not. I'm assuming someone will do a merge at some point to get Scott's changes back into Master?

solar whale
#

yes @tulip sleet is collecting input - please update him. Great news!

drowsy geyser
#

Ok, will do, @solar whale . Thank you again for helping with my newbie build problem!

solar whale
#

Glad to help but somehow newbie seems a bit misplaced for you!

drowsy geyser
#

LOL. Newbie to GIt! I have to get up to speed since we use it at work for everything....

solar whale
#

It rminds me of "learning" emacs -- always seems like I'm just scratching the surface!

drowsy geyser
#

Totally with you on that. I'm a dyed in the wool vi guy.

#

Started using it in '85 and it's just ingrained. I can't tell you how many times I've typed ":w" in Word just from muscle memory....

#

Dan updated in DM. Now the question is, "do I sleep before the conference, or solder up a BME280 and see if it works on the M4?"

solar whale
#

My BMP280 works fine!

drowsy geyser
#

Well then, no need to test it. Lessee, what else do I have here?

solar whale
#

you will need to regenerate the .mpys in the libraries you use - moy format changed in master

#

I tried mcp9808 and an OLED ssd1306 - all good

drowsy geyser
#

Hmmm, I have a TSL2561 here. I think someone already did the driver for that....

solar whale
#

the extra RAM is amazing - nice to have room for drivers and code!

#

Its in the bundle now - with the extra RAM you may be able to test with the .py insteasd of the .moy

drowsy geyser
#

Yeah, I can't wait for these to get into production! I really want to use CircuitPython in my rocket flight controller, but the libraries wouldn't fit in it before. πŸ˜ƒ

solar whale
#

THis is the first time I've been able to use an OLED display on CP and still have room for drivers.

drowsy geyser
#

Nice! I definitely want to have the OLED on my systems. I use them a lot!

solar whale
#

neopixels work too! It's great to have all these new features working on the M4 - the update speed for the neopixels is great!

drowsy geyser
#

I have a pile of stuff I need to solder up and there's a NeoPixel ring in the queue. I definitely want to try it on the M4!

solar whale
#

I have done a few tests with a 16 pixel ring and it is very nice - the "color wheel" demo I have been using takes 16 secs to go areound the loop on the M0 - about 6 on the M4!

drowsy geyser
#

Wow! That's a significant improvement!

tulip sleet
#

@drowsy geyser I got your results. Could you do do git log in your adafruit/circuitpython repo? It should look like this:

commit b82cfcb064e7a01548abcde5983b6d4be6fd9e9c (HEAD -> master, upstream/master)
Merge: b4fc464a4 0e6928b08
Author: Dan Halbert <halbert@halwitz.org>
Date:   Wed Nov 8 23:38:13 2017 -0500

    Merge pull request #424 from dhalbert/revert_182a946_msc
    
    Revert "atmel-samd: Tweak mass storage code to finish read sooner."

commit 0e6928b087805f95520de34647d2836278fcdbf9 (tag: 3.0.0-alpha2, tag: 3.0.0-alpha.1, origin/revert_182a946_msc, revert_182a946_msc)
Author: Scott Shawcroft <scott.shawcroft@gmail.com>
Date:   Wed Nov 8 10:47:22 2017 -0800

    atmel-samd: Align SCSI responses.

commit bfe7e055e9b1dac0411fe975fdf2412029f03b33
Author: Dan Halbert <halbert@halwitz.org>
Date:   Wed Nov 8 11:17:10 2017 -0500

    Revert "atmel-samd: Tweak mass storage code to finish read sooner."
    
    This reverts commit 182a946b0ef12f6f031e846af788cdeb2eecd3a6.
drowsy geyser
#

@tulip sleet That's is what it looks like word for word. I can paste it here if you like... (Sorry it took so long to respond; I was fussing with some sensors and didn't notice the message)

opaque patrol
#

Its quiet today....is it like this every thursday?

tulip sleet
#

@opaque patrol in the morning it's usually quiet

#

@drowsy geyser ok, I'll bring align_usb into master today. I tried the master HEAD on Win10 last night, and it seemed to work OK, but there may be other issues.

tidal kiln
#

@tulip sleet for testing non-master branches, do we need to have the ability to build locally?

manic glacierBOT
tulip sleet
#

@tidal kiln It looks like the pull request builds aren't saved, so yes, you need to be able to build locally. Do you have a setup or do you need a recipe? If the latter, what OS's do you have available?

tidal kiln
#

@tulip sleet thanks. no don't have a setup yet, but was planning on doing that here at some point. i'm on linux, so should be pretty easy. i did build mpy-cross, but that was just a matter of cloning the repo and running make.

tulip sleet
#

@tidal kiln

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded python build-essential
git clone https://github.com/adafruit/circuitpython.git
cd circuitpython/
git submodule update --init --recursive
cd ports/atmel-samd/
make clean BOARD=metro_m4_express ; make BOARD=metro_m4_express    # or whichever you want

For Scott's repo and this branch:

git clone https://github.com/tannewt/circuitpython.git tannewt-circuitpython # or wherever you want it
cd tannewt-circuitpython
git checkout align_usb          # get to the right branch
git submodule update --init --recursive
[ same as above]
tidal kiln
#

sweet. thanks. why the need for adding the ppa?

tulip sleet
#

to get the arm gcc compiler, and keep it up to date. Better source than downloading manually from ARM.

tidal kiln
#

and the git submodule step just brings in latest of all the submodules, which aren't really part of the main repo?

tulip sleet
#

right - they are in separate repos. For instance, we put asf4 in a separate repo since it might be shared with other projects, and we might want different snapshots of it depending on the progress of a particular port.

tidal kiln
#

neat. pretty straight forward. and the non-main branches are being held in personal repos? that's why the second one comes from scott's?

tulip sleet
#

we do development and bug fixes in our private repos so we don't clutter up the main repo with temporary branches or mess it up by accident. When we're ready for something, we submit a PR and ask for a sanity-check review.

#

you have to set up your private repo with adafruit/circuitpython as a remote so you can re-sync as necessary. It takes a bit of time to learn the worflow

tidal kiln
#

gotcha. are the ones in the s3 bucket basically the same as what i'd get from the first recipe?

tulip sleet
#

Yes, they're the same

#

since they're built in travis by cloning adafruit/circuitpython and doing the build pretty much the same way you would

tidal kiln
#

so really only need to build for testing latest from the private / in-work repos, otherwise just grab from s3

tulip sleet
#

yeah, though you have to make sure you have the right commit. Since I'm debugging all the time, I don't bother with the aws repos.

tidal kiln
#

cool. just got a successful build from first recipe.

tulip sleet
#

great! if you have a multi-core processor, you can try make -j4 or however many cores you have. It will speed things up somewhat.

#

right now a build takes me about 45 seconds for 3.0. 2.x is more like 20-30 secs

idle owl
#

@tulip sleet M4 still connected to serial, still running main.py still able to interact with files using Atom, still mounted in finder and not frozen. This is from last night.

tidal kiln
#

yeah. that's about what it looked like. i got a x4 core, so will try that next. i'm going to see if i can build scott's branch...

tulip sleet
#

@idle owl thanks! and that's align_usb, right? I am probably going to bring master up to date with that

idle owl
#

How can I tell for sure? I'm pretty sure, yes, but I'd rather be certain.

#

It hasn't lasted overnight connected like this in days. This is a huge improvement.

tulip sleet
#

what's the git id that's shown in the initial prompt in the repl -g<something>

idle owl
#

Adafruit CircuitPython v1.9.3-1401-g971bd7e9a-dirty

tulip sleet
idle owl
#

I am using the last thing Scott posted to me last night. I don't have his repo built locally yet so I can't build it myself.

#

Do you want me to test the current commit?

tulip sleet
#

could you clone his repo and build? see recipe I gave cater above. thanks. I'm not sure about the ef9a87f2 commit. I thought it wasn't working well on Windows, but @drowsy geyser said it worked for him

idle owl
#

This commit worked perfectly on Windows for me yesterday. I'll test the current one. (Might still need help, but I'll try the recipe first.)

#

Only the second thing you sent right? Because I would already have ppa from cloning the master repo?

tidal kiln
#

yep

idle owl
#

Thank you

tidal kiln
#

wait

#

have you done the first recipe before?

tulip sleet
#

you just enable the ppa and load the arm gcc stuff once. It gets installed in /usr/bin, etc. It's not related to the repo

tidal kiln
#

you don't need to reinstall the tool chain, but that's not part of the repo

tulip sleet
#

great minds think alike

tidal kiln
#

boom. got a build of scott's repo.

idle owl
#

I can already build firmware in the circuitpython/ repo... I assume I've done the first recipe before. It was over that weekend when I got the M4, so ... been long enough that I wasn't sure. But realised you hadn't built anything yet, so that's why I verified.

#

@tulip sleet Why make clean and not make BOARD=etc clean ? I've been running it with the board in the command every time.

tidal kiln
#

do both. clean just deletes everything so you're starting from a known ground zero state.

idle owl
#

Ah.

tulip sleet
#

you're right, that's a bug, you have to specify the BOARD for both

#

I edited the recipe above

idle owl
#

make clean removed build-metro_m0_express heh

#

Ok

tulip sleet
#

make clean without a BOARD spec uses the default board.

tidal kiln
#

thanks. was just about to look in makefile...

idle owl
#

Another question, DEBUG or no?

#

I've been making them with debug.

tulip sleet
#

if you want to use jlink to look inside and set breakpoints, etc. then DEBUG. Otherwise don't bother, because it's a better test of what will be shipped

idle owl
#

Ok, sounds good. I'll do it without.

tulip sleet
#

DEBUG adds some additional info to the compiled program to make life easier for the debugger. In some cases it also changes the optimization level

idle owl
#

Makes sense.

tulip sleet
#

compiling without optimization makes debugging easier because the code doesn't get reordered, variables don't get optimized away, etc. But then the code is slower and larger. For M0, it's usually too big to fit in flash

idle owl
#

So not a problem here. But it's not an accurate test either.

tidal kiln
#

here's what i get from scott's build:

Adafruit CircuitPython v1.9.3-1402-gef9a7f2 on 2017-11-09; Metro M4 Express with samd51j19
>>> 
#

(or more specifically, my build of scott's latest)

tulip sleet
#

there can be issues @tidal kiln that's good, that's the latest commit on that branch

tidal kiln
#

neat. thanks for getting me running on this.

tulip sleet
#

yw

tidal kiln
#

knowing about that ppa probably would've been half a day of googling

tulip sleet
#

it's confusing; the ppa has gone through several incarnations

idle owl
#

Alright. Loaded, mounted immediately, main.py running smoothly. Adafruit CircuitPython v1.9.3-1402-gef9a7f262 on 2017-11-09; Metro M4 Express with samd51j19

tidal kiln
#

weird. slightly more verbose?

idle owl
#

I have 2 more digits in the build number.

tidal kiln
#

yeah

idle owl
#

Hmm, I closed the window while in the REPL, and now it's acting like it's still connected to the REPL (white onboard LED, main.py not running). I can't reestablish a serial connection.

tulip sleet
#

that string is generated by a git command: git describe --dirty --always --tags

idle owl
#

Eject, reset with button, running smoothly again.

#

Bug or feature?

tidal kiln
#

so some OS build environment dependency?

idle owl
#

I might have something in .bashrc that's altering my default git stuff. A friend of mine magicked it up for me with some git magic, could be that. Don't know if that would affect it.

tulip sleet
#

could be a bug; is that different from the build you tested overnight? If so add a comment to the PR

#

git --version

idle owl
#

git version 2.14.3

tidal kiln
#

git version 2.7.4

idle owl
#

@tulip sleet I don't know if I tried this exact sequence with the other build. But it's consistently repro'd.

#

Can you link the correct PR please. I had it up yesterday but I don't think I do anymore

tulip sleet
#

try it with the other one, becuase the new commit might have broken something

idle owl
#

Ok. Be a minute.

tulip sleet
#

@tidal kiln I think it was lengthened in later versions: git describe --dirty --always --tags gives me v1.9.3-1402-gef9a7f262

idle owl
#

Same thing.

tulip sleet
#

ok, so not a very new problem

idle owl
#

I have three more of Scott's builds from yesterday, I'll try those as well

tulip sleet
#

back in a few mins

tidal kiln
#

@tulip sleet yep. that's it. i get:

v1.9.3-1402-gef9a7f2
idle owl
#

Same in the third one too.

#

If it's unrelated to the current PR, should I file an issue instead of commenting on the PR?

#

The third one froze everything too, so there's still a marked improvement over Scott's earlier commits.

tidal kiln
#

how do you get it to freeze? closing while in REPL?

idle owl
#

No, on the earlier commit as soon as I try to interact with CIRCUITPY by clicking on it or attempting to eject it, Finder freezes until I physically remove the M4 from USB.

tidal kiln
#

so this v1.9.3-1402-gef9a7f262 build shouldn't have an issue?

idle owl
#

Correct. I tried ejecting and resetting a bunch before leaving it over night, and it didn't freeze while actively testing it, and it was still connected successfully when I checked today.

tidal kiln
#

ah. so i'm late to game and only confirming it's fixed?

idle owl
#

Oh! lol. Yes πŸ˜„

tidal kiln
#

cause it seems to be running fine

idle owl
#

This build should be working across the board, Linux/Mac/Windows, USB2/3, REPL connect/disconnect, physical power off/onboard reset button.

#

Theoretically πŸ˜„

tidal kiln
#

problem shows up in current main build though? i'm seeing Dan's comment:
"Let me know if one seems better than the other and I'll make that one be on master for the next days"

idle owl
#

Yeah. Master is failing quite a few things.

tidal kiln
#

ok. let me try that.

idle owl
#

Even with Scott's last 4 commits, at least for me, the current one was the only one without issues. I can post the ones Scott posted yesterday if you want to test those too. (I definitely don't know how to build from different commits.)

tidal kiln
#

does it matter? or is the only concern comparing scott's latest to current master?

idle owl
#

I don't know. I think they wanted to test the few changes Scott made to each other because each of them had one tweak related to stability. I'm not sure though. @tulip sleet Should @tidal kiln test each of Scott's builds from yesterday or just master vs current build?

tidal kiln
#

ok. i'm on current master/g. seems to work ok. got a recipe to break it?

idle owl
#

Hmm. For me it was interacting with it by editing my main.py in Atom (it froze Atom pretty consistently) and in the file explorer. Ejecting and reset using onboard reset usually made it pretty unhappy pretty quickly.

#

By trying to open it or eject it from the file explorer, it would freeze Finder and required physical removal to get it back. Reset using the onboard reset button instead of powering off caused issues.

tidal kiln
#

k. let me try changing blink rate in atom...

idle owl
#

Wouldn't even mount to Windows at all. Showed up as 2 unnamed and untouchable drives.

tidal kiln
#

working. for ref, i'm running:

Adafruit CircuitPython 3.0.0-alpha.0-1157-gb82cfcb on 2017-11-09; Metro M4 Express with samd51j19
>>> 
idle owl
#

I don't know how anyone got it to break on Linux. I updated my Linux machine but haven't set it up for testing yet. I know Dan uses it and he was having issues. I don't know what he did to get them though.

tidal kiln
#

hmmm. ok. will keep punching on it and see if anything odd happens...

#

discord apparently accepts sed find and replace commands....THIS IS A CARROT

#

neat

tulip sleet
#

back: so I'm not sure, you're saying the latest on align_usb is the most stable? I did the rollback after a lot of testing on Windows becuase Hukuzutuna said it was broken. As for the REPL bug, yes, a separate issue would be good.

tidal kiln
#

@tulip sleet for me, not seeing an issue with either

tulip sleet
#

on Windows or Linux

#

?

tidal kiln
#

linux

tulip sleet
#

yes, linux has been fine. It was Windows that was wonky

tidal kiln
#

:tell_me_something_i_dont_know_emoji:

tulip sleet
#

i'll try both master and align_usb on windows myself. just haven't had time to repeat the experiments. I have slow spare windows box that was updating late last night

idle owl
#

For me, align_usb has been the most stable. Carter and I were just figuring out what he should be testing.

tidal kiln
#

@tulip sleet on another note, how about this behavior, i mentioned it before, not sure if it got noticed:

Adafruit CircuitPython 3.0.0-alpha.0-1157-gb82cfcb on 2017-11-09; Metro M4 Express with samd51j19
>>> import time
>>> t1 = time.monotonic(); time.sleep(0.1); t2 = time.monotonic(); t2-t1
0.0991211
>>> t1 = time.monotonic(); time.sleep(0.01); t2 = time.monotonic(); t2-t1
0.00878906
>>> t1 = time.monotonic(); time.sleep(0.001); t2 = time.monotonic(); t2-t1
0.0
>>> 
#

curious about both the accuracy and the apparent lower limit

tulip sleet
#

@tidal kiln each time.monotonic tick is a millisecond. But that's just our implementation - there's no guarantee

#

that it's any particular unit

tidal kiln
#

is there something higher resolution?

tulip sleet
#

time.sleep also uses msec ticks to count, but hold on a sec ...

#

you can use microcontroller.delay_us(n), but that does a busy-wait loop, I think. Still looking at the code

#

yes, it's true

tidal kiln
#

meaning it blocks?

tulip sleet
#

it's just a assembly loop, but it doesn't seem to disable interrupts, I think. The actual routine is about six calls deep.

#

this is in 2.x. Not sure what is in 3.x (if anything yet).

#

do you need accurate timing for a driver?

#

the time to execute a single python statement could be significant and swamp any delay you insert

tidal kiln
#

not yet

#

ran into the behavior porting some arduino code that had a delay(1) in it. turned that into time.sleep(0.001) but got no delay.

tulip sleet
#

that will actually call the millisecond sleep routine with an argument of 1

tidal kiln
#

ok. then why 0?

tulip sleet
#

no, wait, it could truncate, because it does 1000*0.01, and that gets cast to an int, so if it's less than 1.0, it will truncate to 0.

tidal kiln
#

but 1000*0.001=1.0, so why does it trunc?

tulip sleet
#
4.76837e-07
#

it's slightly less than one: difference is >0

#

you could file an issue saying it should round, not truncate

tidal kiln
#

int(round()) instead of int() ?

tulip sleet
#

an implicit cast happens, it looks liek

tidal kiln
#

from 1000 * mp_obj_t -> uint32_t

tulip sleet
#

not mp_obj_t: it gets a float: mp_obj_get_float(seconds_o);

tidal kiln
#

pfft. i was right the first time.

#

so then uint32_t(slightly less than 1) becomes 0

tulip sleet
#

the bottom two bits of the 32-bits indicate whether the value is a pointer, an integer, or a float. we only have 30-bit floats, not 32 bits. ...

#

right

#

sad but true

tidal kiln
#

bug or feature?

#

(sounds like later)

tulip sleet
#

probably a bug; I don't know what other impls do (e.g. the original utime)

tidal kiln
#

if you think bug, i can post an issue, and just use that original example i showed

tulip sleet
#

so time.sleep(0.006) should sleep for a millisecond? or not sleep at all?

#

Go ahead and file an issue.

tidal kiln
#

should sleep for 6 milliseconds

#

and if not, time.sleep() documentation should specify lower usable limit

tulip sleet
#

sorry missed a zero: so time.sleep(0.0006) should sleep for a millisecond? or not sleep at all?

tidal kiln
#

good question

tulip sleet
#

there was a change in 3.5 to make it sleep at least as long as requested, not shorter in case of interrupt

tidal kiln
#

hmmm. but they make no mention of low end behavior. should it rail to the lower limit (like 1ms) or should it drop to zero?

#
Python 3.5.2 (default, Sep 14 2017, 22:51:06) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.time()
1510257853.390322
>>> t1 = time.time(); time.sleep(0.1); t2 = time.time(); t2-t1
0.10014939308166504
>>> t1 = time.time(); time.sleep(0.01); t2 = time.time(); t2-t1
0.010099411010742188
>>> t1 = time.time(); time.sleep(0.001); t2 = time.time(); t2-t1
0.0010828971862792969
>>> t1 = time.time(); time.sleep(0.000001); t2 = time.time(); t2-t1
7.939338684082031e-05
tulip sleet
#

micropython utime has sleep(), sleep_ms(), sleep_us(). since some micropythons don't have float, they needed to supply integer args for shorter times. Scott made decision to always have float and to have our libraries more like CPython.

tidal kiln
#

probably not much of an issue in CPython land.

#

just MCU fun

#

i'll post the issue so it can at least be documented and discussed

#

in the arduino code i was porting, the delay(1) was in a very tight/fast loop, so the total expected delay would be approx NSTEPS * 1ms

tulip sleet
#

I looked at the MicroPython impl - it's the same, so the truncation has always been there

tidal kiln
#

which worked there, but in the CP port it became NSTEPS * 0

#

that's probably a more likely scenario than a tight timing requirement in a driver

#

and if that does come up in a driver, time to move to c?

tulip sleet
#

well, the low-level neopixel code is in C. You could use microcontroller.delay(us), but again, it might get swamped. I wrote a Char LCD driver that has lots of sub-millisecond delays, cause I didn't know how accurate I had to be. I guess those all went to zero, but it still works.

manic glacierBOT
#

This shows the behavior which occurs near max resolution:

Adafruit CircuitPython 3.0.0-alpha.0-1157-gb82cfcb on 2017-11-09; Metro M4 Express with samd51j19
>>> import time
>>> t1 = time.monotonic(); time.sleep(0.1); t2 = time.monotonic(); t2-t1
0.0991211
>>> t1 = time.monotonic(); time.sleep(0.01); t2 = time.monotonic(); t2-t1
0.00878906
>>> t1 = time.monotonic(); time.sleep(0.001); t2 = time.monotonic(); t2-t1
0.0
>>> 

And some key bits of code are here:
https://gi...

tidal kiln
#

^ fwiw

manic glacierBOT
idle owl
#

3.0 issues are still posted to adafruit/circuitpython/issues right?

tulip sleet
#

@idle owl right, though you might preface the title with "3.0:" if it only affects 3.0, and set the milestone to 3.0beta. Somtimes I do a double-take on an issue that turned out to be 3.0-only.

idle owl
#

No problem.

manic glacierBOT
tulip sleet
#

@idle owl @tidal kiln @solar whale @drowsy geyser align_usb from tannewt/circuitpython is now on master on adafruit/circuitpython

idle owl
#

@tulip sleet Thanks!

solar whale
#

@tulip sleet will download and test tomorrow. Thanks!

tulip sleet
#

@timber lion there are a bunch of CPy libraries that need new releases, especially since @fading solstice 's fix for read_into->readinto. I'm unsure of the workflow for libraries that are already wired into travis: should I just create a release that creates its own new tag and the .mpy will be created automatically, or do I need to push a new release tag first?

timber lion
#

oh just make a new release in github's releases tab and travis will do the rest

#

as long as the library was setup on travis' side with the GITHUB_TOKEN variable

#

most are, if you see releases with a .mpy then they're good to go

#

one thing though what's the story for people on older versions of bus device? they'll get a failure too unfortunately

#

something you might consider, keep the old read_into working and have it print a deprecation message

#

it can just call readinto internally

#

that's a good way in general to make breaking API changes I think

tulip sleet
idle owl
#

So, I figured out the problem. If I do a screen -ls after closing the terminal window, there will still be a session running. If I then explicitly terminate that session, I can reestablish the serial connection with the board and when it connects it's still in the REPL. At that point, I can ctrl D and reload the serial connection and it successfully exits the REPL and returns to running main.py. So it leaves the board in the state it was in (ie. connected to the REPL). I don't know if it's an issue with screen, or how it handles the serial connection. I'm thinking it's not necessarily an issue with CircuitPython.

idle owl
#

@tulip sleet Should I still file an issue, include the solution and close it? I don't think it's necessarily a CircuitPython issue, but I can't imagine I'm the only one who has ever run into it. Could be though πŸ˜„

tulip sleet
#

@idle owl That sounds like it's working as desired! screen lets you suspend and resume sessions - that's actually the original inspiration for it. I don't use -ls, so I haven't tried resuming.

idle owl
#

@tulip sleet Ok, noted. I had to look up -ls. I've never used screen for anything except establishing the serial connection.

#

I was able to use screen -x or -r or something like that to reestablish the original connection successfully.

tulip sleet
#

so using -ls is new for you? I'm forgetting what the original problem was.

idle owl
#

The original problem was that if I closed the terminal window while connected to the REPL the board continued to act like it was connected to the REPL and I couldn't reestablish the serial connection using the original screen connection command.

#

So I was trying to figure out why and with help found out that it hadn't terminated the screen connection, and it could be reestablished.

tulip sleet
#

if you close the terminal window and do ps -ef, do you still see screen running? I think it may try to survive that. actually I can try that myself.

idle owl
#

And if you use screen -X -S <session number> quit to terminate the session, the board still stays in the REPL. But you can then reestablish the screen connection using screen /dev/tty.usbmodemXXXXX 115200, and it pops directly back to the REPL.

#

Alternately, you can eject the board from finder, do a reset with the onboard button, and it will return to it's base main.py-running state.

#

Checking ps -ef now

tulip sleet
#

I don't see screen still running. But I almost never close the terminal while screen is running. I do ctrl-A backslash and answer "yes" to close the session

#

it's muscle memory now, but it was kind of annoying to begin with

idle owl
#

I was mounting the board, verifying screen would connect, verifying the REPL, then closing the window, ejecting, and resetting the board. Repeat. For testing USB stability. I happened to notice that if I left it in the REPL, the board remained in the REPL state.

#

My workaround to get main.py running again was to hard reset the board once more.

tulip sleet
#

in that case I can get back in easily. So there's something odd that happens when you kill screen by closing the terminal instead of exiting gracefully.

idle owl
#

Yeah.

tulip sleet
#

So do the ctrl-A \ thing instead and you can go in and out of the REPL without any resetting.

idle owl
#

I either need to hard reset, or find the screen session and reconnect, or terminate and reestablish.

tulip sleet
#

well just try what I said now, if you want, it should work

#

screen ... <type at the repl>. Type ctrl-A, which is the way to get screen to listen to commands. Then \ to close the connection

#

it will ask you if you really want to quit, and say yes

idle owl
#

So from inside the REPL do what you said?

tulip sleet
#

yes, type ctrl-A. That's NOT read by the REPL. instead screen intercepts it and expects you to type a single-chracter command. YOu can type ? to get a list of all the screen commands

idle owl
#

Hmm.

tulip sleet
#

did it work?

idle owl
#

No...

tulip sleet
#

are you in the repl?

idle owl
#

I was. I just reloaded the serial connection to try again.

tulip sleet
#

oh, on the mac, maybe it's cmd-A

idle owl
#

It's not, terminal accepts ctrl for terminal commands, cmd-A selects all.

#

Ahhhhhh

#

I had to keep ctrl held down, and I had to type A \ quickly

#

I wasn't doing that.

tulip sleet
#

so type ctrl-A once, then type ? by itself. you don't have to type quickly. hold down ctrl, press a, release ctrl, press ?

idle owl
#

Board stays in REPL state, but I can reestablish the serial connection successfully afterwards.

tulip sleet
#

did you see the screen menu of all the commands?

idle owl
#

Yeah it worked that time. I don't know what was going on before then.

#

But if I wait after hitting ctrl-A to type , it doesn't respond.

#

I have to do ctrl+a+\ altogether it seems like.

#

Or as long as I keep ctrl held down, I can type \ a little later and it works.

tulip sleet
#

I started up my mac. It's different quit is ctrl-, not plain \ so ctrl-A ctrl-\ then press y to answer the question

#

it's different between linux and mac

idle owl
#

Ah ok.

tulip sleet
#

weird that it would be different

#

but it is

idle owl
#

That makes a little more sense. I see. I can pause between them and then hit ctrl+\ and it worked.

tulip sleet
#

but if you move to linux you will have to remember it's different: annoying but I guess as annoying as ctrl-C vs cmd-C

idle owl
#

Yeah, I have alt mapped to cmd on my keyboard hooked up to my mac laptop, and the whole thing is running Synergy with the Windows machine as the server, so I have to remember when I move to a different screen that cmd won't work. Honestly, using terminal regularly which requires all ctrl commands makes it a little less annoying to switch between them because I use control for so much on the mac. But inevitably I'll open "Tools" in some app on Windows at least once before remembering.

tulip sleet
#

I will take leave earlier tonight. kind of burned out last night. gn!

idle owl
#

@tulip sleet Have a good night!

manic glacierBOT
#

This PR adds support for a new single-bank bootloader for the Adafruit nRF52 Feather, and allows SD diversity between S132 v2.0.1 and S132 v5.0.0:

  • The updated bootloaders included in this PR migrate from a dual-bank flash model to single-bank due to space constraints, doubling the amount of flash memory available on the boards.
  • The makefile has been updated to allow bootloader updates over the serial connection using nrfutil (see boards/feather52/README.md).
  • The S132 v2.0.1 or ...
manic glacierBOT
solar whale
#

@tulip sleet pulled, built loaded master and it seems to be wrking fine on metro m4 - handles overfilling FS gracefully.

manic glacierBOT
solar whale
#

@timber lion @tulip sleet hmm - as warned the update to adafruit_bus_device has broken drivers for 3.0 - it was nice to have I2C for awhile - What needs to be done to fix this for 3.0?

#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "oled.py", line 29, in <module>
  File "oled.py", line 18, in <module>
  File "libraries/drivers/bmp280/adafruit_bmp280.py", line 154, in __init__
  File "libraries/drivers/bmp280/adafruit_bmp280.py", line 67, in __init__
  File "libraries/drivers/bmp280/adafruit_bmp280.py", line 138, in _read_byte
  File "libraries/drivers/bmp280/adafruit_bmp280.py", line 163, in _read_register
  File "libraries/drivers/bmp280/adafruit_bmp280.py", line 161, in _read_register
AttributeError: 'I2CDevice' object has no attribute 'readinto'
glad rapids
#

Is it easy to switch a ESP8266 to Circuit Python and back to Arduino ??

solar whale
#

@glad rapids Yes - just reload your sketch via Arduino as normal. - Always fully erase the flash before loading Circuit Python with esptool.

#

@timber lion Why is there a problem with the attribute readinto? Ii is there in I2CDevice.

#

@timber lion @tulip sleet never-mind - I just had to RESET the board - all OK now under 3.0. Sorry for the false alarm.

idle owl
#

That's the best answer though!

solar whale
#

I rebuilt the bundle for 3.0 and copied it over, but I guess a RESET was needed to get everythin propely updated.

idle owl
#

Good to know

solar whale
#

I spent the whole day breaking things so I should have known better. I think I have gotten back to where I started today - Not much progress, but many lessons learned!

idle owl
#

That's always progress

timber lion
#

yeah i've noticed you need to reset the board for it to see file updates sometimes

#

perhaps a bug, not sure if that's by design

#

in general any time i copy over a new file i soft reset

solar whale
#

@tulip sleet Ran into an issue building bundles again ```Deleting existing build.
build-2.1.0/lib/adafruit_register 512
build-2.1.0/lib/adafruit_bus_device 512
build-2.1.0/lib/adafruit_hid 512
build-2.1.0/lib/adafruit_waveform 512
build-2.1.0/lib/adafruit_circuitplayground 512
build-2.1.0/lib/adafruit_pca9685 512
build-2.1.0/lib/adafruit_mpr121 512
build-2.1.0/lib/adafruit_lis3dh 512
build-2.1.0/lib/adafruit_ht16k33 512
build-2.1.0/lib/adafruit_rgb_display 512
build-2.1.0/lib/adafruit_ssd1306 512
build-2.1.0/lib/adafruit_max7219 512
fatal: No names found, cannot describe anything.
Stopping at 'libraries/drivers/ads1x15'; script returned non-zero status.
lib/README.txt 117 512
lib/update_linux.sh 646 1024

cunning crypt
#

@solar whale I often count lessons learned as more progress than actual progress. It often helps more in the long run.

idle owl
#

I have some audio recording code, and every so often it gives me a "length mismatch" that I've narrowed down to mic.record. The mismatch seems to be with the bytearray that's used as the buffer for recording, but I'm not sure why.

#

The code works. It also does the length mismatch every so often.

idle owl
#

It's set to 160 in the code, initially using math and a variable, but I changed it to the number. Changing the bytearray to 200 like in the example PDMIn code causes it to crash to safemode. Changing it to 180 causes a spammed constant length mismatch vs the every so many seconds length mismatch.

manic glacierBOT
umbral dagger
#

@idle owl I think I recall you mentioning a guide to writitng CP libraries... I looked around but came up empty.

idle owl
#

@umbral dagger Yes! Let me find it.

umbral dagger
#

Thanks. not an official library at the moment, but I want to make it easy/familiar to use.

tulip sleet
#

@solar whale that library doesn't have travis integration yet. Glad it doesn't break the whole bundle. Thanks. EDIT LATER: now it is itegrated with travis.

vague monolith
#

@umbral dagger A library for?

umbral dagger
#

@vague monolith The dotstar featherwing. I'll be postiing on my blog very soon.

vague monolith
#

Ahh cool

umbral dagger
#

I debated whether to publish this so soon after last night's post, but I've been working on it for a while and want to empty the queue. So here it is. https://daveastels.com/2017/11/11/using-the-adafruit-dotstar-featherwing-with-circuitpython/

idle owl
#

The length mismatch is an error written into CircuitPython, it's part of audiobusio. I still can't figure out why I'm getting it.

idle owl
#

The next question is.... why is the exact same code not working on my other CPX. Still get the length mismatch every so often but I get no lights. LEDs work, I tested putting a pixels.fill in the code elsewhere and it worked. Mic works, I tested it with other recording code and it played back the recorded sample.

#

I didn't see how the length mismatch issue could have been hardware related, but at this point I was willing to try it anyway, and instead found out the code doesn't work on the second one. πŸ˜„

cunning crypt
#

Probably-obvious question: If I set up a Neopixel string with, say, 10 pixels and run code on it but with only one actual neopixel, it'll still work, right?

idle owl
#

Yeah. If it's an animation it just takes longer to get back to 1 if you make it with more than are present.

cunning crypt
#

IE, I set up something to flash each of the 10 pixels on a CPX, and then put that code on a Feather M0 Express, it'll still "Work"

idle owl
#

So if I have a strip that I'm running a rainbow on and double the LED number in init, it only shows half the rainbow at a time.

cunning crypt
#

Yep

#

So, question: Poking around lately, it seems that, effectively, all of the Circuit Python examples for hardware exist. Considering A) I don't want to make two copies of the same thing and B) The CP repo is, well, software, I've been thinking of shifting the focus of the repo's examples from hardware stuff to software stuff. Particularly things like the differences between Arduino code and CP code.

#

Do you guys think this is a good way to do it, or should I keep my original idea of more hardware-based examples?

idle owl
#

The real answer is you do what most interests you. But I agree that duplicating things if that's not your intention isn't the way to go. There's often two drivers, one Arduino and one CircuitPython, but I don't know that there's much comparison of the two. There's one guide written on porting from Arduino to CircuitPython but it assumes a pretty significant amount of knowledge of both on the part of the user. Hardware based examples are nice, especially if you pick up on a way to use it that doesn't already exist, but some stuff has a pretty singular use. I think if you think you'd enjoy embarking on something different, go for it. I really feel it's more about what you want to do, because you should enjoy it.

cunning crypt
#

Well, yes, but it should also be useful.

idle owl
#

So far everything you've mentioned is.

cunning crypt
#

I think a lot of the quirks of Python in general need to be brought up. Especially things that Arduino just simply Does Not Allow.

#

Most of what comes to mind is things with variables.

#

You can swap a variable for whatever you please in Python.

idle owl
#

I don't know much about Arduino. By which I mean basically nothing.

cunning crypt
#

You also don't have to declare them, and when defining functions you don't have to set yourself up for just one variable type. VAriables can be, well, variable.

idle owl
#

Yeah

cunning crypt
#

C-variant langauges (Like Arduino) have to have the variables declared as a specific type. Python simply cares not.

#

Also, man is Python so much easier for working with strings.

idle owl
#

I lucked out then. I started with Python.

cunning crypt
#

String manipulation is why Python was my first programming language.

#

And it was super awesome when I learned that Python was coming to Microcontrollers.

idle owl
#

Yeah! Agreed

#

I learned about CircuitPython before finding out about MicroPython. I was the only person at a conference at the end of July who knew about MicroPython - a guy did a talk on it, and he was so stoked when I talked to him about it afterwards.

umbral dagger
#

Interesting conversations there. Makes me think... I’m learning Python at the same time I’m learning Haskell.

cunning crypt
#

I first heard of MicroPython in July of last year, when it was, essentially, just the PyBoard. I fiddled a little when I found it was on the ESP8266, but there wasn't enough going on to make it worthwhile. When I hopped on the Adafruit discord and saw the CircuitPython stuff, I knew I couldn't just sit by and watch anymore

idle owl
#

That's great!

cunning crypt
#

@umbral dagger You're learning two languages at once? That seems confusing.

#

Hmm, CircuitPython having a built-in easily computer-accesible filesystem is also super useful.

#

Especially for Express boards.

umbral dagger
#

@cunning crypt And they're so very different.

#

@cunning crypt Haskell doesn't really have "variables"

#

@cunning crypt Immutability is the rule

#

@cunning crypt The file system access really makes a huge different.

cunning crypt
#

It opens up so much more on even the most basic CP board that Arduino simply doesn't have

umbral dagger
#

The tradeoff for now is memory limitations. Python has significant overhead compared to C++.

cunning crypt
#

That's why it's on the M0

umbral dagger
#

Even there.

#

It’s not feasible on smaller chips.

#

The M4 makes a huge difference.

cunning crypt
#

Exactly. It's effectively the same thing as the lower-sized Arduino chips

umbral dagger
#

The x20 chips will be amazing for CP. 1M flash & half a M ram.

cunning crypt
#

x20?

umbral dagger
#

The SAMD chips end in a letter & number.