#circuitpython-dev

1 messages · Page 167 of 1

timber mango
#

I don't have enough street Python to really comment, anyway. I'm more of a 'this was the first thing that I tried' kind of person.

solar whale
#

OK -and I have verified that what I used to do on Micropython (a long time ago) as far as importing function in main.py does not work under CircuitPython

#

and it still does work under micropython

#
import stuff as mystuff


jerryneedell@Ubuntu-Macmini:~/projects/feather_m0_express$ cat stuff.py
def foo():
    print("foo")


def bar():
   print("bar")
```  on micropython  ```MicroPython v1.9.3-240-ga275cb0 on 2018-01-21; ESP32 module with ESP32
Type "help()" for more information.
>>> 
>>> 
>>> dir()
['uos', '__name__', 'gc', 'bdev', 'mystuff']
>>> mystuff.foo()
foo
>>> 

```  on CP ```soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:



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

Adafruit CircuitPython 3.0.0-alpha.6-67-ge4ec672-dirty on 2018-05-09; Adafruit Feather M0 Express with samd21g18
>>> dir()
['__name__']
#

so I'm not crazy - just have not paid attention to the change.

timber mango
#

No I believed you both times. CircuitPython is its own thing and is designed with a specific market in mind.

solar whale
#

@hollow ingot so I'm sorry if I led you astray - I was thinking about my Micropython example last time we cahtted.

timber mango
#

I always admire strong Design decisions, even when I don't personally agree with 'em.

#

(Use the Source, Luke)

solar whale
#

I am enough of a python neophyte that I often miss the importance of some of the decisions.

timber mango
#

I don't actually get why it works the way it does, but I seem to recall asking about this, earlier (maybe late last year?) I didn't realize micropython did it differently.

hollow ingot
#

No worries. It's good to get people's comments anyway as it's a design decision I have to figure out - how to get that functionality over to circuitpython which might be an ideal base for educators.

timber mango
#

Also, I've gotten used to it working the way it does work -- my expectation-adjustment period is somewhat behind me. ;)

hollow ingot
#

I have working images already using Micropython so it's by no means desperate.

#

The work I am doing with vgkits.org is much less aligned with the performance mindset of micropython and more aligned with circuitpython's preference for python conformance and readability.

solar whale
#

It's not an issue for me either - that's why I never noticed. When first stated playing with Micropython on an esp8266 I would define several functions and use them once I entered the REPL. More recently, I rarely use main.py at all except for final projects that just run without the REPL. I had not tried the "old way" in a long time.

#

@hollow ingot It sounds like a great project and I hope it works out.

timber mango
#

I once complained to a friend of mine about a design issue, and he said:
If thine eye offend thee, pluck it out ⁤  /true_story

hollow ingot
#

So it would be nice to unpick it. Did anyone see the demo in the vid - thoughts, feedback?

solar whale
#

going to watch it now

timber mango
#

I almost never 'watch videos' linked to me.

#

Video generally slaves you to someone else's idea of how to use time, wisely. Printed matter allows scanning with the human eye, searching on keywords, and so forth.
I don't know how to make efficient use of video resources, especially if I didn't seek them out on a hunt for something quite specific.

solar whale
#

@hollow ingot nice! - I wonder if there is any way to get functions defined via as part of the WEBREPL startup.

hollow ingot
#

Dammit lost the message I was writing as I used the name for a mixed drink as a metaphor for a recipe.

solar whale
#

dyno bot is a bit prudish.

hollow ingot
#

I don't see a way of achieving the same functionality in circuitpython. Every solution to one part defeats some other part.

timber mango
#

You can get that message back from someone with moderator privs.

hollow ingot
#

Not sharing the namespace with main.py is a pretty fundamental one.

#

I can live with losing the message but it's funny that I had offloaded the thought to digital so fully that I could hardly remember what I'd written after it disappeared.

solar whale
#

well - I suppose "import stuff" is not totally unworkable.

hollow ingot
#

True, but then you have to introduce about 6 fundamental concepts or alternatively do the black magic thing of saying just type this and I won't tell you why

solar whale
#

oops - I wanted to see if up-arrow would bring it back -- dyno bot alos hates strings of x's

hollow ingot
#

Versus... setPixel(1, red)

#

Which I can fully explain

solar whale
#

yeah - I was thinking the black magic approach ...

#

If I recall correctly, doing a "soft reboot" in WEBREPL under CircuitPython drops the connection as well - have you tried that?

hollow ingot
#

Thanks for the feedback on use of video, @timber mango I usually feel the same, but stepped out of my comfort zone to make one. Hopefully it's not too rambling. Is there a better medium which would suit you? Long form blog post?

timber mango
#

I now frequently cannot distinguish between having thought to do a routine task and having actually done that task. Those tasks are so routine that I take nothing from them while doing them that sticks in the mind.

#

@hollow ingot I guess it's the matter of selling the video to the person. I've lately broken my own rule and dropped lots of links with zero explanation as to why I might have done so.
The engine here in discord helps some by trying to sum up why a link is useful, using automatic heuristics.

#

The old way was to photograph an attractive human being and put them on the face plate of the 'look at this' thing, no matter how incongruous that was. ;)

hollow ingot
#

@@solar whale Micropython soft reset of WebREPL is messy, and never returns without a full reset. Discussing tidyup arrangements with @dpgeorge which might be a future workaround - equivalent to try:catch but for the main.py VM as a whole

solar whale
#

I remember the first time I hit control-D in WEBREPL -- uh oh - that was a bad idea 😉

timber mango
#

Real Simple: spell everything out. No acronyms - none! Explain yourself.
In a paragraph you can probably double your audience, just as when Stephen W Hawking explained in his book that his publisher told him that every equasion he printed in that book would halve his audience.

#

I'm too wordy and lose people by agency of that (questionable) habit.

#

(30 seconds in and having canceled my 'train' video I was watching) I'm an adult and don't need to be entertained with background music (or laugh tracks, for television).
High quality videography is probably the most immediate attractor: good lighting, high resolution, good contrast ratio -- composition -- all that stuff.

#

You want to watch (SEM**) Adam just because it's the elfing Star Ship Enterprise in his lab -- woo-hoo! Without a soundtrack, he rocks, and he's getting better with every video on his personal presentation (human factors: face, voice, addressing the camera and genuineness of personality).
___ **scanning electron microscope
random pick:
https://www.youtube.com/watch?v=BuJGb0FULmw

solar whale
#

@hollow ingot sigh - just thought I try some webrepl stuff and discovered it is not even supported on the esp32 😦 I'll get it going an an esp8266 but that was a surprise!

modern wing
#

@timber mango You spoke about falling asleep to video. I often put on a Twitch streamer while laying in bed. It's something that's interesting enough for me to casually accept to have on in the background, but not deep enough for me to focus intently on every action and word.

I have fallen asleep so well for the past year, no doubt to this.

timber mango
#

If I eat bread during the day I'm very definitely going to bonk surely to sleep, even if sitting up in a chair - around mid-afternoon.

modern wing
#

Speaking of which, man I'm now craving a nap...thanks ;-P

timber mango
#

I should get a job doing this. Sleep-suggestion dot com

modern wing
#

You're getting sleepy. You're getting...sleeee....peeeeey.....popup ad with video

timber mango
#

One thing to remember about videography - it should stand up as an audio-only podcast. If it cannot, it's probably lacking something important. Listen to it without the video and see how it holds up.

#

https://www.youtube.com/watch?v=DDfLBWlBM18
Alright I gave that vid two minutes. The main thing I noticed was insufficient time to pause and reflect -- things happening too quickly (a very common complaint I have of most small video productions that show a lot of edits were made).

#

I liked the screen (REPL) on the left, and I liked the larger video inset on the right. Too many Adafruit videos make the video inset (the human, the presenter) way too small to be of any utility at all.
I like dividing the screen into three regions: the code, the presenter, and the hardware. I liked their placement.

slender iron
#

@hollow ingot boot.py is run once for setup of things like webrepl. It is meant to be user editable but requires a proper reset to take effect.

#

Our solution for wanting set up variable is a single import that does the heavy lifting

#

We also gear towards file based iteration rather than REPL. That allows us to start folks with some code

hollow ingot
#

Yeah I think the philosophy is quite different in that regard. I'll attempt to demonstrate a more REPL-led approach and see where it gets me. I'm going to focus on CTRL+E for people starting with code samples, though that brings in the dreaded CTRL+D to complete. File-iteration works infinitely better on SAMD, anyway, unless i've missed some tooling to make it seamless on ESP8266.

slender iron
#

yeah esp8266 doesn't do usb well

#

damien was considering file transfer over socket that could be a building block for over wifi file saves

hollow ingot
#

@slender iron did you get to see the end to end demo in the video at vgkits.org ? It has file upload via Websocket but not triggered 'on save' as per SAMD boards or Pyboard. Unfortunately I suspect what is demoed there is not possible directly in CP as it depends on continuity between boot.py, main.py and REPL (whether wired or wireless) and I gather the VM reset between main and REPL is fundamental to CP. If I can work around this I'd rather use CP I think, given the learning materials and drivers out there, and the focus on educators, though Adafruit_Micropython_Blinka might give some cover.

slender iron
#

@hollow ingot I'm busy at pycon so I haven't watched it yet. We could add autoreload after save

#
  • save over websocket
timber mango
#

I tend to paste the code in line by line until something breaks, if there's an issue I need to research in the REPL (usually very basic stuff I am unwilling to learn the 'studious' way)

hollow ingot
#

@@slender iron tends to kill the WebREPL due to the reset not clearing out hanging ESP socket resources, sadly. Might make most sense to understand the options next week after you've had a quick view of the demo behaviour, would make more sense of the interdependencies which are built-in to the application scenario and why I'm come unstuck trying to fit it around the CP execution model.

slender iron
#

gotta run! will read back later

hollow ingot
#

@timber mango yes REPL paste is exactly the way I work and want to share with learners. Thanks for taking the time to view and feedback on video. Making it dense was conscious, assuming it valued people's time better and that they would pause it. However it's video #0 in a hopefully long series and I have a lot to learn. Will try different ways

#

Gotta sleep! Thanks and catch you again next week hopefully

timber mango
#

Alright keep up the good work. I did like the video, once I watched it. ;)

hollow ingot
#

Praise indeed! Much appreciated :)

timber mango
#

"I never saw it but I didn't like it very much" -- my typical response, so yes, it's a better review. ;)

manic glacierBOT
cunning crypt
#

Backreading a bit now that I'm home: ESP8266 USB seems not beginner-friendly since it'd be easy to drag the file over and then remove the device before it's fully transferred. That's why I was thinking WiFi. People sort of expect WiFi to be slow, and it's a little harder to interrupt the transfer. Yes, you can power down the device, but that's generally bad form anyway.

raven canopy
#

that moment when you realize datasheets aren't perfect, hence plans based upon them can be de-railed (╯°□°)╯︵ ┻━┻

timber mango
#

@raven canopy how do you specify an alternate i2c address in circuit python?

#

(to override the default address)

#

(this may not be generic; may be library/driver specific .. eccch.)

#

adafruit_lsm303.mpy

tidal kiln
tidal kiln
#

yep. and that's the value.

timber mango
#

So it just knows?

tidal kiln
#

the line you linked is just a global (like a #define)

#

the line i linked is where it gets passed in to the I2CDevice

timber mango
#

Thanks, I get it now (enough to not go further down that road). not an i2c addressing issue at all, it seems.

tidal kiln
#

you'd pass it in when creating the object, or if left unspecified, a default value is used

timber mango
#

Thanks, that's what I had in mind. ;)

#

This is the first time I've noticed a sensor package can have two separate i2c addresses, for a single physical package.

tidal kiln
#

yah, there are two, and i guess they can't be changed

#

so the driver was written to just use those, without anyway of specifying another

timber mango
#

I think @umbral dagger had a hand in that and made a good choice for this particular package.

timber mango
#

I'm bonking a little here and will need to take a break. Getting closer but still a mystery.

tidal kiln
#

i don't think they are doing anything fundamentally wrong, the sensor is just sensitive to lots of interference , but i actually haven't used it directly myself

timber mango
#

Well it is varying, and not way out of expectation. Correlation is weak but that's filtered by very few data points. ;)

#

That's the kind of thing I spend several hours, observing, in detail. to get a good feel for it. ;)

#

@tidal kiln thanks for the input. Very much appreciated!

slender iron
manic glacierBOT
#

@fourfathom Thanks for following the instructions!

It is interesting because we have a different message for when we think we reset due to power failure.

This message usually happens when a code error (like divide by zero or invalid memory access).

Mind trying with a different USB cable? I'm wondering if the USB code is getting funny data and crashing.

I'd love to fix the code issue its hitting but it can be a challenge to reproduce it on our end.

manic glacierBOT
#

Happy to. I'm running it with the two lines of UART init code back in (my original code from my report) and am seeing crashes, but different, more like a regular power-fail then restart. I am using Putty for my"print" monitoring and it loses connection. When I reconnect the my code is running, but the count indicates that it restart from zero.

I will use a different cable and revert to Mu: the same configuration as in my report.

manic glacierBOT
manic glacierBOT
#

Probably unrelated, but this is puzzling me. In my main loop, I copy the time.monotonic() value to the variable mono_time. I save the int value of mono_time to new_time, and compare that to the previously saved int current_time, waiting for a new second. At the new second, I print the values of current_time (an int) and mono_time (a float), and a loop counter that tells me how many times the main loop cycles in the previous second.

Look at the results. The float to int conversion seems...

manic glacierBOT
#

Things like int(7818.999767) == 7819 are due to the limited precision of the 30-bit single-precision floats, and also how the number is formatted for printing. Upstream micropython has improved some formatting, which we haven't merged in yet -- I'm not sure if it fixes this.

This is an instructive online floating-point representation calculator: https://www.h-schmidt.net/FloatConverter/IEEE754.html. Type 7818.999767 into the first field ("You entered"), and you'll see that number is actu...

lethal abyss
#

Is there a way in Discord to filter messages? The github messages are surely useful but it is hard for to catch up on people messages.

ornate scaffold
#

If you know who you want to look up yes

#

But you cannot block a webhook

#

sadly

onyx hinge
tidal kiln
#

@onyx hinge in the left hand nav there are links for "Feedback? Corrections?"

onyx hinge
#

@tidal kiln aha thank you for pointing that out. "Thank you! Our nanites will repair this tutorial soon."

#

😃

marble hornet
#

@onyx hinge what bug did you find? is it a color problem ?

onyx hinge
#

@marble hornet no, just a broken link about installing the necessary library.

marble hornet
#

@onyx hinge okay, may i ask what project your working on ?

#

just out of curiousity

onyx hinge
#

@marble hornet no specific directions yet, I just wanted to play.

marble hornet
#

ah, if you need text support i have a very slow but functional bit of code.

#

at least for 2.2.4

onyx hinge
#

I'll keep that in mind. Thanks!

marble hornet
#

have fun

manic glacierBOT
#

Thanks for the floating point info. As I said, it's more of a curiosity than a problem

My overnight test again crashed, but apparently due to a lost USB serial port. When I woke up Mu had lost contact with the Trinket, and Windows Device Manager wasn't showing the com port. My code was still running (or had restarted), since the distinctive LED flash was active.

I suspect the particular USB port on the computer is the problem, and am now retrying it with different port, this time a...

marble hornet
#

does cir-py have INTERRUPTS?

raven canopy
#

@marble hornet no, it doesn't. micropython does, however.

marble hornet
#

hmm....

#

any plan to ad them ?

#

add*

raven canopy
#

I don't think so. They're really hard to implement...

marble hornet
#

can i help?

#

oh

#

hmm

tulip sleet
#

We're thinking about the best way to do asynchronous code, but we want to make it easy to use.

raven canopy
stuck elbow
#

basically instead of interrupts we want to use the asynchronous capabilities of Python

marble hornet
#

may i ask what that is

#

i though the atsamd21 was single core

stuck elbow
#

the async and await keywords, the coroutines, etc.

#

asynchronous doesn't have to mean parallel

marble hornet
#

okay... looking up keywords

stuck elbow
marble hornet
#

okay...

#

then can i ask for some advice

stuck elbow
#

that's what we all are here for

#

ask away

marble hornet
#

then i'm at a cross road. i am making a tricorder (from st tng) and i have a bunch of sensors that have interrupt pins. i would like to know if uv spikes too high or if there is noxious gas. is continuously polling all the int pins enough? or should i switch back to arduino ide. (which has gui support for the screen in addition to interrupts but it's harder to code in )

manic glacierBOT
marble hornet
#

could i overclock the atsamd21? the m4 hardware isn't released yet and im making custom pcbs. plus cir-py has much more memory. @stuck elbow

#

also above^^^

#

what is your suggestion

raven canopy
#

i don't think the SAMD can be overclocked, but i've never looked at it specifically. if polling the interrupt pins isn't quick enough, then reverting back to Arduino would probably be the easiest solution.

stuck elbow
#

@marble hornet you could also add a custom C module to your circuitpython build

#

@marble hornet I did that when I needed button presses

#

then you can use all the interrupts and such, and set a flag that then you can check from within your python code

marble hornet
#

Thanks deshipu may I ask what module you used ?

#

@stuck elbow

stuck elbow
#

@marble hornet I wrote a "gamepad" module and added it to circuitpython

#

it checks the pins you pass it for button presses, does debouncing, and buffers the presses for you to check from your code

#

actually, perhaps you could re-use it for your interrupts...

timber mango
#

It's probably useful to try to solve the problem on multiple platforms -- some lessons learned (knowledge gained) will be obvious on one platform, and perhaps more obscure on another.

#

Yeah, they're all Turing Machines (after a fashion) but the approach can be elliptical, or more direct, depending on platform.
String-handling will often constrain you as to where to go next.

marble hornet
#

Dear @stuck elbow I'd love to use it, it sounds perfect! Plus I might add physical button too. If your willing to share it id be very thankful!

stuck elbow
#

@marble hornet it's built-in into circuitpython

marble hornet
#

Thanks!!

stuck elbow
#

I'm really struggling with the CP 3 and my game libraries.

#

They worked fine two months ago, now gamepad doesn't work at all for some reason and stage crashes after several seconds of updating the display.

#

That's on M4, on ugame10 the firmware doesn't even get me USB

marble hornet
#

@stuck elbow may i ask how you rotated the display on the ugame10?

#

in software i mean

stuck elbow
#

using the MADCTL register of the ST7735R chip

#

it lets you set the orientation

marble hornet
#

okay, ahhh

#

did you base it off of the rgb.py lib ?

stuck elbow
marble hornet
#

thanks for the head up!

solar whale
#

@stuck elbow I am modifying the bitbanio I2C to accept the timeout keyword argument as it was in extmod -- I also found that I had to add the argument to the busio implementation even though it is not used. Does that seem like a reasonable appproach. Is there a better way?

stuck elbow
#

@solar whale I'm really not sure. I suppose the API should be consistent.

solar whale
#

that is what I thought - it is common now so it seemed simplest to include it - I'll put in in that way see what everyone thinks. Do you recommend leaving the default at 255?

stuck elbow
#

if I remember correctly, nodemcu defaulted to 300

solar whale
#

The current CP code has it hard-coded it to 255. I'll check Micropython.

#

Micropython uses 255

stuck elbow
#

yes, because I initially used an 8 bit variable for it

#

figuring out that the difference between 255 and 300 is small enough

solar whale
#

how large to you make it when you are having problems?

stuck elbow
#

no idea, the unit is ms, but it's a bit more, because all the code around it

#

takes some time to execute

solar whale
#

I think the unit is microseconds

stuck elbow
#

ah, us, right, sorry

solar whale
#

I have it implemented and it seems to work, that is I can specify a new timeout -- kind of hard to test... I tried using bitbangio on a Mtero_m4 and it is working ok. I'll try an ESP8266 to make sure it works there. Do you know any devices that need longer times. I can try a css811 gas sensor - I had lots of trouble with it in the past. Any suggestions?

stuck elbow
#

not really, personally I implemented the clock stretching when I had problem with the i2c slave on an attiny85

manic glacierBOT
solar whale
#

OK - I'll just try a few sensors and see If I can see anything - I think the vl53l0x might also be a good candidate.

stuck elbow
#

too complex :)

#

but I remember a few sensors did clock stretching while doing the measurement

#

I think one of the color sensors could do that

solar whale
#

good chance for me to test out my collection of sensors.

marble hornet
#

@stuck elbow does the ugame 10 have more then 2 megs of flash ?

stuck elbow
#

@marble hornet no

marble hornet
#

okay

stuck elbow
#

technically you could replace the flash chip

#

and build custom firmware with support of more

marble hornet
#

i noticed ur files had support for tiles and such

#

but it's not working on my feather express

stuck elbow
#

that the "stage" library, a sprite and tile engine for the display

#

yeah, it's not enabled by default, you have to build custom firmware

marble hornet
#

its running out of memory

stuck elbow
#

try compiling to .mpy

#

I usually just freeze that library into the firmware, so it doesn't use memory

marble hornet
#

how can i wipe al the memory on a cir-py device in terminal

#

b/c my computer thinks it is full yet nothing shows in it

timber mango
#

you reset the device so it shows up as a drive

#

then drag and drop the erase .UF2

marble hornet
#

okay, on git right

#

github**

timber mango
#

Nope. Kattni wrote a page for this.

stuck elbow
#

in 3.0 there is also a method you can call in storage

marble hornet
#

ummm

marble hornet
#

found it in my downloads folder, although thank you

timber mango
#
>>> import storage
>>> storage.erase_filesystem()
marble hornet
#

or will i need other things ?

marble hornet
#

@stuck elbow in another matter i am trying to add the st7735r screen rotation to my library. i tried copying

#

the line into the command and data sending section

#

"(b'\x36', bytes(((rotation & 0x07) << 5,)), 0)"

#

without the delay

manic glacierBOT
marble hornet
#

but the info is not sending, i'm getting an error saying: can't convert bytes to int

#

have you seen this? im a bit new to coding/editing spi libs

timber mango
#

Hi, just a quick question. Is it possible to prevent other people from simply downloading the main.py file from the M0 boards? Something akin to the Data Memory Lock Bits in ATmegas?

#

The smaller boards without SPI flashROM could probably be locked.

#

I don't know enough about the SPI flashROM chip to speculate.

#

Boards like the Trinket M0 for example?

#

Any M0 without an SPI flashROM. Gemma and Trinket come to mind as they are physically small and probably don't have room for an SPI flashROM chip. ;)

#

Feather M0 Express, Metro M0 Express, Circuit Playground Express all have SPI flashROM.

#

Metro M4 also has SPI flashROM (and may be branded as 'Express' which seems to be the keyword for branding a target board as including a 2 MB SPI flashROM).

#

And even there, the SAMD21 or SAMD51 chip itself can be locked I would think.

#

But the SPI flashROM may remain open to interrogation.

#

Well sounds like I have some documentation to study then...

#

Well no protection is absolute I just want to make stuff a tiny bit harder on certain projects than plugging in the USB...

#

Anyway thanks for the info 😃

#

nice, thank you for that

#

That's probably the correct chip since it's the right size and the github mentions CircuitPython.

#

sounds like it might actually work

#

I wonder how many boards will I damage trying this out 😃

#

Manufacturers probably need that level of security to remain competitive against copy-cat production houses.

#

@timber mango that could be the chip manufacturer's profit margin right there. ;)

#

Seems to me a JTAG (or similar; I have forgotten the name .. SW comes to mind) ..

#

.. interface would allow recovery of the chip, just not recovery of the seekrit codez.

raven canopy
#

more of an obscurity approach, but you could mpy-cross your code into bytecode, then call it from code.py/main.py.

timber mango
#

@timber mango meh, I bet people would find a way given sufficient funds... every security feature has an expiration date...
@raven canopy that might be a more viable way to go so I could for example update stuff in the future if the customer desires etc...

raven canopy
#

you could also disable the USB functionality in a personal build of the firmware. it should still run just fine. but to update anything afterwards, you'd have to put on USB-enabled firmware first (just an added step).

#

note: would need to leave the bootloader USB-enabled

timber mango
#

I'm not a big fan of tinkering with the upstream stable versions of stuff... Much easier to debug things when it's as stock as possible... So far the mpy-cross seems to be the way to go...
Or combine all of these to make it ultra-black-ops-like 😄

#

Speaking of upstream stuff... The Feather nRF52 Bluefruit LE will be running CircuitPython 3.0 once it's released?

#

I'm not seeing language suggesting the SPI flashROM can be snoop-protected.

raven canopy
#

that's the plan. but i think the official answer would be along the lines of "it'll be done when it's done". 😄

timber mango
#

OTP protection is more along the lines of the seekrit spy cannot overwrite ze program vith vun uff hiss own.

#

See, the MCU can execute seekrit code without ever exposing it to any bus; whereas SPI flashROM exposes its content, during routine access. It's inherently insecure.

#

You would need an encrypted connection to the chip!

#

As far as a massive dump of its content, I cannot say.

#

@timber mango So it's actually more like a simple write-protection? It makes the filesystem read-only? From what I can google the ATmegas are not foolproof either... You simply set some bits but if you really wanted you could read it and reconstruct the code anyway...

@raven canopy Sounds like a reasonable ETA if you ask me 😄
I was just toying around for the past few days with some IR remotes and CircuitPython boards but the need for LOS makes them a bit cumbersome. And RF stuff is not always safe-to-use on the old continent as the frequencies are quite tightly controlled so something like the nRF52 Feather and a Bluetooth remote would be the best way to go...

#

Looks to me like the security for this type of chip is focused around controlling carefully when and if the chip may be written to.

#

Looks like there's a mode that permanently kills a specific register (prevents it from ever being written again, for the lifetime of the device).

#

Which in turn prevents changing the content of the flashROM. In perpetuity (OTP mode).

marble hornet
#

what would happen if you freeze the main.py into the firmware and set the security bit?

#

then just call it from the user end

tulip sleet
#

You could freeze main.py but then you'd have to disable copying CURRENT.UF2 off the BOOT drive. All in all it would be a lot of work to secure any CircuitPython program.

marble hornet
#

if @timber mango is really looking to be secure ...

#

but ur right

manic glacierBOT
timber mango
#

... Trout Fishing In America replies .. github .. github .. github ..

timber mango
#

.oO( .. I got mine, Jack.)

lethal zephyr
#

How do I add the Circuit Python lib to Eclipse? I figured I could just add a module in Python, and then Eclipse would load the new libraries, however I can't figure out how to add the Circuit Python libraries to my install of Python either. I'm new to Python & Circuit Python, I've played with some code on Mu but I would like to try it in Eclipse.

timber mango
#

@lethal zephyr I don't understand what software model you had in mind.

#

I have a limited grasp of the situation; however, in my understanding, things work something like the following:

Circuit Python exists as a virtual machine, in firmware running on a microcontroller...

#

It reads stored ASCII files from a filesystem residing on flashROM wired to the microcontroller.

#

It compiles such files, written in the Python language, into bytecode, which it can then execute (inside some kind of virtual machine).

#

The C++ compiler is used to create Circuit Python firmware, on a host PC.

#

It outputs a .UF2 compatible file.

#

mpy-cross compiles bytecode outside of the CircuitPython environment, on a host PC, for use within the CircuitPython environment. In this way, libraries are created, to be stored on the microcontroller-based system in a compacted form.

lethal zephyr
#

Sorry, I obviously don't have a good understanding of how it works yet. My main goal is just to get the adafruit python libraries added to Eclipse so I can code within it.

stuck elbow
#

@timber mango you could compile your code to .mpy

#

@timber mango and if you want to prevent copying, you could freeze it into thefirmware

timber mango
#

@lethal zephyr I would encourage you to try 'Mu' which is what amounts to an IDE for CircuitPython, kinda-sorta (not really sure myself; I use vim and a serial terminal to the REPL).

#

Wild guess is that you might coerce Eclipse into behaving as a python-aware IDE (basically a fancy source code editor).

lethal zephyr
#

@timber mango yeah I've been using Mu, I wanted to try something else. Eclipse works with python, but I haven't figured out how to load new libraries. Maybe I'll just do more research on Eclipse. Thanks for the help though.

timber mango
#

You're welcome! Let us know what you did and how it worked out.

#

(I invoked the 'us' as I'm not here that much, lately).

manic glacierBOT
desert totem
#

Can anyone suggest a resource here that can help me sort out the syntax needed to get the MicroPython REPL in PyCharm's ESP8266 device location field. The syntax for the value I used was rejected. I'm using Window10, so I've not seen an an example of what the syntax should look like. I was using, "USB\VID_239A&PID_8014&MI_00\7&13351F79&0&0000"

novel bridge
#

I'm trying to find information on interrupts on my M0 express

#

I'm thinking they might not be implemented yet... am I wrong?

noble lance
#

Is there a map() function in CiruitPython? Say I want to map an input value like mic level and I want to map its max and min values of 100 and 400 to 50 and 100?

#

I know how to do it in p5.js which is shown here: https://p5js.org/reference/#/p5/map but no clue how to do it in python

#

think it's also called linear interpolation?

solar whale
#

@novel bridge Interrupt support has not been implemented in CircuitPython. I think it is available in the Arduino environment.

meager fog
#

@noble lance yep check out simpleio.mpy

#

i wish it was a cpy built in but we just hand-implemented 😃

stuck elbow
#

it could be frozen...

meager fog
#

i meant a native function in cpython

#

like len() and print()

stuck elbow
#

ah, a builtin, sorry

candid ravine
#

@tulip sleet Hey Dan, I must have been living in a cave in the hinterlands. When did you do the Building CircuitPython guide?

manic glacierBOT
noble lance
#

@meager fog thx!!

timber mango
stuck elbow
#

@meager fog is there a chance to see the metro m4's schematic?

#

or should I just wait patiently?

ruby lake
meager fog
#

@umbral dagger hey by chance have you engineered CAN bus design? or was that someone else, there's no good dox on power requirements 😛

timber mango
cunning trail
meager fog
#

@timber mango it doesnt really cover the power requirements 😃

timber mango
umbral dagger
#

@meager fog CAN, wasn’t me.

slender iron
#

timecode to my talk

#

circuitpython in 3 minutes!

tulip sleet
#

@candid ravine Building CPy guide is about three weeks old. May expand it in the future; if you have suggestions or corrections feedabck is welcome.

candid ravine
#

@tulip sleet Looks really good so far Dan. I was without a computer and good Web access for about 3 weeks around that time. Will definitely review it in detail and give you feedback/suggestions if I spot anything. It looks very complete! Thank you!

solar whale
#

@slender iron have time for a question about raising exceptions?

slender iron
#

@solar whale shoot!

solar whale
#
        nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError,
            "Clock Stretching Timeout."));
```  failes because TimeoutError is not defined  -- it works if I use ValueError
#

but TimeoutError is defined in py/obj.h

umbral dagger
#

@slender iron You mentioned being able to prevent the soft reboot of circuitpython on Linux. Pointers. I've not found anything useful yet.

solar whale
#

BTW - I used nlr_raise -- since it is how it is done in SPI.c

slender iron
#

@solar whale let me dig. maybe there is a missing definition somewhere

solar whale
#

I thought somthing was missing from py/modbuiltins.c but it did not help -- I can't find any examples using mp_type_TimeoutError.

slender iron
#

yeah, feels like it could be a #define somewhere

timber mango
#

@tulip sleet I couldn't find my bookmark for the eabi compiler in my www browser, and it's not mentioned in your article. Using that compiler was the solution that worked for me, to build CircuitPython on Linux for SAMD21 targets.
You were the one who gave me the link. I can't even think of who it is who provides it. ;)

tulip sleet
#

@timber mango what os are you on, and if linux, which distribution?

timber mango
#

Debian -- Debian 8.10

slender iron
tulip sleet
manic glacierBOT
tulip sleet
#

I'll put a ref in the Guide soon.

timber mango
#

Ha! Thanks. I would not have come up with arm.com as the provider!

umbral dagger
#

@slender iron OK, trying that. I have a lengthy test of a hack I did today.

solar whale
#

@slender iron ah - so do I need to enable itmpconfigport.h??

slender iron
#

looks like it, or just remove the #if

#

I think we could fix the "more descriptive OSError" issue by uncommenting them

solar whale
#

I suppose we need it for all builds sso I'll ermove the IFDEF

slender iron
#

@tulip sleet I was thinking we could put a short link together with relevant links for people tomorrow

tulip sleet
#

@slender iron you mean for building circuitpython?

slender iron
#

yeah, plus the issue list?

#

runs adabot

tulip sleet
#

sure, should we just start a Google Doc?

slender iron
#

sure

solar whale
#

@slender iron it compiles!! will test then submit PR -- thanks

slender iron
#

awesome! nice job @solar whale

tulip sleet
#

@solar whale are you using nlr_raise or mp_raise: the latter is "newer"

tulip sleet
#

@slender iron do you have access to create a short url for the doc I shared?

#

I tried goo.gl but it's defunct

slender iron
#

not an adafruit one

solar whale
#

I used nlr_raise since taht was the example in SPI.c I can change to mp_raise - -same sytax?

slender iron
#

@solar whale not sure off the top of my head

tulip sleet
#

@solar whale look in shared-bindings for lots of examples of mp_raise. I changed a bunch of nlr_raise to mp_raise

solar whale
#

I'll try it.

tulip sleet
#

There are mp_raises for specific exceptions, and then also a general one where the exception is an arg

gaunt breach
#

trying to get the repo setup, just tried to run make BOARD=circuitplayground_express. Got some errors... does it need python2 for some of the steps?

raven canopy
#

@gaunt breach did you run git submodule update --init --recursive after cloning?

gaunt breach
#

@raven canopy, yes. Going through the build guide. I ran that step before getting to the most recent make command

#

It could be because I've got pyenv in the mix. it really doesn't like supporting more than one version of python

tulip sleet
raven canopy
#

that could be. i know that the bootloader requires python2, but can't recall if the firmware build does. let me take a look in a couple places...

tulip sleet
#

@gaunt breach did you build mpy-cross

#

what are the errors?

gaunt breach
#

built mpy-cross successfully. then failed here with buildin the board

Create build-circuitplayground_express/firmware.bin
Create build-circuitplayground_express/firmware.uf2
python2 ../../tools/uf2/utils/uf2conv.py -b 0x2000 -c -o build-circuitplayground_express/firmware.uf2 build-circuitplayground_express/firmware.bin
pyenv: python2: command not found```
tulip sleet
#

CPX builds require a working mpy-cross to freeze modules into the firmware

gaunt breach
#

so, pretty sure I can't use pyenv with this... if I need both python2 + 3 😅

tulip sleet
#

what linux dist are you using?

gaunt breach
#

mac

slender iron
#

@gaunt breach do you have python2 but it's named differently?

raven canopy
#

yeah..the uf2 is what requires it (not bootloader). remember that now.

gaunt breach
#

when using pyenv, at least the way I have it setup on this work machine, you can't access any python without being in a virtualenv managed by pyenv. And trying to access one outside that env causes it to complain. Will have to workout how to get around that...

slender iron
#

@gaunt breach you could make a venv for it

#

actually, one thing we could ask folks to do is convert that script to python3 😃

solar whale
#

@tulip sleet looks like ai'll have to add mp_raise_TimeoutError to py/runtime.c

raven canopy
#

@slender iron 2to3 should work just fine. i looked it over the last time this came up; really only looked like the print statements needed to be changed.

slender iron
#

@raven canopy cool. we'll have a room full of python folks tomorrow 😃

tulip sleet
#

@solar whale you can avoid that by using the general one:
mp_raise_msg(&mp_type_OSError, "I2C operation not supported");
is an example

#

assuming there's an mp_type_TimeoutErrror

solar whale
#

Ah OK - yes the type is defined. Thanks

raven canopy
#

haha. well that was quick. 😄

slender iron
#

@raven canopy cool! hopefully assigning it will make them see it

#

@gaunt breach did you get it going?

gaunt breach
#

its easier for me to make the uf2 script python3 compatible than work around breaking my pyenv 😑

raven canopy
#

agreed, probably much simpler.

slender iron
#

year old PRs are bad news

solar whale
#

@tulip sleet OK - it compiles (after including py/runtime.h) testing now

slender iron
gaunt breach
#

my favorite 2->3 error
TypeError: can't concat str to bytes
😑

tulip sleet
#

@timber mango I added a "Manual Setup" page to the Building guide with a pointer to the gcc arm toolchain download.

raven canopy
#

@gaunt breach i would just grab ntoll's update from the PR and paste it into the uf2conv.py on your local. then update the Makefile to use python3.

gaunt breach
#

@raven canopy, I looked at doing that. But there's a variable that isn't imported anywhere, nor defined, which broke things 😦

raven canopy
#

arrghh!!

gaunt breach
#

also not sure that it resolved all the str/byte stuff either 😖

raven canopy
#

@slender iron well done on CircuitPython mode=lightning! it even worked, defying the live demo gods...

tulip sleet
#

@solar whale you may be able to remove the nlr #include if it's not used elsewhere. If you feel so inclined, update the other nlr_raise's in that file to the more modern mp_raise

slender iron
#

@raven canopy thanks! I've had multiple people say "oh you are the one who did the lightning talk" 😃

solar whale
#

@tulip sleet I think I'll try removing the nlr include for I2C.c and get this PR in. If that works, I'll do the others a separate PR since I'll need time to test

candid ravine
#

@gaunt breach I ran into the same problem using VirtualBox Ubuntu. Ended up installing python 2.7 and 3.5, then set up soft links in /usr/lib: sudo ln --symbolic -T python3.5 python sudo ln --symbolic -T python2.7 python2

tulip sleet
#

@solar whale don't worry about the other uses, there are lots. We can update them gradually

gaunt breach
#

ha! figured out the missing variable (a refactored function that didn't get renamed everywhere) and got it to build using ntoll's changes! 🎉 Now I can keep going through the setup guide 😅

raven canopy
#

yay!!

onyx hinge
#

@gaunt breach fwiw with cd tools/uf2; git fetch origin refs/pull/2/merge && git reset --hard FETCH_HEAD I do seem to get a proper .uf2 file created even when I switch ports/atmel-samd/Makefile to use python3 when invoking uf2conv. however, some misc changes and bugfixes in the master branch of https://github.com/Microsoft/uf2.git get discarded in the process, and some of them might be important.

solar whale
#

@tulip sleet Nice - compiles without py/nlr.h -- nice to clean that up

tulip sleet
#

@candid ravine @gaunt breach not considering the pyenv thing, it should suffice to have the packages python and python3 installed on Ubuntu 16.04. python3 is installed out of the box I think, but python (which is python 2) is not in all versions of Ubuntu.

cunning trail
tulip sleet
#

@cunning trail hahah thanks!!

timber mango
#

@tulip sleet I couldn't find the (gcc-arm-none-eabi) mention/update, but I did see a (very) recent timestamp. Is there a latency between authoring changes and their being put onto the server?

tulip sleet
#

@timber mango oops, I left the page in draft mode; now published. Try refreshing. There may still be a slight delay

gaunt breach
#

if i just want to compile all the C code to python... not put it in a bin/uf2, is there a make command for that somewhere?

timber mango
#

@tulip sleet That did the trick -- thanks!

tulip sleet
#

@gaunt breach you could just hack this line in the Makefile:
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2

candid ravine
#

@tulip sleet AFAIR, yes, python3 was installed as standard and I don't think Tony D forced it in the vagrantfile from his guide. I'll go back and look. I'm pretty sure I installed python (python2) separately.

manic glacierBOT
tulip sleet
#

@candid ravine yah, so you just need to do sudo apt install python because python3 is already installed. The vagrant guide is pretty old and I want to bring it up to date sooner or later.

slender iron
#

@gaunt breach do you want to use that C code from python locally? there isn't a way to use it with CPython but you can run micropython locally (its ports/unix)

gaunt breach
#

@slender iron I'm going down the rabbit hole for odd reasons. Basically, I'm setup in Pycharm, and I will do everything in my power to bend Pycharm to my will... which in this case, means compiling the C code, into Python, so Pycharm will be able to do cool IDE things like auto-complete, etc

candid ravine
#

@tulip sleet Definitely, that's why I was asking about when you had written the new Build CP guide. It looked "fresh" 😉

slender iron
#

@gaunt breach you may have better luck stripping the module info from the rst comments in shared-bindings

#

I'm not sure what format they use to read the info about modules

#

lines that start with //| are rst

umbral dagger
#

@slender iron Just watched the lightning talk. Well done!

gaunt breach
#

I know with js, you can specify docs for the IDE to read/parse. I haven't seen that with Python... it seems to read off of pip packages in the env, or source python files. 🤷

slender iron
#

hopefully the author of the plug in will come tomorrow 😃

#

has anyone done rst -> python?

candid ravine
#

@tulip sleet OK, that was a surprise, I didn't remember this correctly. Tony did install python3 explicitly in his Vagrantfile. That's not to say that it wasn't already installed though. sudo apt-get install -y python3 gcc-multilib pkg-config libffi-dev libffi-dev:i386 qemu-system gcc-mingw-w64

tulip sleet
#

i think that vagrant is built off of 14.04??

candid ravine
#

@tulip sleet At any rate, I'm glad that you wrote the new guide!

Yes, I tweaked it to use Xerial

tulip sleet
#

in 16.04 a lot less is necessary, build-essential covers most

candid ravine
#

Good to know!

tulip sleet
#

I added a pointer to the new guide on the Building page of the old guide

candid ravine
#

There you go, being helpful again 😀

timber mango
#

Is circuitpython/ports/atmel-samd/boards/metro_m4_express_revb appropriate for the new targets that say BETA on them?

tulip sleet
#

@timber mango No. revb is an old alpha board we sent to some folks. The pin mappings are different. We will remove it sooner or later. Just use metro_m4_express

#

the beta board is rev F

timber mango
#

great! appreciated. I would have intuited it oppositely. EDIT: rev F. Got it.

meager fog
#

@timber mango thanks, will read all those things - i found a maxim app note that had a 100mA switch cap converter and if its good enough for maxim its good enough for me 😃

timber mango
#

@meager fog In my reading I saw 95 mA during a bus failure mentioned, so that sounds ballparky to me as well.

meager fog
#

this pump can do 250mA peak, which is the highest number is aw anywhere

timber mango
raven canopy
#

@candid ravine glad to hear someone else is running the vagrant successfully in xenial.

tulip sleet
#

'night all - gonna wind down to get enough sleep for the sprint

meager fog
#

l8r!

slender iron
#

night all!

solar whale
#

Good night! Bedtime here as well.

timber mango
plucky flint
#

@slender iron @idle owl @tulip sleet PyCon sprints... I'm (currently) in room 21 (its the one with a large poster of a bee by the front door). Come find me when you're set up. 😃

idle owl
#

@plucky flint Ok keen, will do!

umbral dagger
#

I’m back in CircuitPython headspace! Yay!

plucky flint
#

@idle owl UK timezones FTW! 😉

slender iron
#

@plucky flint I'm probably 20 minutes out. Mind putting us on the board and starting to collect people in a room?

stuck elbow
#

how was pycon so far?

slender iron
#

Really good! Lots of circuitpython interest

stuck elbow
#

probably because of the gemma :)

slender iron
#

Yup!

manic glacierBOT
slender iron
#

Ok all, we're sprinting in 26B!

manic glacierBOT
chilly juniper
slender iron
ruby atlas
#

Hello!

slender iron
#

hi @ruby atlas !

manic glacierBOT
meager fog
#

hiya im around today for another 2 hours or so, if there's sprints Q

#

w.r.t. hardware - will try to poke my cyber-face in here, @ me here or on github

idle owl
#

@meager fog Thanks!

slender iron
#

@meager fog we have a couple folks pylinting the learn guide code. We'll make sure to check the learn guides for copies of the code too

meager fog
#

ok cool i personally like how the arduino travis works, it runs on everything every commit and uses .skip files to not do some dirs

meager fog
#

mostly cause i think people will forget to commit a pylint config file

manic glacierBOT
slender iron
#

@meager fog kk, we'll have one central one then

umbral dagger
#

My new learning guide is live. All code in CP 3 running on Metro M4 Express.

meager fog
#

(thumbsup)

#

did you try the newest version with cache enabled? may improve speed

umbral dagger
#

@meager fog I'm in the middle of a long-running test right now, I'll check it out after that (slow test so it'll be a good comparison).

#

I handwired an SOIC32 to DIP adapter for a 128K static ram and am running it through various write/verify passes.

fluid helm
#

Hey @meager fog is there a CircuitPython meetup here tonight? Or will it resume next Monday

idle owl
#

@fluid helm The Weekly will resume next week 😃

fluid helm
#

Cool

umbral dagger
#

@fluid helm I saw your talk. Good job.

fluid helm
#

Oh thanks. It was great fun

manic glacierBOT
#

…ctions

  • moving Makefile to parent folder. This resolves some of the weird path/build issues
  • remove trace references to cpydiff and original file (no longer used anywhere)
  • converting SOURCEDIR to a changeable variable, passed through all sphinx-build calls
  • adding path to conf.py, in case it moves again
  • making -v default with VERBOSE
  • making -E default with FORCE
  • creating BASEOPTS to store all the dirs, paths, and settings, passing them to sphinx-build in one long cha...
candid ravine
#

@raven canopy Yep, xenial has worked very well. Given what Dan said, I will go back to the Vagrantfile and trim out what was required for Ubuntu 14.04 but is no longer required in 16.04

stuck elbow
#

those illustrations are sweet

meager fog
#

@stuck elbow rad - would you be able to add this the newsletter?

stuck elbow
#

I can try, what was the link to it again?

meager fog
stuck elbow
#

thanks!

gaunt breach
#

hmmm unsure why the build failed on my PR... when it was non-code changes... 🤔 maybe @slender iron can take a peek and tell me what I'm missing... 🤷

manic glacierBOT
stuck elbow
#

µcollections ;-)

manic glacierBOT
idle owl
#

@stuck elbow Did you pick up the HID throwing an error on 2.x issue?

gaunt breach
#

thanks @slender iron! looks like travis was happy after you poked it 😄

idle owl
#

@stuck elbow We have someone here working on it, so I wanted to find out.

stuck elbow
#

@idle owl I'm not sure what you mean, but I never did anything with USB on CircuitPython

idle owl
#

@stuck elbow We have an outstanding issue about making it throw an error on HID with GamePad or something like that if you're running 2.x. Scott thought you were the only person who might have picked up the issue.

#

So I thought I would check.

stuck elbow
#

no, I didn't pick it up

idle owl
#

Ok

stuck elbow
#

I'm still struggling to get the µGame code to run on recent versions of CP 3.0 — there is something very weird going on

#

I will probably ask for help after the PyCon

idle owl
#

Ok, it's no problem, I just wanted to make sure you weren't doubling up on something.

#

We'll be around!

manic glacierBOT
#

For several common errnos, include a human-friendly string in the exception string. For now, only enable this on boards with external SPI flash, because pulling the uerrno module in eats up an extra 1kb of flash.

Likewise, this only adds error strings for common exceptions to avoid using flash unnecessarily - others will just show up as the EXXX string, but meaningful descriptions can be added later if needed.

Tested with a Feather M0 Express REPL:

Adafruit CircuitPython 3.0.0...
onyx hinge
#

it is inspiring to see all the activity going on today

#

hug reports to everyone who has been sprinting

trim elm
manic glacierBOT
slender iron
manic glacierBOT
barren hemlock
#

🎊 fixed my pylint issues

chilly juniper
manic glacierBOT
gaunt breach
#

anyone else sprinting want to go on a ☕ run...? 😅

solar whale
#

Feeling like such an old fogey - watching the sprint is absolutely terrifying 😉 Thanks to all participating and cranking out code.

manic glacierBOT
stuck elbow
#

The original Blinka is very nice, but a bit hard to draw fast, so I tried to make a "chibi" version that would be suitable for quick sketches and comic strips.

manic glacierBOT
#

To reproduce and test:

Adafruit CircuitPython 3.0.0-alpha.6-75-ga0954b9e1-dirty on 2018-05-14; Adafruit Gemma M0 with samd21e18
>>> import microcontroller, pulseio, board
>>>
>>> pwm1 = pulseio.PWMOut(microcontroller.pin.PA14, duty_cycle=1, frequency=500, variable_frequency=True)
>>> pwm2 = pulseio.PWMOut(microcontroller.pin.PA18, duty_cycle=1, frequency=500, variable_frequency=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: All time...
manic glacierBOT
manic glacierBOT
sick creek
#

beers are with you

manic glacierBOT
plucky flint
#

@slender iron @idle owl dinner!?!?!? 😃

meager fog
#

omg it was pull request CENTRAL here today

raven canopy
#

indeed it was. i had sprint-envy... 😄

meager fog
#

i sprinted too, just on crickit stuff 😃

onyx hinge
#

as for the performance of the LCD .. should I expect clearing (filling) the screen to take over a half second?

#

so, short story, there is a speedup available for screen clearing. move the lock of the spi device up into fill_rectangle. speedup of approximately 5x..

#

but no idea if that works on "most screens"..

#

also it sort of breaks the layering, hm

strange niche
#

Hi, I'm having some issues getting my Metro M0 to run CircuitPython again. I dragged the .uf2 file and it restarted, but Mu doesn't see it

#

Any thoughts?

#

Oh nm! I found the awesome list above and figured it out!

lone sandalBOT
manic glacierBOT
#

The test did need to be updated; I've done so. The test was checking the output of:

str(OSError(uerrno.EIO))

Previously it would return something like '[Errno 5] EIO', but because the "5" is platform specific, the test was checking only the first 7 characters ([Errno ) and the last 5 (] EIO).

We deliberately changed the message to '[Errno 5] Input/output error' and so looking at only the last 5 was no longer correct. The test is now updated to look for everything after ...

clear pecan
#

Hi folks! what stage is the Gamepad HID library at? How usable is it?

#

I'm wondering if it's feasible to make a game controller using an itsy bitsy m0 express as the brains

ruby lake
#

hm, I think lighting killed one of my RPis

slender iron
#

@clear pecan Please give it a try. In all of our testing it worked but we didn't have a bunch of use cases to test it with

solar whale
jagged crown
#

Hi, I'm having problems running my Neopixel code, I used the one in the Circuit Python Essentials tutorial to try and run my NeoPixel Ring, but it's not working and the connections are correct

stuck elbow
#

What do you mean exactly by "not working"?

onyx hinge
#

@solar whale thanks for the link

solar whale
#

@jepler#1088 let me know if I can help test any changes.

#

Or if there is something you want me to implement

#

@jepler#1088 a half second to clear is typical of what I see on an M0.

#

It’s a bit faster on an nRF52832

stuck elbow
#

@onyx hinge that display is in fact capable of displaying animations in real time

#

the problems is, you have to drive it differently than that library does to achieve that

#

I'm thinking about making a "text mode" library, that would be limited to displaying text and box characters, but would be very fast

onyx hinge
#

the main improvement I found so far was reorganizing to reduce the number of 'with spi' statements

#

I should look at what @stuck elbow has been doing

stuck elbow
#

well, drop the spi device library in the first place

#

that will give you a huge improvement

#

also, set a higher spi clock speed

#

you can also skip toggling the cs pin if you only have one device on the spi bus

#

and generally not toggle cs if you do several operations in a row

onyx hinge
#

If I understand correctly, that touchscreen is on the same spi bus, but still yes, to switch CS just once for all graphics activity "per frame" makes sense

#

I assumed that was the main difference the 'with spi' reorganization made in fact, but maybe there are other inefficiencies in that spi library

stuck elbow
#

'with spi' also re-configures the bus for the particular speed and polarity every time

#

also, function calls are relatively costly, especially with inheritance and all that

#

and 'with' statement also setups a try-except trap

onyx hinge
#

all that makes perfect sense

stuck elbow
#

the most efficient way of updating that display is to first create all the data for a particular fragment of the screen you want to update in a buffer, and then send it all in one go

#

this works very well with "tiled" things, like text mode

#

because you can update whole lines

solar whale
#

@stuck elbow If I am reading the I2C documentation correctly, Hardware implemented I2C does not have any "time" on clock stretching. there is not limit on how long a slave can hold the SCL.. I'm just curious why we have implemented one for bitbang I2C. I like having a timeout, but if the HW I2C does not have it, why should bitbang?

onyx hinge
#

which is essentially what the rectangle fill does, except that it is limited to sending 512 bytes at a time

#

but that seems like a matter of practicality

stuck elbow
#

@solar whale well, it avoids the problem of a stuck bus

solar whale
#

agreed -- but only for bitbang -- I guess thats a good thing.

stuck elbow
#

I think the hw i2c also attempts to reset the bus to a known good state at the transmission start

#

I remember some discussion about it

solar whale
#

ah -- that may well be. I'll read more -- I have no objection to the timeout,. Just trying to understand it all.

stuck elbow
#

but not sure if i2c.writeto() can timeout

solar whale
#

@idle owl recently had some real problems with I2C hanging with an am2320 sensor - that was HW I2c.

manic glacierBOT
stuck elbow
#

the i2c spec is lacking in that regard, the smbus spec fixed that

manic glacierBOT
solar whale
#

@stuck elbow thanks for the clarification

stuck elbow
#

this is the i2c spec, btw

solar whale
#

thanks - I've been wading through it.. Much more to study.

stuck elbow
#

4.2.2 Time-out feature
SMBus has a time-out feature which resets devices if a communication takes too long.
This explains the minimum clock frequency of 10 kHz to prevent locking up the bus. I 2 C
can be a ‘DC’ bus, meaning that a slave device stretches the master clock when
performing some routine while the master is accessing it. This notifies the master that the
slave is busy but does not want to lose the communication. The slave device will allow
continuation after its task is complete. There is no limit in the I 2 C-bus protocol as to how
long this delay can be, whereas for a SMBus system, it would be limited to 35 ms.
SMBus protocol just assumes that if something takes too long, then it means that there is
a problem on the bus and that all devices must reset in order to clear this mode. Slave
devices are not then allowed to hold the clock LOW too long.

solar whale
#

That explains o lot of the "note" I have been seeing about minimun clock rates.... thanks

stuck elbow
#

we also have some default we could use for the timeout in there

solar whale
#

you mean 35ms?

stuck elbow
#

yeah

manic glacierBOT
#

@deshipu note this in the I2C spec https://www.nxp.com/docs/en/user-guide/UM10204.pdf

SMBus has a time-out feature which resets devices if a communication takes too long.
This explains the minimum clock frequency of 10 kHz to prevent locking up the bus. I 2 C
can be a ‘DC’ bus, meaning that a slave device stretches the master clock when
performing some routine while the master is accessing it. This notifies the master that the
slave is busy but does not want to...
slender iron
manic glacierBOT
lone sandalBOT
undone scaffold
#

What version of gcc are we supposed to have on OSX to be able to build circuitpython? I'm getting

cc1: error: -Werror=lto-type-mismatch: no option -Wlto-type-mismatch
cc1: error: -Werror=lto-type-mismatch: no option -Wlto-type-mismatch
make: *** [build-gemma_m0/genhdr/qstr.i.last] Error 1

with

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

solar whale
undone scaffold
#

yeah, currently updating brew + reinstalling the gcc arm toolchain on the 🐌 conference wifi. i'll check if it's >6 when it finishes

solar whale
#

Mine shows 7.2.1

undone scaffold
#

It just finished (brew update then brew cask reinstall gcc-arm-embedded) but still have

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

solar whale
#

but you are using arm-none-eabi-gcc for building CP

#

try arm-none-eabi-gcc -v

undone scaffold
solar whale
#

that looks good!

undone scaffold
#

Is there a flag I should be setting to tell it to use that compiler?

#

I don't know what version of arm-none-eabi-gcc I had before I updated again just now

#

I'll try again

solar whale
#

If you just updated - try opeing a new terminal session to refresh your environment. how are you building -- should be just make BOARD=gemma_m0 clean ; make BOARD=gemma_m0

undone scaffold
#

oh i didn't clean between trying again

#

i just ran make BOARD=gemma_m0 again in circuitpython/ports/atmel-samd

#

trying again 🔄

solar whale
#

also after cloning, didi you run git submodule update --init --recursive

undone scaffold
#

yes

#

i ran all the steps but I missed brew update, but it looks like it worked this time

#

thanks!

solar whale
#

not sure about the rosie stuff - I don't see any attempt to do that.

undone scaffold
raven canopy
#

IIRC, tannewt's physical Rosie setup has been down. Not sure if that is the cause of the Travis fail, though. I have ignored rosie-related messages tbh.

undone scaffold
#

Oh, that'd probably do it

#

lol I was hoping I could be lazy and just download the binaries travis made instead of building it myself

raven canopy
#

There is a nightly build on an AWS..

undone scaffold
#

I meant the build from my PR

raven canopy
#

Ohh.

solar whale
#

ah - I build locally without travis so I don't see that -- only invoke travis when I push to my github repo.

tidal kiln
#

@slender iron responded to forum post. decided to also move it.

manic glacierBOT
#

We could deal with the 1970 epoch on all platforms if we don't mind losing accuracy as time goes on by allowing floats. This is similar to what time.monotonic() is currently doing by returning a float uptime. The larger the value, the less precise it'll be. :/ Currently that appears to put the resolution at a little over two minutes.

>>> now = 1526400902.0523624
>>> now
1.5264e+09
>>> '%0.9f' % now
'1526401042.938232421'

(that was on my M4 with 3.0.0-a6)

Whenev...

idle owl
#

@solar whale Vindication! (Kidding.) I'll ping you when I'm home again for more details about the AM2320 sensor issues you had.

solar whale
#

Not to get your hopes up _ I did not reproduce the problem you had, butI think I see how it can occur if the sensor is misbehaving. I'll look at it more and we can chat when you have time.

idle owl
#

Perfect. I had new problems at the end so you having any issues at all is still vindicating.

manic glacierBOT
jagged crown
#

@stuck elbow: I used the tutorial on the essentials page for CircuitPython,, and my ring won't run oddly enough

stuck elbow
#

@jagged crown that's very unfortunate, but chances are that there is some mistake somewhere, can you tell us what you did exactly so that we can see it and possibly correct it? Can you make a photo of your setup?

jagged crown
#

Physical Connnections: Red to 5V, Black to GND, and Yellow (Data In) to Pin 13

#

The only change I did to the code was have the pixel pin to 13, and number of pixels from 8 to 12.

#

`# CircuitPython demo - NeoPixel

import time
import board
import neopixel

pixel_pin = 13
num_pixels = 12

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False)

RED = (255, 0, 0)
YELLOW = (255, 150, 0)
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)

while True:
pixels.fill(RED)
pixels.show()
time.sleep(1) # Increase or decrease to change the speed of the solid color change.
pixels.fill(GREEN)
pixels.show()
time.sleep(1)
pixels.fill(BLUE)
pixels.show
time.sleep(1)

color_chase(RED, 0.1)  # Increase the number to slow down the color chase
color_chase(YELLOW, 0.1)
color_chase(GREEN, 0.1)
color_chase(CYAN, 0.1)
color_chase(BLUE, 0.1)
color_chase(PURPLE, 0.1)

rainbow_cycle(0)  # Increase the number to slow down the rainbow

`

stuck elbow
#

can you change it and use a different pin?

jagged crown
#

I don't know if updating the library was a bad idea....

#

I tried 8 and 5, and nothing....

stuck elbow
#

pin 13 has a LED on it, that migth interefere...

jagged crown
#

the ring does work though, I've used with my other Arduino boards

manic glacierBOT
stuck elbow
#

you can always go back to the previous version

manic glacierBOT
cunning trail
#

@jagged crown try pixels = neopixel.NeoPixel(board.A1, num_pixels, brightness=0.3, auto_write=False) Something I realized when I couldn't get servos to work and I dunno if something in Circuit Python that the normal digital pin number is not used.. Substitute the board.A1 or what you are using in there and the external neopixels should work. Good luck.

stuck elbow
#

ah, I totally missed that

manic glacierBOT
stuck elbow
#

you should have gotten an error about it, though

#

not just "nothing"

manic glacierBOT
#
Adafruit CircuitPython 3.0.0-alpha.6-86-g1b4e064-dirty on 2018-05-15; Adafruit Gemma M0 with samd21e18
>>> 
>>> import precise_time
>>> import time
>>> time.monotonic();precise_time.monotonic()
49.099
49100
>>> time.monotonic();precise_time.monotonic()
52.188
52189
>>> time.monotonic();precise_time.monotonic()
54.439
54440
>>> time.monotonic();precise_time.monotonic()
57.65
57651
>>> time.monotonic();precise_time.monotonic()
67.481
67482
>>> time.monotonic();precise_ti...
cunning trail
#

@stuck elbow I think some of the older guides or ones that have been updated had examples( I was following gemma guide?) where the plain digital pin number was used. It must have changed as Circuit Python matured. I don't recall that there were any error or notifications with the mismatch.

manic glacierBOT
stuck elbow
#

@cunning trail it might have been MicroPython guides

#

if there is no error, that's a bug — we should fix that

manic glacierBOT
timber mango
#

I'd be surprised if there was a way to notify the end-user, short of validating their input for a rather wide variety of cases.
It just takes experience to know not to call it by the D number, but to use the A number, for that.
wrt

 pixels = neopixel.NeoPixel(board.A1, num_pixels, brightness=0.3, auto_write=False)
#

If you type neopixel.NeoPixel(board[TAB] and it shows a completion, and you use that completion, but it does not do what you thought it would do, either (as the authorative Programmer) remove it from the list of tab completions, or inform the user (through social means) not to do that. ;) IMO, of course.

stuck elbow
#

you throw a runtime error

timber mango
#

If it's convenient. Can you really test for this easily?

stuck elbow
#

sure, you can check the type of the object passed

#

in fact, you actually must do it

#

so I'm surprised it didn't throw an exception

timber mango
#

Interesting! More than I know about it.

manic glacierBOT
manic glacierBOT
lethal abyss
#

@stuck elbow I received my uGame 10 yesterday, and successfully used the embedded main.py to check buttons, buzzer and screen. all with Mu 1.0b15 ! Great!

stuck elbow
#

awesome

#

let me know if you have any problems with the games

#

I need to finish the menu for selecting games — then you can have multiple games on it at once

manic glacierBOT
jagged crown
#

I just now saw all the responses, which confirmed what I just did. When I look through other examples, I did see some call the GPIO Pins with the D for Digital or A for Analog

#

I wonder though, why have the onboard NeoPixel tied to A1? I mean it's also labelled as "40" on the board....could it be D40?

#

All I did to modify the code was change
pixel_pin=board.A1
to
pixel_pin=board.D6 and it worked!

#

And I tested changing the 6 to other pin numbers, and as the code on the essential guide promises, the NeoPixel Library works for all 13 GPIO Pins!

idle owl
#

That's great that you got it working! Regarding pin assignments, the pin names are arbitrary. For example, on Circuit Playground Express each pin is labeled A#, and they all have digital capabilities. I'm coming to this conversation late. What board are you using?

jagged crown
#

Its one of the Metro Express Boards

#

I think it's the M4, but I forget the chip's number

idle owl
#

Ah ok

#

There's less pin overlap on that board.

stuck elbow
#

what text do you get when you start the repl?

idle owl
#

So ignore where I was going with it.

stuck elbow
#

it should tell you the board name and the version of circuitpython

jagged crown
#

Found the correct board name, it's the M0 with the ATSAMD21G18 chip. Gotcha

#

I was wondering about something, can CircuitPython read user input?

tidal kiln
#

like from the keyboard?
result = input("Enter something:")

jagged crown
#

yes

tidal kiln
#

give input a try. the phrase in () is used as a prompt. whatever they type in gets returned in result

raven canopy
#

😬 that feeling when you start the first build of a new module
🤞 i actually know how to read datasheets. haha

raven canopy
#

hehe. yeah.
build #1 had silly "duh" errors.
build #2...."why do i even attempt this stuff?" lol

solar whale
#

"builds character" 😉

solar whale
#

Good luck @raven canopy 💤 here

raven canopy
#

thanks @solar whale. #2 was actually just cascading "duh" errors too. night! 💤

manic glacierBOT
#

current master fails building esp8266

GEN build/genhdr/qstr.i.last
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
../../py/moduerrno.c: In function 'mp_errno_to_str':
../../py/moduerrno.c:106:18: error: 'EPERM' undeclared (first use in this function)
             case EPERM:  return MP_QSTR_Permission_space_denied;
                  ^
../../py/moduerrno.c:106:18: note: each undeclared identifier is reported only once for each function it appears in
../../py/moduerrno.c:107...
solar whale
manic glacierBOT
slender iron
#

@solar whale my read of it is that they need to do a filesystem erase

solar whale
#

but they can't get to bootloader? and I'm trying to find out if the can get to REPL - if so storage.erase_filesystem() should work

slender iron
#

double tap can be tricky sometimes

#

could try getting to the bootloader from circuitpython rather than double tap

solar whale
#

Is that available in 2.3.1?

slender iron
#

I think so

solar whale
#

Ok - I have to go to a meeting - will check later once I find out if they have REPL on that board. Hard to coach double tapping via the forum 😉

slender iron
#

@solar whale thanks. I subscribed too so I can chime in

tulip sleet
#

I just posted an answer

#

with some questions too

tidal kiln
#

@solar whale sounds like they have additional hardware attached (featherwing adalogger), have them remove all that and anything else so it's just a feather m0 express and a USB cable, so no possible hardware interference weirdness, then try to get into bootloader with that as a sanity check

solar whale
#

@tidal kiln goos point - I think they already took the adaloger off, but it's been hard to get a clear picture...

#

you are much more patient on the forums than I am 😉

tidal kiln
#

maybe ask for a photo also

solar whale
#

@tidal kiln would you mind stepping in?

tidal kiln
#

already lots of posters. you can proxy if you want.

solar whale
#

ok -- will see how the poster responds to Dans suggestions.

idle owl
#

@ruby atlas Excellent

#

So let's talk about LED animations! My original thought came out of teaching someone MakeCode. MakeCode has built in animations called things like "comet" and "theatrechase" that you can call with one line, something like animation.comet(speed) or some such. For us to do that is a lot of code in CircuitPython. So I was thinking we could create a library with these animations included, where you can import the lib as animation or something, and then call it with a single line of code.

#

We wanted to keep it separate from NeoPixel because we also have DotStars. So that way we could use it on either type of LED.

ruby atlas
#

Yeah! Fully love that idea - i've been thinking about how to make animations accessible to newbies. In addition to canned animations like comet or chases, i'd also love to have a colour loop generator helper - that could generate one pixel or many pixels.

idle owl
#

Oooh keen

#

We also wanted to include color variables so people can use red or blue instead of the tuple.

tidal kiln
#

how would you make the animation lib aware of the neopixel or dotstar hardware?

ruby atlas
#

In my ideal world, you'd say animation.colorloop([RED, GREEN, PINK, BLUE]) and it would work out a smooth cycle for you.

#

@tidal kiln I think that'd be another abstraction that consumes from the loop generator.

idle owl
#

@tidal kiln I think you'd still import NeoPixel into your code and then you'd provide the animation.foo to pixel

tidal kiln
#

pass it in when creating?

idle owl
#

hmm

#

Yeah not sure. Maybe we would do setup in the animation library to have it be standalone

ruby atlas
#

probably. i think once we build some building blocks, we'll start to refactor to make it simpler to use.

idle owl
#

try for one, except to the other.

#

or something like that.

ruby atlas
#

I need to get myself a few neopixels.

idle owl
#

That was the only tweaky thing about calling it LED_Animations was that we also wanted to have color variables in it to use with pixel so hmm.

#

Oh you should have mentioned! I wish I'd known. I think I had one ring left.

#

Or not lol

ruby atlas
#

in pseudocode, i foresee doing something like, for a single dotstar:

    pixels[0] = pixel
    time.sleep(0.1)```
idle owl
#

So you have a Gemma, which has one DotStar on it, so you can at least test with one LED.

ruby atlas
#

yep!

idle owl
#

Keen 😃

ruby atlas
#
    pixels = new_pixels 
    time.sleep(0.1)```
#

(again not likely to work quite like that)

idle owl
#

Ok. Yeah

#

I'd almost want to try to make it more simple than that

ruby atlas
#

ideally we'd have an easier way to setup timing and pixel assignment so that users can easily check inputs every cycle.

tidal kiln
#

or? (thinking out loud)

strip = neopixel.NeoPixel(blah blah)
comet = animation.Comet(strip, other stuff?)
comet.go(color, speed, etc)
idle owl
#

Just call the animation.colorloop

#

Yeah! Generators for the win there.

#

I like it @tidal kiln

ruby atlas
#

but i think having the colorloop generator accessible w/o having it do other stuff will make it more generic.

#

but have helpers like your pseudocode @tidal kiln

idle owl
#

Ok yeah!

tidal kiln
#

i'm thinking very simple / blocking

idle owl
#

Hmm. So maybe we have both options, because people love rainbows, and non-blocking rainbows are great.

ruby atlas
#

and comets are also awesome

#

as are spinning dots

#

etc

idle owl
#

Yep!

ruby atlas
#

so animation.generators.comet(), animation.generators.loop(), etc.

idle owl
#

If we can make it non-blocking in the background and have setup be super simple, then we've nailed both situations

ruby atlas
#

which then get used by the easy to use interfaces in animation.Comet() etc.

idle owl
#

If you'd like to see the MakeCode examples, there's a simulator in MakeCode that shows a Circuit Playground Express and you can call each animation and it will play out on the simulated board on the left side. It won't help you with coding it because all you ever see is the simple setup even if you check the javascript backend. But it might give you some ideas.

#

I have some of this stuff done up in CircuitPython already spread over a few projects.

#

Including a rainbow generator.

ruby atlas
#

That'd be a wonderful starting point. I doubt i'll get to work on this on the planes, but I might try 😃

idle owl
#

😃 Excellent!

ruby atlas
#

Did you have some links to the rainbow generator code or other things you think i should look at?

idle owl
#

Yep! Give me just a minute and I can link you to a couple of pieces of code.

opaque patrol
#

Yay, my μgame finally arrived

manic glacierBOT
timber mango
#

@solar whale @slender iron @tulip sleet @tidal kiln I would keep in the back of my mind, damage from a soldering iron (or other physical trauma to the target) as well as Operating System issues on the host PC.

I have trouble believing that rewriting the bootloader is going to solve this. ;)

slender iron
#

@timber mango my guess is that its the filesystem too. (not the bootloader)

tidal kiln
#

@timber mango good points, and another reason why photos are so useful. (i also doubt it's the bootloader)

timber mango
#

Yeah photos on the cheap (and available immediately) are still new enough to me that I don't think of leveraging them. They can help lots.

#

The only thing I'm confused about is how an OS issue would be target (stamp) specific -- lets one target board access the boot volume, but will not allow another (seemingly identical) target to do so.
I don't know enough to suggest that as a possibility.
EDIT: then there's this:
⁤ Grice argued that interpreting the meaning of utterances is only possible because listeners implicitly assume that speakers intend their utterances to be responsive to the surrounding discourse, relevant, and (for the most part) truthful.
from
http://cogweb.ucla.edu/Debate/CEP_Gould.html

Not directly applicable here, but I don't know another quick reference that asks us to consider the source of the facts and look for omission of important details.
Also it's a fun article in its own right. ;) /did_I_back_away_far_enough?

idle owl
#

@ruby atlas Ok. So here's some random color modes for one project: https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/LED_Trampoline/LED_Trampoline.py
Here's code that uses a rainbow generator:
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/Hacking_Ikea_Lamps_With_CPX/CPX_Spoka_Motion_Lamp.py
The first one has the cycle_sequence() written differently and is a better version of it. We had to add that because there's no itertools so it's basically a helper function taking the place of itertools so the generators can continue indefinitely instead of stopping at the end of the iteration.

#

The sparkle_code() was initially also written as a generator, but ended up requiring lambda to work and it got too complicated for the guide. Turns out it worked so quickly that it didn't matter, it was basically impossible to humanly-provide it input that was faster than it was occurring, so it didn't need a generator anyway.

#

That has a sort of rainbow comet in it, it's done a little strangely, but it works. There might be a better way to do that one.

#

The "comet" on MakeCode is an LED of some color with a tail that gets progressively dimmer, if I remember correctly.

#

Theatre_chase looks a lot like the "chase_mode" in the LED Trampoline code I linked earlier. Except that code starts at both ends and meets in the middle instead of chasing from one end to the other, which is probably easier to code, and makes more sense for the lib.

#

There's a "sparkle" in MakeCode as well that's a single color that randomly sparkles around the strip of LEDs, not as fancy or as involved as the sparkle_code() in the LED trampoline code.

ruby atlas
#

Thanks for all the links! I'll grab all that code before the flight.

idle owl
#

Nice!

manic glacierBOT
idle owl
#

@slender iron I updated the pylintrc that we plan to use with the Learn System repo. I included a majority of what Craig suggested. I left out anything he said could/should be refactored, including things he said he didn't have the eq to test etc. The last thing Dylan wanted looked at was the script they wrote for checking files for the circuitpython.skip tag that Ladyada asked be ignored. Can you take a look at the PR? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/164 If the script is solid, then I think it's ready to be merged, as long as we're ready to do it.

#

(Dylan was the one who put in the PR)

wraith tiger
idle owl
#

Nice!

slender iron
#

@idle owl looking now. how different is it from the library pylint

idle owl
#

I left every other disable that was already in there in tact. So it has more in it than the other one did. It now also includes too-many-instance-attributes,len-as-condition,too-few-public-methods,anomalous-backslash-in-string,no-else-return,simplifiable-if-statement,too-many-arguments,duplicate-code,no-name-in-module,no-member, and has on the end: --msg-template='{path} {line}: {msg} ({symbol})' */*.py which apparently makes it better list the file names that it's finding (this was from Craig: "For an unknown reason some pylint errors weren't listed next to the correct file that they were in. I've modified the pylint output so that you can see the path to the file that has the problem."

#

The things I added were determined by Craig to be pylint not able to deal with CircuitPython issues, or disabling a couple of things that could be refactored but are actually easier to read for beginners if we disable the pylint error.

#

I left out some of this suggestions if he said that it could be refactored but he didn't have time to test it, or didn't have the eq to test it.

#

Because we can do testing as we start in on this.

#

I did not remove any of the library pylint disables.

slender iron
#

it looks good to me

idle owl
#

Ok. Good to merge then?

slender iron
#

yup, good to me

idle owl
#

Excellent

slender iron
#

any idea where craig is at on fixes?

manic glacierBOT
#

OK simple fix:

jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/circuitpython_jerryn/ports/esp8266$ git diff
diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h
index 616e987..907a4cb 100644
--- a/ports/esp8266/mpconfigport.h
+++ b/ports/esp8266/mpconfigport.h
@@ -28,7 +28,7 @@
 #define MICROPY_ENABLE_SOURCE_LINE  (1)
 #define MICROPY_MODULE_WEAK_LINKS   (1)
 #define MICROPY_CAN_OVERRIDE_BUILTINS (1)
-#define MICROPY_USE_INTERNAL_ERRNO  (1)
+#define ...
idle owl
#

Nope, other than what's in the commits.

cunning trail
#

@idle owl I was reading back... For your proposal of neopixel/dotstar animation library for Circuit Python, might I suggest you first take a look into the available functions in the FASTLED neopixel library - arduino. A lot of the basic and more advanced animation functions you usually want are there. Some are based on high level math (interpolation ,gamma correction, etc. for smooth transitions, fade, color palettes, etc.)which they tried to bake into the library. There is a FASTLED community that is developing it and may be worthwhile to tap into it.

idle owl
#

@cunning trail Thanks for the suggestion! I think we already have an iteration of FastLED for CircuitPython. Looking at it, we have some helper functions anyway, as a part of FancyLED. I'm looking at our guide for it now, and there's mention of what about all the cool noise and wave functions and other features of FastLED, and the response is not implemented yet, but may be added in the future. Might still be worth looking into. Thanks!

#

@ruby atlas There's also this: https://learn.adafruit.com/fancyled-library-for-circuitpython/overview, the code for the lib is stored here: https://github.com/adafruit/Adafruit_CircuitPython_FancyLED/tree/master/adafruit_fancyled I think we're going for something a little simpler with our lib, but it might still be worth looking at.

manic glacierBOT
idle owl
#

@slender iron Thanks for looking at the PR. I'm really excited about having that now 😃

slender iron
#

me too!

idle owl
#

It's about to be Breakin' 2: Learning Guide Repo and it's going to be brilliant 😄

slender iron
#

yup totally

#

@solar whale just waiting for travis now

harsh plume
#

Hey @slender iron , sorry to not search this up, but is there any demo circtuipython code for a circuit playground express?

slender iron
harsh plume
#

yess, thank you

#

I finally found a nice integreation for us to try oje of thes eout in a students art project.

#

one of htese out*

slender iron
#

nice!

#

let us know how it goes

manic glacierBOT
slender iron
idle owl
#

I've got one somewhere here.

slender iron
#

@knotty cypress I canceled your travis build to free up jobs for @ruby atlas 's PR that frees up space

knotty cypress
#

ok

timber mango
#

With the GPS already having a fix/solution, gps_simpletest.py reports correct time, lat/long and altitude with that patch applied. 3.0.0.Alpha 6.

idle owl
#

You got to the same place I did, @timber mango. Thanks!

timber mango
#

You're very welcome, @idle owl. I already had the hardware setup (feather M0 Express).
I did not try it without a fix and I'm not sure what we're testing for. ;)(

#

I replaced the old .mpy with the new one after using mpy-cross on it.

slender iron
#

@timber mango thats good enough for me

#

thanks for the test!

timber mango
#

You're welcome! Love the GPS. -`ღ´

raven canopy
#

@idle owl + 💯 for obscure movie reference!!! 😄

knotty cypress
#

womp womp. @ruby atlas

idle owl
#

@raven canopy Thanks 😄

manic glacierBOT
slender iron
#

@knotty cypress I just merged @ruby atlas 's awesome change

knotty cypress
#

ill pull it in

manic glacierBOT
raven canopy
#

@slender iron got a moment to help me understand .subscr in an mp_obj_type? keep getting build fails for "incorrect pointer"...

slender iron
#

sure!

raven canopy
#

sweet. getting the vagrant spinning to grab exact error. here is what i have at the shared-bindings level:

STATIC mp_obj_t frequencyin_subscr(mp_obj_t self_in) {
    pulseio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in);
    raise_error_if_deinited(common_hal_pulseio_frequencyin_deinited(self));
    return MP_OBJ_NEW_SMALL_INT(common_hal_pulseio_frequencyin_get_item(self));
}

const mp_obj_type_t pulseio_frequencyin_type = {
    { &mp_type_type },
    .name = MP_QSTR_frequencyin,
    .make_new = pulseio_frequencyin_make_new,
    .subscr = frequencyin_subscr,
    .locals_dict = (mp_obj_dict_t*)&pulseio_frequencyin_locals_dict,
};
#

note: i haven't pushed to my fork yet. i can if that's simpler for you to see the whole picture...

slender iron
#

my guess is that the function signature doesn't match the type

#

why are you adding it? do you need frequencyin[0]?

manic glacierBOT
covert birch
#

hi y'all. huge thanks to all who helped me - @idle owl , @tulip sleet , @tidal kiln with my servo and pot code - i used it last weekend with no problems. i am still working to add a visual graph of servo speed and position, based on pot values and have been playing with some of @umbral dagger 's dotstar files, but keep getting memory allocation errors. can anyone be of assistance?

umbral dagger
#

@covert birch Make a local copy of the dotstarlib and rip out what you don't need starting with the font/text stuff.

covert birch
#

ok, i'll try that. thx @umbral dagger

umbral dagger
#

@covert birch It's pretty memory intensive

tidal kiln
#

are you using a .mpy version of the library?

umbral dagger
#

@covert birch Life will be unicorns and rainbows once everyone has M4 boards.

covert birch
#

i got the dots example to work with my servo and pot code, but anything else gets that error

onyx hinge
#

Articles about PyCon are starting to come up on lwn. I'm a subscriber, so if you'd like me to share a "subscriber link" for any of the articles covering the event, just ask. (a subscriber link lets the recipient read the article even when it's still marked with "[$]" for subscriber-only content) Articles like this one: https://lwn.net/SubscriberLink/754163/f312492d8e30bb0f/

covert birch
#

@umbral dagger , this isn't really the best time for me to spend on this project, but i wanted to go forward while it was fresh to me since i was able to use it last weekend, but i have no use for it for the time being - do you suggest i wait for m4 to come out so i won't be so consumed with troubleshooting? my main concern is having to restart my circuitpy learning curve

umbral dagger
#

@covert birch What capabilities of the dotstar wing do you need? What can you remove from the lib? To @tidal kiln 's point, you can pre byte compile it to squeeze out a bit more space. When I worked on the game, I got rid of the font other than digits. I probably (forget now) stripped out other stuff I didn't need.

#

@covert birch It's an interesting exercise in optimization 😃

#

I don't know what the time frame is for M4 boards. A few beta Metros are in the wild, and Feathers are being worked on (from the Leeks a few days ago).

covert birch
#

@tidal kiln no, not .mpy but .py. @umbral dagger well, i'd love to make this work with my feather mo so i don't have to keep buying new stuff. i had this thing originally set up on arduino and moved to feather to learn a little about circuitpy and to see if i could get better control of the servo and finer detail for the graph. what i had in mind for the dotstar is to have sort of a bar graph to reflect the speed and direction of the servo, so i was attracted to the animation example, but perhaps there is a better way. so far in modifying the lib file, i've removed the font references. it loaded ok, but changes to my code didn't work

umbral dagger
#

You can probably just use the shifting stuff if you want a scolling graph like the plotterin Mu.

covert birch
#

@umbral dagger that's what i was thinking too, tho i have no idea how to make that work yet - i was just trying to get the lib to load without mem errors first. is it possible that the colors of the dot star be mapped to the pot value?

#

along with the servo

#

btw, the lib is working and i got the circle shift code pasted into my servo and pot code and it loaded fine

#

so, now i just need to adjust the image of the circle and get the shifting to correspond to the pot value...

timber mango
#

@covert birch Adafruit has been putting out Metro M4 Express boards in small batches about once a week. They've been available for more than 12 hours at a time before they get sold out, so if you check every day, 12 hours apart, you won't miss out on an opportunity to get one (and only one; they're one to a customer at the moment). http://adafru.it/3382

covert birch
#

thanks @timber mango , but i got the streamlined lib to work on my feather mo, so i am going to keep working on this for now, as long as it is capable

timber mango
#

Yeah, I think comments may count as occupied memory in .py (but not in .mpy?)

covert birch
#

i did delete all the header comments thinking that may be the case

#

it was at least 10-15 lines

timber mango
#

M4 has six times the SRAM that M0 has, for working memory.

covert birch
#

wow, that is impressive. i can always update my board later i suppose

timber mango
#

It's also got a faster system clock. When I blinked my D13 LED I didn't immediately understand why it didn't blink visually. Was too fast!

covert birch
#

haha that's great

timber mango
#

show and tell-time

covert birch
#

yep

ruby atlas
#

I can't wait to get home and put in an order for a variety of things! 😃

slender iron
#

😄

ruby atlas
#

Half way there.... Next flight isn't long from now.

idle owl
#

Nice!

ruby atlas
#

I did a little experimenting earlier, - tried to avoid reinventing the wheel by using adafruit_fancyled palette_lookup and just couldn't find an intuitive way to get great looking smooth colour cycles using it as a basis... So I'll probably end up reinventing the wheel somewhat for the color cycling stuff i hope to work on.

slender iron
#

having more than one library to do something is ok with me. that way we find the easiest way

idle owl
#

We can also discuss it when you're home, because we've done up some tricks to make things more smooth in different situations.

ruby atlas
#

😃 dabbling with Animating RGB(W) LEDs reminds me a lot of some of the very first things I spent months fiddling with as a kid - drawing random art using gwbasic

idle owl
#

nice 😃

ruby atlas
#

(sadly that was in 4 brightness levels on an amber monitor)

idle owl
#

Well now you can have it live up to all your childhood dreams 😄