#circuitpython-dev

1 messages · Page 183 of 1

craggy nacelle
#

Hopefully a quick question, here: Is Circuit Python based on a paticular version of Python? like 2.7 or 3.x?

solar whale
#

@craggy nacelle it is based in Python 3

craggy nacelle
#

thanks

manic glacierBOT
#

This will generate a hard fault:

import analogio
analogio.AnalogIn.value

Similarly true for storage.VfsFat.label, touchio.TouchIn.value, etc.

The problem is that instead of returning a property object, the reference to the property actually calls the get function for the property, passing in self=0x0.

Some things don't crash because they actually ignore the self value, e.g. microcontroller.Processor.temperature, but that actually returns the temperature, which i...

tulip sleet
#

@craggy nacelle 3.4, specifically, but it's not complete 3.4.

craggy nacelle
#

Okay, Thanks @tulip sleet

abstract pawn
#

How do I get the mcp9808 library onto my Feather M0 Express? I tried installing the CircuitPython Library Bundle but I must be doing it wrong because I keep getting this: ">>> import adafruit_mcp9808
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'adafruit_mcp9808'"

tidal kiln
#

@abstract pawn how did you install the bundle?

thorny bear
#

this might be a better place to post this: I'm trying to get a ili9341 display working on a Metro Express in CircuitPython. I'm able to print text following this: https://learn.adafruit.com/micropython-displays-drawing-text/overview however the text is VERY small. Does anyone know how to make the text bigger?

I'm currently using
bf = bitmapfont.BitmapFont(240, 320, display.pixel)
bf.init()

bf.text('Hello, World!', 0, 0, color565(255,0,255))
to print the string.

How to write text on any MicroPython display.

abstract pawn
#

@tidal kiln I dragged the "libraries" folder onto CIRCUITPY. The instructions said there would be a "lib" folder but there wasn't so I tried "libraries" Do I have to rename it or what?

tidal kiln
#

yep. it needs to be called lib.

abstract pawn
#

but is that the right folder?

tidal kiln
#

what did you download that had something called libraries in it?

abstract pawn
#

Adafruit_CircuitPython_Bundle-master.zip

tidal kiln
abstract pawn
#

OK, so I downloaded "adafruit-circuitpython-bundle-3.x-mpy-20180714" and unzipped it and inside there is a folder called "libraries" No "lib"

#

Never mind

#

There is another folder NOT inside called "lib"

tidal kiln
#

that's the one you want

abstract pawn
#

Argh! It won't let me put it on CIRCUITPY.

#

I will try and move its contents into the existing lib

tidal kiln
#

is it acting like it's read only?

#

it = CIRCUITPY

abstract pawn
#

will it might be but it let me copy into the lib folder.

#

YAY!

#

Thanks for your help.

#

It would probably be good if somebody updated the guide with the new URL...

tidal kiln
thorny bear
#

@tidal kiln if you have any time once you get Gordie up and running, do you think you could help with my text issue?

tidal kiln
#

@thorny bear i'm not sure what the state of support for that is in circuitpython....let me check....

thorny bear
#

awesome, thank you!

#

That's what sent me to the first link if that helps

#

I can do everything in that tutorial - fills rectangles etc... but the text font is freakin tiny - presumably because it's made for the charlieplexed leds... if there was a way to make the font file bigger....

#

font5x8.bin... that's the guy...

#

If I could make a font10x16 for example, I think I'd be fine...

#

@tidal kiln not sure if that's helpful or not, but it does seem like making a new font file would be the easiest path to done-ness.

abstract pawn
#

@tidal kiln DOH! Somehow I got onto the CircuitPlayground Express page.

tidal kiln
abstract pawn
#

That's the one.
"You can grab the latest Adafruit CircuitPython 2.x Bundle release by clicking this button:

If you need another version, you can also visit the bundle release page which will let you select exactly what version you're looking for, as well as information about changes."
I needed another version (3) so I clicked that link instead of the huge green button.

#

Nope

#

I must have done something else because that link does go to the right place.

tidal kiln
#

if you find it again, post it here, we'll take a look

abstract pawn
#

I think I downloaded this one instead of 3.x :
adafruit-circuitpython-bundle-py-20180714.zip

#

Not sure how I got there.

tidal kiln
#

@thorny bear how were you drawing text?

thorny bear
#

I'll repost 1 sec...

#

import board
import busio
import digitalio
import bitmapfont

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

For the Metro

cs = digitalio.DigitalInOut(board.D10)
dc = digitalio.DigitalInOut(board.D9)

from adafruit_rgb_display import ili9341, color565
display = ili9341.ILI9341(spi, cs=cs, dc=dc, width=240, height=320)

display.fill(0)

bf = bitmapfont.BitmapFont(240, 320, display.pixel)
bf.init()

bf.text('Hello, World!', 0, 0, color565(255,0,255))

tidal kiln
#

how did you get bitmapfont to load?

thorny bear
#

ah! so there's some kinda error like u....something won't load?

#

is that what you hit?

#

ustruct...

tidal kiln
#

yep. i think maybe this stuff hasn't been updated for CP yet.

thorny bear
#

I did that and it started working.

#

which is great... if you're an ant

tidal kiln
#

ah. so you edited the .py file in the library and changed it to use struct?

thorny bear
#

well I did it like in the fix... try the one and if that doesn't work use the other but basically, yeah

#

+try:

  • import ustruct as struct
    +except ImportError:
  • import struct
tidal kiln
#

cool that even worked. but i think you're just working in an area that's in need of some work.

thorny bear
#

fair enough... in lieu of that - do you know how to create a different font file?

tidal kiln
#

i don't. sorry.

thorny bear
#

:/

#

hmm ok.

#

I tried a few searches for how to create bin files... but as you can probably guess, google thought I wanted to rip a cd.

#

there is a fonttobin.py that was included... but it makes no sense at all to me

#

FONT = bytes((
0x00, 0x00, 0x00, 0x00, 0x00,
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
(cut out a LOT of ... whatever that is...)

if name == 'main':
with open('font5x8.bin', 'wb') as outfile:
# Write a byte each for the character width, character height.
outfile.write(bytes((5, 8)))
# Now write all of the font character bytes.
for font_byte in FONT:
outfile.write(font_byte.to_bytes(1, 'big'))

#

If I could just have it write 4 pixels for every 1 pixel, that would probably do it

stuck elbow
#

better do the scaling on the other end

#

where it draws the pixels

thorny bear
#

@stuck elbow I'm listening... how should I do that?

tidal kiln
#

ah.... @stuck elbow is here. excellent. he can answer this way better than i can.

stuck elbow
#

so if you replace that self._pixel call with four calls, with the coordinates doubled and shifted by 1 pixel, it should get you twice as large letters

thorny bear
#

reading...

#

so, something like:
self._pixel(x + char_x, y + char_y, *args, **kwargs)
self._pixel(x + 1 + char_x, y + 1 + char_y, *args, **kwargs)
?

#

adding it in after 56

stark wolf
#

Has anyone used the RFM69 or RFM9x based radio boards with CP? Looks like the support is pretty basic but I'm curious if anyone has gotten them working well at a good distance.

thorny bear
#

ah just saw my fault there

#

that's why the 4 calls...

stuck elbow
#

I would make a function like def _pixel4(x, y, *args, **kwargs): that does self._pixel(x * 2, y * 2, *args, **kwargs) self.pixel(x * 2 +1, y *2, *args, **kwargs) etc. and call that instead

opaque thicket
stuck elbow
#

you probably also need to amend the width and height though

thorny bear
#

Ok... and you're saying to do that in bitmapfont yes?

solar whale
#

@stark wolf I have both RFM69 and RFM9x working with CP. I have not done a lot of range testing, The RFM69 is working over a distance of about 50 feet from outside to an inside room.

stuck elbow
#

@opaque thicket you can play WAV files with the audioio module, you just have to compile your version of firmware to include it (it didn't fit in the default firmware, but it will fit if you remove some other module you are not using)

opaque thicket
#

@stuck elbow - Hey, thanks! I appreciate the input! That'll get me started!

stuck elbow
#

you modify what gets included by editing thempconfigport.h file in your port directory

stark wolf
#

@solar whale thank you. I might hit you up for more info later.

solar whale
#

Thats fine -- glad to help.

thorny bear
#

@stuck elbow Curious as to why you suggest to multiply by 2 AND have the plus one...

stuck elbow
#

@thorny bear you need to multiply by 2 to make room for the extra 3 pixels

thorny bear
#

so like this:
def pixel4(x, y, *args, **kwargs):
self._pixel(x * 2, y * 2, *args, **kwargs)
self._pixel(x * 2 +1, y *2, *args, **kwargs)
self._pixel(x * 2 +1, y *2 + 1, *args, **kwargs)
self._pixel(x * 2 , y *2 + 1, *args, **kwargs)
?

stuck elbow
#

basically you start with this:

123
456

then you multiply and you get:

1.2.3.
......
4.5.6.
......

and then you add the extra pixels and you get:

112233
112233
445566
445566
#

yes

thorny bear
#

ok cool. I'll give it a shot.. thanks!

#

yeah that broke. 😃

#

checking to see why...

#

@stuck elbow it says that self isn't defined....

def _pixel4(x, y, *args, **kwargs):
    self._pixel(x * 2, y * 2, *args, **kwargs)
    self._pixel(x * 2 +1, y *2, *args, **kwargs)
    self._pixel(x * 2 +1, y *2 + 1, *args, **kwargs)
    self._pixel(x * 2 , y *2 + 1, *args, **kwargs)
stuck elbow
#

sorry, first argument should be self

#

def _pixel4(self, x, y...

thorny bear
#

got it... retrying

#

well, I asked for doubled and doubled I have...

stuck elbow
#

you can triple and quadruple in a similar way

#

probably use a loop, not copy the pixel calls

thorny bear
#

was going to ask if there's a .75 option.

stuck elbow
#

that would be tricky

thorny bear
#

but I feel like that might not be "on the menu"

#

yeah

stuck elbow
#

also the result would be blurry

thorny bear
#

right

stuck elbow
#

you can use a smaller font and double it

thorny bear
#

hehe wait a sec.... that was my question in the first place...

#

Is it possible to just use a different font?

#

like this one is 5x8, but if I had one that was, say 9x12, that'd be about perfect

stuck elbow
#

of course those .bin files have been generated somehow

thorny bear
#

yeah. that seems like a much cleaner way to do it... any idea how though?

stuck elbow
#

let me quickly try something

thorny bear
#

my google searches for creating .bin files went straight to cd-burning land... ok great...

stuck elbow
#

@thorny bear can you try this file?

thorny bear
#

hit me

stuck elbow
thorny bear
#

cool I'll find where to load it and let you know what happens shortly...

stuck elbow
#

I generated it with this code:

import struct
import os
os.environ['SDL_VIDEODRIVER'] = 'dummy'
import pygame
pygame.display.init()
pygame.font.init()
pygame.display.set_mode((1,1))

font = pygame.font.Font("pf_ronda_seven.ttf", 4)
width, height = font.size("X")
surface = pygame.Surface((width, height))
with open("pf_ronda_seven.bin", "wb") as f:
    f.write(bytes((width, height)))
    for c in range(256):
        try:
            surface.blit(
                font.render(chr(c), False, (255, 255, 255), (0, 0, 0)),
                (0, 0),
            )
        except pygame.error:
            pass
        for x in range(width):
            byte = 0
            for y in range(height):
                pixel = surface.get_at((x, y))[0]
                byte <<= 1
                byte |= bool(pixel)
            f.write(bytes(byte,))
meager fog
#

@opaque thicket you can but only really in arduino, not enough space on trinket m0 for wave and cpy audio

stuck elbow
opaque thicket
#

@meager fog - thanks! I'm just looking to randomize some audio clips in a staples "easy" button

stuck elbow
#

however, looking at the code of bitmapfont, it only works with fonts that are 8 pixels high

thorny bear
#

@stuck elbow would that work on any install?...not sure I'm saying this right... are there any libraries or whatever that I'd need to run that locally?

meager fog
#

@opaque thicket yeah an itsym0 expres would be super easy BUT you can do it in arduino

#

it just kinda sux

stuck elbow
#

it requires pygame

thorny bear
#

ok

meager fog
#

@opaque thicket want the code

#

?

opaque thicket
#

@meager fog - yes please!

meager fog
opaque thicket
#

@meager fog - Thanks so much!

meager fog
#

you'll need to convert the audio to 8 bit

#

here's a varied example

manic glacierBOT
meager fog
stuck elbow
#

@meager fog I have audioio working with cp on the trinket m0 — I just had to remove some other module to make space

meager fog
#

@stuck elbow yeah but then you need space for the clips too

#

its such a struggle i think arduino may just be best for the gemma/trinket

#

its not the worst thing ever you just have to headerify your wav

stuck elbow
#

@meager fog you can mount an sd card :)

thorny bear
#

@stuck elbow runtime error: buffer too small...

#

I need to make it bigger than 8 pixels I take it

stuck elbow
#

@thorny bear I guess I guessed the format wrong

thorny bear
#

@stuck elbow The font format is a binary file with the following
# format:
# - 1 unsigned byte: font character width in pixels
# - 1 unsigned byte: font character height in pixels
# - x bytes: font data, in ASCII order covering all 255 characters.
# Each character should have a byte for each pixel column of
# data (i.e. a 5x8 font has 5 bytes per character).

stuck elbow
#

you may be better off with your own font drawing

#

that's what I did

thorny bear
#

ah.. ok

stuck elbow
#

hmm, except I did 256 characters

thorny bear
#

d/ling

#

buffer too small

#

I think we're hamstrung by the max 8px height, @stuck elbow

stuck elbow
#

that font is 8 pixel high

thorny bear
#

oh

stuck elbow
#

can you paste the complete traceback?

thorny bear
#

😄

#

def text(self, text, x, y, *args, **kwargs):
# Draw the specified text at the specified location.
for i in range(len(text)):
self.draw_char(text[i], x + (i * (self._font_width + 1)), y,
*args, **kwargs)

#

that's 71-75

stuck elbow
#

can you paste the complete text of the error you are getting?

#

use ``` to make it formatted

thorny bear
#

code.py output:
Traceback (most recent call last):
File "code.py", line 20, in <module>
File "bitmapfont.py", line 74, in text
File "bitmapfont.py", line 57, in draw_char
RuntimeError: buffer too small

#

that's all I got... (using mu)

#

oh.. looking up where to find logs...

#

one moment

#

sorry this is local logs that I found

stuck elbow
#

that's enough, thanks

thorny bear
#

ah ok

stuck elbow
thorny bear
#

self._font.seek(2 + (ord(ch) * self._font_width) + char_x)

line = ustruct.unpack('B', self._font.read(1))[0]

        line = struct.unpack('B', self._font.read(1))[0]
        # Go through each row in the column byte.
        for char_y in range(self._font_height):
#

this is 55 to 59

#

probably different line numbers due to my ustruct tomfoolery...

stuck elbow
#

hmm, so it reads an empty string from the file

#

probably the file is too small

thorny bear
#

do you want the original 5x8 font?

stuck elbow
#

it's in the repo, thanks

#

got it, I wrote to the file wrong

thorny bear
#

downloading...

#

well... no errors... but no output either

#

Just to make sure, @stuck elbow , I went back to the old font. it still works... changed back to the new one and no output

stuck elbow
#

yeah, the file is all zeros

#

you know what, it's 5am here, I shouldn't be writing any code

thorny bear
#

lol

stuck elbow
#

I'm going to bed, I will fix it tomorrow

thorny bear
#

rgr that. thank you very much for trying!

manic glacierBOT
manic glacierBOT
#

I am a beginning user of circuit python but have some experience with micro python. Today I flashed a new Feather Huzzah with the latest V3.0.0 firmware. I was able to get to a repl prompt with screen without problems. I then tried to access the device with mpfshell but get an error on open

** Micropython File Shell v0.8.1, sw@kaltpost.de ** 
-- Running on Python 3.5 using PySerial 3.4 --

mpfs [/]> open ttyUSB0

('exception', b'', b'Traceback (most recent call last):\r\n  File...
stuck elbow
#

@thorny bear got it working

lucid mesa
mental marsh
#

Good morning, what is the highest Brightness setting we can set in CP for the smart neopixels? Not floras..

tulip sleet
#

@mental marsh brightness ranges from 0.0 to 1.0. If you omit the argument, it defaults to 1.0. RGB values range from 0-255.

#

@lucid mesa that is exactly what you want to type. --filename_prefix and --library-location are option flag names, set to adafruit-cricuitpython-ds3231 and . respectively

mental marsh
#

Thanks @tulip sleet

manic glacierBOT
#

Thanks for pointing this out. We maintain the https://github.com/adafruit/ampy program, which does some of things mpfshell and rshell do. If you'd like it to provide additional features that those programs provide, let us know in an issue.

The way this is typically handled is:

Replace

import ubinascii

with

try:
    import ubinascii
except ImportError:
    import binascii as ubinascii

We actually do it the other way round in our libraries, trying to import ...

solar whale
#

I just "discovered" a "feature" of the CRICKIT Feather board that is different from the CPX version. On the cpX version, when you power the CPX via its USB port (so you can load new code or use the REPL) the CPX is powered even if the CRICKIT is off. You can load code and use the CPX with the CRICKIT still off. This is not the case for the Feather CRICKIT.. It has the Feather board ENABLE connected to the CRICKIT power switch so if the switch is off, the Feather board regulator is also off. I think I like this, but it caught me by surprise since it is "different" than the CPX. Just a heads up for anyone else playing with it. I just tried it with a feather M0 and a Featehr M4 -- so far so good!

lucid mesa
#

thanks @tulip sleet for your respon , but can you give the example of the writer? because I feel confused.

lucid mesa
thorny bear
tulip sleet
#

@solar whale, also double-clicking will double-click both boards on the Feather Crickit, and put both in UF2 bootloader mode. so you need to reset by single click after uploading a new CircuitPython or else the Crickit is not running the seesaw code.

solar whale
#

@tulip sleet ah - I noticed that I had to reset the CRICKIT, but it did not dawn on me why 😉 thanks

#

@tulip sleet just playing with the CRICKIT featehr board with a neopixel ring. I ralized taht the brighness setting had no effect and I see now that in the seesaw library , it is not implemented. (just a pass) I s this something fundamental about the seesaw or just waiting to be implemented?

#

or is that question for Deanm

#

@tulip sleet nevermind - I see it is listed as a TODO

#

they sure are bright at 1.0 😉

tulip sleet
#

hopefully with the pixelbuf stuff we can refactor all the different RGB impls so they share common code. There's a lot of duplicated code in the seesaw neopixel impl

solar whale
#

so - if it is being reworked , it is probably not worth implementing it like it is in the neopixel.py library.

#

If you think it'll be useful, I can implement it

onyx hinge
#
>>> 2**32
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: small int overflow
``` weird I thought in 3.x the express boards got long ints.  well, this is some unknown months old build, maybe I put something nonstandard on it.
solar whale
#

works on an M4 ```Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M4 Express with samd51j19

2**32
4294967296

onyx hinge
#

.. still haven't got my library for ad9850 going reliably, there's some bug in the communication I just haven't quite fathomed yet. It uses not-quite-SPI and maybe I should just throw in the towel and bit bang it from CP. But that's so slow, sending a 40-bit frequency command one bit at a time. 😕

#

the long int part is related to getting the frequency command r ight, though I think that only affects values above 30MHz or so which are not in the range I'm experimenting with

onyx hinge
#

and of course the final missing piece was something simple, I had the wrong SPI polarity specified

#

now I just need a plan for accurate frequency arithmetic. It really needs more than single-precision floats and 30-bit ints

solar whale
#

@tulip sleet I implemented brightness for the seesaw similar to how it was done in neopixel.py -- it seems to work - should I go ahead and submit a PR to adafruit_circuitpython_seesaw or would you prefer to let this wait for the pixelbuf changes?

manic glacierBOT
#

Thanks for the response.

I will take a look at ampy. I was Just trying to use the tools I have allready learned. I’ll let you know if I have any feature requests.

I understand how to do the import to fix this in mpfshell. It’s a little trickier because mpfshell is building expressions as text strings on the host which it then passes to the target for execution. So I need to decide if it’s tidier to catch and handle the exception in the passed string or on the host. In any case if I can...

lunar crown
#

I am trying to do some realtime stuff on M4 Feather, using CircuitPython 3.0.0. I really need a timer and callback functions. Micropython seems to have what I need. I can't find anything about timers and callbacks in CircuitPython. Am I missing something, or is this missing in CircuitPython? I thought CircuitPython was a fork of Micropython.

main meteor
#

Ed Nisley's blog has some good thoughts on frequency arithmetic.

torpid goblet
solar whale
#

@tulip sleet update on the seesaw neopixel brightness -- It looks like it is not as simple as I had hoped to get it to wrok like it does in neopixel.py. My version works fine for my purposes, but can only change the brightness when a pixel is updated but not just by changing to brightness - that is because the seesaw neopixel driver does not keep a 'local" copy of the buffer. The update is done in setitem, not show. I suppose we could make a "local" copy of the buffer just like neopixel.py but that seems wasteful especially if pixelbuf will handle it better.

manic glacierBOT
#

My usability enhancement issue for today is to reduce the effort and likelihood of mistakes by reducing the number of downloads to update a board.

As I understand, A user must -

  1. Go to https://github.com/adafruit/circuitpython/releases and down a firmware build which requires two decisions, 1) type of board and 2) type of firmware.
  2. Reflash the board. UF2 is really awesome.
  3. Go to https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases , select the correctly file, down...
stuck elbow
#

@thorny bear I give up

thorny bear
#

😄

#

well I appreciate you trying'

lunar crown
#

Some useful time information, but no timers.

stuck elbow
#

@lunar crown CircuitPython doesn't support user timers

#

@lunar crown what are you trying to do? Maybe there is another way.

lunar crown
#

I have a pin with a pulse width modulated on-time of period 1 second.

#

I would like to sample it at a regular interval of 50 to 1000 times per second, over the second period to measure the On time ratio. It is a very noisy signal with a lot of false transitions. I am using the time.monotonic() function for a very simple period measurement, which only works well when the signal is perfect. The code to eliminate all the false transitions in the time domain would be quite convoluted. If I had access to the timers and a callback function, as in the Adafruit docs on the pyboard/micropython, it would be much easier.

torpid goblet
#

@lunar crown we will have to wait for someone with more experience to chime in

ruby lake
#

time to make a couple of Crow's featherwings

raven canopy
solar whale
#

@raven canopy wow - you will put a lot of "helpers" out of work 😉

raven canopy
#

nah...they'll just get to spend more time helping with better stuff. that was kattni's response to me once on "automation". 😄

solar whale
#

withe the advent of the CRIKITS anf M4's I may have to have a "yard sale" . What a nice set of tools.

sturdy furnace
#

I'm trying to play a wav file on a CPX using the audioio library.
Other files (which are significantly shorter) play fine, but when I attempt to play this it fails with ValueError: Invalid format chunk size.
(it's the mario theme song here
Is this due to the file size?

remote pike
#

I think I broke my trinket m0. I updated to to circuitPython trinket m0-3.0.0.uf2. When I tried to go back to 2.0 I installed CPlay Express by accident. Now I can't get back into boot loader mode to fix. Any way I can get it back? Thank you.

solar whale
#

@remote pike It "should" go back to the bootloader regardless of what you loaded. Try double tapping the reset at various rates to see if you can get it to start the bootloader. What OS is the computer you are using to connect to it?

slender iron
#

@lunar crown take a look at PulseIn it'll measure time between edges for you

manic glacierBOT
bronze geyser
#

I have a bad habit of bricking my itsy bitsy m0 express (itsy bitsy is stuck in code.py - lose ability to see CIRCUITPY drive on my Mac). How do you recommend getting a copy of the SPI flash erase .UF2 for the itsy bitsy m0? I see the source, but creating a make file with what i know about make would take quite a while. Ideally, there would be .UF2's for all CP boards? @tulip sleet

stuck elbow
#

I actually compiled a version of the circuitpython firmware that formats the flash — because the arduino thing didn't work for my custom boards

#

simply commented out a few ifs in the code that mounts the filesystem

bronze geyser
#

Thank you @stuck elbow . My challenge with your reply is I do not currently have the knowledge to know what lines to comment out. Then, I don't know the correct way to set up a make file to put together the right compiler and link settings. So I apologize I can't do the same as you. At least at this point.

stuck elbow
remote pike
#

@solar whale I'm using Vista. The only light on the Trinket is the green power led. I've been unable to get back to the boot loader. I've pressed the reset button like you recommended.

bronze geyser
#

@stuck elbow Ooh. your suggestion deleted code.py. This is what I wanted. Thank you.

stuck elbow
#

@bronze geyser note that this firmware will format the filesystem every time it boots

bronze geyser
#

@stuck elbow Yes. This is why I wish there was pre-compiled flash erase .uf2 for all CP boards. But, this works. And I can change back to false. Again, thank you for your help.

tulip sleet
bronze geyser
#

@tulip sleet @stuck elbow re: going into safe mode. It would be great if I could triple click my itsy bitsy m0 and get into safe mode. The DotStar should give us info that it is in this state (the same way for example it goes to white when in REPL). Another UI access would be a ctl-<char> w/in REPL.

stuck elbow
#

or even a commmand you would run to reboot to safe mode

bronze geyser
#

@stuck elbow Makes sense to me to use a command. It amazes me how this team figures out "the best way." For example, I find how the DotStar is used to debug helpful.

stuck elbow
#

I wonder, has anybody ever used the fact that it blinks out the error message?

bronze geyser
#

@stuck elbow I did.

#

@stuck elbow What I liked about it was the visual grab of my attention as code.py was running. The light wasn't green or white. So something was wrong.

#

i can see if in mu editor and constantly updating this may not be an issue...but sometimes i use atom...sometimes mu...

tulip sleet
#

@stuck elbow Do you mean a host computer command or a REPL command to get to safe mode?

stuck elbow
#

I mean something like microcontroller.reset(safe_mode=True)

#

but of course that won't work if your code made it crash

tulip sleet
#

yes, i am trying to figure out one simple way to indicate going into safe mode.

stuck elbow
#

another possibility is a watchdog being fed by the python interpreter

tulip sleet
#

uf2 bootloader -could- detect triple click, but that doesn't help existing boards without a bootloader upgrade

#

could publish a 3.x set of cpy builds that are safe mode - these don't need to be revised regularly

bronze geyser
#

@stuck elbow my challenge is i can't stop code.py from running. It has some crappy code in it that hangs CP. I can get to ITSYBOOT, but not CIRCUITPY. From my perspective, it is something outside of CP directaly related to deleting code.py/.txt or main.py/.txt

stuck elbow
#

@bronze geyser what you can do manually right now, is to check some pin at the beginning of the code, and stop (raise an exception, for example) if it's pulled low or something like that

#

of course you would need to put that in every program you write

#

but you could put it in a library, so it would be just a single line

bronze geyser
#

@stuck elbow . Good idea. In the past, I have put a time.sleep(20) ...this way I have enough time to delete the code.py file.

stuck elbow
#

or press ctrl-c, that works too

#

and adds some thrill to testing :P

bronze geyser
#

@stuck elbow I am not in Mu...it's running headless...so not clear how to ctl-c.

turbid radish
#

Happy Monday fellow Pythonistas. Thanks to all who signed up for the "Python on Microcontrollers" newsletter last week - we got 12% more subs in one week! What, you don't know about the newsletter? Ad-free, spam-free look at Python news, happenings, and peekz? Sign up now at http://www.adafruitdaily.com to check out the excitement.

bronze geyser
#

after hitting my breakpoint in GDB jlink and then hit c, i do not see a way to do a monitor reset...i have to ctl-z? or is there something i'm missing? ```debug_test_hello.lto_priv.271 () at debug_test.c:34
34 return mp_const_none;
(gdb) c
Continuing.

tulip sleet
#

@bronze geyser do "mon reset" before "c", or ctrl-C, "mon reset", "c"

#

you can ctrl-c in gdb to interrupt the program, or you can ctrl-c in the repl to stop the main.py/code.py

#

note that if you're connected via repl and you halt cpy in gdb, you'll eventually time out in the terminal program you're using to connect to the repl and have to reconnect

bronze geyser
#

@tulip sleet Thank you. I find myself killing the jlinkserver and some of the gdb goo in Activity Monitor (I'm on mac).

tulip sleet
#

yw. note that when you're in gdb, you can load a new version of the firmware with "load". Then "mon reset" and "c" will restart wit hthe new firmware. I do this a lot. Here is my .gdbinit file with some aliases for connecting to jlink, reloading, etc.

#

edit as you wish, rename it to .gdbinit, and put it in your homedir

bronze geyser
#

@tulip sleet thank you. Oooh...something new to learn!

tulip sleet
simple pulsar
#

Hello I have a problem on Circuit Playground Express. I have it running 3.0.0 and it runs code fine. I tried to plug into a rasperry pi and the pi does not see it as a memory stick

stuck elbow
#

@simple pulsar anything in dmesg?

simple pulsar
#

No, i'll check again

stuck elbow
#

also check what lsusb says

simple pulsar
#

I did go looking for a device in /dev/dsi

stuck elbow
#

the most common problem is using a usb cable without data lines...

simple pulsar
#

/dev/disk and didn't see anything in then, we tested a normal usb memory stick and that automatically mounted

#

i am using unknown usb cables - will test with mine to rule that in/out

solar whale
#

@simple pulsar on a raspberry pi the device should be /dev/ttyACM0

#

or at least that is to access the REPL -- does it show up there?

simple pulsar
#

Thanks, you were right, a cable with no data, power only. I knew they existed but never seen them and got given them by someone who should know better!

#

@solar whale thanks, that was the next thing to lookup, we are receiving data (in Koforidua, Ghana)

raven canopy
#

@tulip sleet @stuck elbow @bronze geyser I still like the idea of grounding a pin at startup to force safe mode. It works for headless, and doesn't require bootloader update or pre-thought to put in the ability to escape your program before it starts.

stuck elbow
#

@raven canopy the problem is you never know what that pin is connected to and whether it's normally pulled down

#

@raven canopy you get booby-trapped pins like on the esp8266

raven canopy
#

In the issue on the repo, Dan's suggestion of using SWDIO seems quite workable. Yes, ESP would prove the tricky one. As always. 😄

stuck elbow
#

swdio would work

#

as long as I can disable it for my custom boards

raven canopy
#

Should be able to handle it somehow in mpconfigport.

manic glacierBOT
bronze geyser
#

Wow. Pretty exciting. SWDIO pulled down worked. Thank you.

manic glacierBOT
raven canopy
idle owl
#

@slender iron Trying to run Adabot and getting a KeyError: login. Did the access token change?

slender iron
#

no. I ran it ok last night

idle owl
#

hmm

#

ok. That should mean I don't need to run it right now anyway, but still. Not great that I can't.

#

The repo was private, I think I do need to run Adabot after all.

manic glacierBOT
tidal kiln
#

hmmm. did MS just pull the plug on github?

raven canopy
tidal kiln
#

yep. looks like they're on it.

timber mango
#

@slender iron No pin?

slender iron
#

<@&356864093652516868> meeting in 20 minutes!

drowsy geyser
#

Huh. Yeah. GitHub is down. But I don't see anything internally about the status. Systems aren't really integrated yet.

idle owl
#

GitHub Unicorn! though

slender iron
#

perfect time to meet

idle owl
#

I've never gotten that fail page from them before now.

slender iron
cunning crypt
#

Boo, I'm at work and can't hop in to the CP meeting.

torpid goblet
#

Hello, Just going to listen and learn. At work so I can't give full attention:(

slender iron
#

kk

cunning crypt
#

I'll just drop my Hug Reports and Status Updates here.

#

Hug Report: Group Hug as always. Lady Ada and John Park for the fun unboxing (Funboxing?) of Adabox 008. JP did a great presentation, and it was great to be able to chat with Lady Ada about things, both relevant to the box and otherwise.

torpid goblet
#

after action review

umbral dagger
#

ok.. I can hear... gotta love discord's arcanery

timber mango
#

discord-canary's pretty good, too. ;)

drowsy geyser
#

Hi all. I'm at work and in a team space, so won't be able to talk today. I'll just type anything that I need to say. 😃

cunning crypt
#

Status Update: I soldered so many TFTs. They are annoying because so few of them sit perfectly on the first try. I have 25ish battery packs to solder on, then I have to hot glue them in place, then I can put the actual programming on them and call them done!

solar whale
#

not hearing

drowsy geyser
#

I can hear ya.

raven canopy
#

I be hearing yous guys.

stuck elbow
#

I hear voices in my head

drowsy geyser
#

Ouch. Cold. 😃

#

Maybe @slender iron is connecting through GitHub's network....

slender iron
#

brb

solar whale
#

can hear on iphone and linux, but not on MAc

drowsy geyser
#

GitHub is back, btw.

umbral dagger
#

I can hear fine on mac

idle owl
#

Excellent!

drowsy geyser
#

I'm just lurking.

timber mango
#

My right channel keeps disappearing (not now) and this persists across boots (Linux Jessie amd64). I see Pulse audio stuff. I wonder if alsa is storing bad settings across cold boots.

turbid radish
#

I'm here today

idle owl
#

@drowsy geyser Will you have hug reports or status update?

turbid radish
#

alsa has issues storing settings across hour boundaries

torpid goblet
#

Just going to listen and learn. At work so I can't give full attention. responses will be slow:(

drowsy geyser
#

Hugs to everyone for working so hard all the time. No status (haven't done anything recently)

idle owl
#

Ok thanks 😃

turbid radish
#

k-eye-cad

#

😃

stuck elbow
#

fritzing ftw ;-)

drowsy geyser
#

Yeah, it is. I installed v5 on my Linux box and it took a while.

raven canopy
#

I like ladyada's "KeyKaiCad" from Thursday...

tidal kiln
#

i just say "GifCad"

sweet wedge
#

Hello, I'm looking for pinout of the Metro M0 Express SPI port. All I'm finding (based on the included link) is that it's on the 2X3 male header, but no specifics about the what pin is what. SPI pinout seems like fundamental info, so I must be missing something. For background, I'm trying to setup a remote BME temp/humidity sensor with two RMF9x breakout boards using CP on a Metro M0 and a Feather M0. https://learn.adafruit.com/adafruit-metro-m0-express-designed-for-circuitpython/pinouts

CircuitPython, Arduino IDE or even MakeCode with this Metro M0

wraith tiger
#

I'm just lurking today.

twin mica
#

Just an idea for Scott, could pre-record the intro segment and playback. Might reduce some of the load 😃

idle owl
#

And he likes to change it up each week 😃

turbid radish
#

@sweet wedge for CircuitPython I take it

twin mica
#

hehe "where's the fun in that :-P"

tidal kiln
#

@sweet wedge you're just after the pinouts on the 2x3?

turbid radish
sweet wedge
#

@turbid radish Hi Mike ... yes, using CircuitPython. I already have the sensor and display working in CP, now trying to step it up with two RFM9x

#

@tidal kiln yes.

drowsy geyser
#

Ah, question, anybody know when the ARM GCC cross-compiler toolchain will be available for Ubuntu 18.04 LTS?

drowsy geyser
#

@tulip sleet Ah, ok. I was looking at the non-PPA release. I'll go check that out. Thanks!

tulip sleet
#

i don't think they will update the release in the regular repos

sweet wedge
#

@tulip sleet ahh. Ok, thank you.

torpid goblet
#

I guess this would be a group hug for everyone for keeping their eyes on the 'Low floor' part of an educational project which has the potential to be low floor, high ceiling. It is really easy for developers to get wrapped up in the high ceiling stuff which is much more fun 😃

timber mango
#

haha very true.

turbid radish
#

We try to ensure educators and beginners to be able to get started with little friction

prime flower
#

weird mic is borked

#

hug report to scott - pypi and jerryn/dastels for finding issues with AIO Python library

drowsy geyser
#

AH! Happy birthday!

errant grail
#

Hugs to the CPy team for 3.0.0! Upgraded about a half-dozen projects without any issues so far. Nicely done! Hugs to the ADABOX team for an awesome and action-packed 008. JP’s unboxing video was very well done, professional and engaging. Special thanks to Ladyada for sharing her engineering thought processes and philosophical approach.

twin mica
#

happy b-day Scott!

wraith tiger
#

BTW, mu 1.0.0-rc1 is out.

timber mango
#

nice microphone audio, @quick remnant

raven canopy
#

hope to retain coveted "last but not least" spot. but, Dan can have it... 😄

wraith tiger
#

Getting older is better then the alternative.

turbid radish
#

Dan and I have the high end covered

tulip sleet
#

restarted discord - no effect 😦 was working before ; hugs to jerry, kattni et al who found the gpio pull issue at the last minute last week

#

hugs to thach for doing massive nrf merge to master

#

switched to ptt

#

hugs to arturo also for all the nrf

#

work

timber mango
#

push to talk

onyx hinge
#

just lurking and listening today. I have been working on code for AD9850 DDS frequency generator and hope to find time to ask some questions to bring it in line with Adafruit coding style.

timber mango
#

cricket

errant grail
#

He is wise beyond his years.

onyx hinge
#

oh wow you're 16? awesome

timber mango
#

MSB?

tidal kiln
#

0b100000 ?

timber mango
turbid radish
#

Off & on, you're welcome

stuck elbow
#

group hug and congrats on 3.0

timber mango
#

holy smoke

raven canopy
#

@three-bits and @larryfast for looking at and bringing some documentation issues up. @HappyDay for their continued push on getting SAMD sleep working. @Dan Halbert and @tannewt for keeping up with the forums; I keep meaning to check more. Group hugz beyond all that!

Non-CP hug to the makers of Aloe Vera gel. Beaches have a knack for making life colorful, and slightly painful.

timber mango
#

synergy?

prime flower
#

mic workin yay

turbid radish
#

Yes, I've done guides off & on a small part time basis for > 4 years. I retired from the US government in April and now doing consulting for Adafruit full time. That includes guides.

slender iron
errant grail
#

@turbid radish Your Trinket book was my first introduction to the new generation of microcontrollers. Excellent. Thanks!

turbid radish
#

You're welcome - I have a new book on Circuit Playground Express out in September

#

I'll probably be at Maker Faire NYC in Sept

prime flower
#

see ya there mike 😄

twin mica
#

ooO chance to get Mike's autograf

turbid radish
#

oh my, @slender iron without a computer!?!

tidal kiln
plucky flint
#

Evening folks... (from the UK, at least)... The release candidate for Mu is out. Details here: https://madewith.mu/mu/releases/2018/07/16/release_candidate-1.html Please test and all feedback most welcome. 😃

idle owl
#

@plucky flint Super exciting!

wraith tiger
#

@plucky flint I just pip3 installed it.

turbid radish
#

@plucky flint, congrats!!

plucky flint
#

The final 1.0 will be out on Friday... here's hoping GitHub doesn't go down in the middle of the release process again... 😃

meager fog
#

@plucky flint yayyy congrats!!!

errant grail
#

Other than converting a few existing projects, no new CPy work this past week – still working on PCBs and front panel designs for three Eurorack synth projects and learning about the key features of _Ki_Cad. As a result, next week will involve uploading gerbers to OSH Park and ordering a stock of newly filled plastic bags from DigiKey.

plucky flint
#

thanks folks. 🐮 ❤ adafruit

errant grail
#

Yay KiCad 5.0!

turbid radish
#

k-eye-cad

stuck elbow
#

@umbral dagger I have some CP drivers for those e-ink displays

umbral dagger
#

I'm happy being called "dastels"

torpid goblet
#

I am also a dave. too many of us on the inter web i am threebits

turbid radish
#

yes, brightness isn't implemented yet 😦

stuck elbow
tulip sleet
umbral dagger
#

@stuck elbow Cool. thanks!

raven canopy
#

Be gentle... 😄

timber mango
#

I'm starting to look at seesaw as the basis of a more bare-hardware project I want to do on the M0 (a simple text interpreter for SAMD21).

Old interpreter:

https://github.com/wa1tnr/bitwise_ops/tree/testing-aa/bitlab_dd

git visualization using gitk has way changed the way I look at code.

I have already compiled seesaw natively -- that is, outside of the Arduino IDE, using the 'eabi' gcc compiler.

I'm still considering CircuitPython and the Arduino IDE as source trees -- to modify them for my project.

CircuitPython is ahead in that race, since I already know I can compile it in Linux (without a virtual machine, thanks to @tulip sleet and his work on that GUIDE detailing the compilation of CircuitPython).

Still on my list is doing an interpreter in CircuitPython (possibly on the TX/RX pair (UART) to avoid collision with the REPL. Or maybe in the REPL. ;)
ref.
https://github.com/adafruit/seesaw.git
https://learn.adafruit.com/building-circuitpython

twin mica
#

-More 3d printed mounts for CRICKIT including special bits for LEGO bricks.
-Video about the things going live on Wednesday.
-More CAD files added to GitHub https://github.com/adafruit/Adafruit_CAD_Parts
-Next week working on gear mechanisms using crickit.

quick remnant
#

btw, the more you get advanced in git, you will find that everything keeps getting easier

stuck elbow
#

I prepared the prototypes for the CircuitPython badge to pass them on to the
PyCon.UK organizers next week at Europython, so that they can give them to
people interested in testing and developing for them. We decided we will
postpone their use on the conference to the next year.

This weekend I realized a way to make a minimal version of a standalone device
compatible the PewPew Featherwing, with just 4 components -- that will be cheap
enough to use in game-making workshops. PCBs are on order. I will need to write
a C module for CircuitPython similar to the gamepad module for driving a LED
matrix directly with the GPIO pins. (Project logs at https://hackaday.io/project/159733)

A Python-based micro game console, optimized for game development workshops.

raven canopy
#

FrequencyIn Module: dormant this past week.

Little Leslie amp: still no movement, beyond random thoughts.

Adabot Library Patching: working script has been PR'd. Could definitely benefit from further testing before it gets used on the live repos.

stuck elbow
#

that is my update --^

umbral dagger
#

no

onyx hinge
#

I came in real late in the process so it always seemed real stable to me

#

(also I was using the better tested M0 boards I think)

stuck elbow
#

apart from some short times when it was completely broken, the master seemed to be pretty stable to me

onyx hinge
#

😊

timber mango
#

alpha (or pre-alpha) usually means 'this is gonna break' and beta usually means 'we want you to test this before it goes into wide release'.
release-candidate means 'why aren't we releasing this? Seems fine to us'
release means 'nobody barked at the last release candidate -- let's go!'

stuck elbow
#

yeah, esp8266 was broken all the time, but it was like that with 2.x too, so no change :)

idle owl
#

@timber mango That often goes along with it, however the more tangible definitions are that alpha is before all the features are added, beta is all features are in, and now we're taking on the bugs with everything, and RC is when we're pretty sure we got it all, but we need more heavy testing.

onyx hinge
#

I tend to discount the value of the vendor libraries and gravitate toward direct register stuff. But it depends on scale, as the chips get bigger and more complex it's a better idea to pick vendor libraries I think..

stuck elbow
#

sometimes you have silicon bugs that the vendor libraries handle, that can take quite a bit of hair pulling to do without them

onyx hinge
#

@slender iron do you see any directions to improve testing during 4.0?

#

is that running more reliably now?

#

yup

#

thanks

#

yeah, or you could use one of those "two or three feathers" board

#

yes I'd love to be able to do that locally

timber mango
onyx hinge
#

audio's very choppy 😕

timber mango
#

jerry crickit

#

capacitive touch - binary blob thing? (M4)

tidal kiln
#

dropin out. gotta run. cheers all.

umbral dagger
#

I'm off.

slender iron
#

👋

raven canopy
#

🎁

timber mango
#

.oO(.. crickits) ..

raven canopy
#

Thanks everyone!! Hope your Monday is awesome possum!!

stuck elbow
#

thanks, bye

errant grail
#

Thanks!

wraith tiger
#

👋

raven canopy
#

I framed mine last week. Still need to hang it.

timber mango
#

They have ledges in old buildings that are used to hang art from, on a descending long rod/hook thing.

raven canopy
#

Yeah it can. Don't realize until you try to paint. 😡 light frames + 3m command strips FTW.

twin mica
#

cheers!

raven canopy
#

I'm out too. Later taters!

raven canopy
#

Functional crown molding of sorts...

timber mango
#

I've only seen it used once. They had some heavy pieces hung on that rail -- like 50 lb or more I think. ;)

#

I have old plaster and lath here so I haven't put a thing on the walls in 17 years. ;)

meager fog
#

@umbral dagger hey you round?

umbral dagger
#

@meager fog Yes

meager fog
#

do you own an android phone?

umbral dagger
#

Nope

meager fog
#

oi ok 😄

#

(or tablet)

umbral dagger
#

I had a nexus 7 once to test with but it seems to have been lost in a move

meager fog
#

haha eveone owns a Nexus 7 Somewhere

umbral dagger
#

Just iOS devices here

meager fog
#

would you be interested in this project for a guide/port

#

oops brbr

umbral dagger
#

I saw that go by in a feed earlier

ruby lake
#

yawn

meager fog
#

@umbral dagger perhaps you could do the code and then mike b can test i know he has an android phone

#

could be a teamup

umbral dagger
#

That would work. I'll dig into it.

#

CP on as small a board as it will fit on?

meager fog
#

i think cplay express actually would be good

#

because you could start with the two onboard buttons

#

then wire up external buttons if desired

umbral dagger
#

Excellent point

meager fog
#

ill put it in basecamp so you dont have to think about it 😃

umbral dagger
#

cool.

#

cap-touch might be nice, too.

meager fog
#

could show that as an alternate

#

ok will chat with mike and we'll figure out how to test

timber mango
#

tact switches wouldn't be good for morse. capacitive touch much better.

#

Heathkit put out a morse keyer using microswitches. Soon after, squeeze paddles became more often used (Bencher, I think -- I had an MFJ copy, iirc).
Squeeze paddles are a pair of SPST switches (momentary) that are physically arranged so you can squeeze the two, together (closing both circuits).
They're generally wired to a CW keyer with a 1/4" stereo plug, (Tip, Ring, Sleeve).

#

The set-screws set the 'action' (spring-tension isn't adjustable). Too wide of a gap between the contacts felt wrong; too narrow a gap caused extra dit (or dah) elements to be sent, unintentionally.

#

iambic operation: squeeze the paddles together, slightly timed differently.
If you hit the DAH paddle first, the keyer sends DAH-dit-DAH-dit .. until you release the paddles (saving you a lot of motion of your hand).
Reverse was also true - hit the dit paddle first, you get the opposite pattern.

#

iirc a right-handed person uses the thumb for dit and index finger for DAH.

bronze geyser
#

i'm in my c module extension using jlink when i have this line in my source: turn_on_eic_channel(pin_PA19.extint_channel, EIC_CONFIG_SENSE0_LOW_Val, EIC_HANDLER_WAKEUP); gdb freezes. Note: the m0 is NOT in standby. This means I am not able to test via gdb whether my interrupt handler is working using gdb. Is this because of interference w/ the usb driver? Any additional info/advice appreciated.

#

@tulip sleet Thanks very much for sharing .gbinit - very helpful. What a time saver!

timber mango
manic glacierBOT
#

Discovered while trying the ampy ls command which adds a trailing slash on the path.

Adafruit CircuitPython 3.0.0 on 2018-07-16; Adafruit Feather M0 Express with samd21g18
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'boot_out.txt', 'ds1307slave.mpy', 'smbusslave.mpy', 'System Volume Information', 'tmp.txt', 'lib', 'boot.py', 'test_board_rtc.py', 'tmp.pytest']

>>> os.listdir('/')
['.fseventsd', '.metadata_never_index', '.Trashes', 'bo...
torpid goblet
#

@slender iron is the virtual python environment necessary for setting up Rosie? or can i skip that if nothing else is running on the machine?

solar whale
#

@tulip sleet updated the Bundle and the crickit.touch_n works as expected -- thanks

raven canopy
#

@bronze geyser yes, i would assume the EIC_Handler is locking out the USB interrupt handler. A further assumption is that the pin is already LOW once INTSET is turned on, so it is entering an endless loop. Are you sure you'll need the EIC_Handler (EIC_HANDLER_WAKEUP)? I have been under the impression this whole time that _WFI will respond to any interrupt on its own, so it shouldn't need the EIC_Handler...

#

re: "under the impression"....caveat is that docs can be wrong, of course. those datasheets are a lot of information, and humans make mistakes. 😄

#

@bronze geyser you can set a breakpoint on EIC_Handler(), to verify if that is the case. and then look at the backtrace. that is how i've attacked interrupt lockup debugging.

solar whale
#

@tulip sleet but this now fails -- it worked on a CPX a few weeks ago -- do I need something different on the Feather CRICKIT ```
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M4 Express with samd51j19

from busio import I2C
from adafruit_seesaw.seesaw import Seesaw
import board
i2c = I2C(board.SCL, board.SDA)
seesaw = Seesaw(i2c)
CAPTOUCH_THRESH = 500

seesaw.touch_read(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/adafruit_seesaw/seesaw.py", line 226, in touch_read
ValueError: Invalid touch pin
seesaw.touch_read(0)

raven canopy
#

@slender iron you mentioned PRs for adabot patches, earlier. not exactly how i set the script up, as you've most likely seen, since git am just makes the commit. i meant to ask in the PR (or before) if adabot has privs on all of the library repos. if she doesn't, git am will likely fail since she can't make commits.

idle owl
#

I still can't get Adabot to run. Failing on a KeyError: 'Login'

#

My env.sh is directly from Scott, iirc. So...

#

I don't know where to start with troubleshooting this.

raven canopy
#

looks around I didn't do it. I think. 🤔

idle owl
#

This was happening earlier.

#

And Scott ran it fine yesterday

#

so

#

It's likely me

#

I assume.

raven canopy
#

I assume it was me, and all I did was submit a PR. 😄 i bumped into this blog post on this subject...let me find it.

#

it's a good read. especially for someone like me who has never been "in the industry". 😆

slender iron
#

@torpid goblet not required but a good idea. why are you setting up rosie?

idle owl
#

Thanks @slender iron!

slender iron
#

thanks for doing the notes!

manic glacierBOT
slender iron
torpid goblet
#

@slender iron really just a learning experience. I am a bit of a testing geek:) I am curious how your system works.

slender iron
#

kk. not very well yet 😃

manic glacierBOT
tulip sleet
#

this is true on both boards: they have the same Crickit pin numbers (except that the physical Drive pins for the Feather Crickit were reversed, not intentionally)

tidal kiln
#

@slender iron about to hook up a TSL2561 and maybe also a TSL2591 as a way to compare / test that CPX issue 37 math......anyone else already on this?

raven canopy
#

@slender iron so, don't worry about trying to work in PRs for adabot? I mean, the initial PR to put the patch into the patches directory will serve as the approval. but it requires diff reading...

slender iron
#

@tidal kiln not that I know of

#

@raven canopy ya lets try direct. its less work

raven canopy
#

👍

idle owl
#
Found 85 submodules in the bundle.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/kattni/repos/adabot/adabot/circuitpython_libraries.py", line 701, in <module>
    print("Running GitHub checks as " + github_user["login"])
KeyError: 'login'```
#

Adabot output.

raven canopy
#

@idle owl it may be GitHub. they're still in "recovery efforts". github_user is captured from a call to github.get("/user").json().

idle owl
#

Hmm.

#

I was assuming some issue with the access token.

raven canopy
#

i'm running some patch tests, so let me try the same call real quick.

idle owl
#

Ok

#

Thanks, @raven canopy

tidal kiln
slender iron
#

you can add a print so it prints whatever github user is

#

@tidal kiln sounds ok to me. can you follow up?

raven canopy
#

this is what i got, but i don't have the key installed:

{'documentation_url': 'https://developer.github.com/v3/users/#get-the-authenticated-user', 'message': 'Requires authentication'}
tidal kiln
#

@slender iron sure. i'll ask for more details on what they did also. if we do adopt something, it should be a new property called lux.

raven canopy
#

well...actually, i do have my OAuth key entered. hmm...

slender iron
#

probably outage related

raven canopy
#

and...this just appeared on the status page:

18:10 Central Daylight Time
All systems operational. Some users may not see audit logs, Pages builds, or webhooks from the affected time window. We are rebuilding search indices. We will reach out directly to users who saw additional impact. 
tidal kiln
#

kudos to those meeting notes with time stamps - used them to go back and hear Scott's comments about that issue 37. really useful!

slender iron
#

👍

torpid goblet
#

@slender iron did you create rosie or is it based on an upsteam project?

slender iron
#

@idle owl I'm trying adabot now

#

@torpid goblet I did

#

ok for me: ~/r/adabot (master|✔) $ source env.sh ~/r/adabot (master|✔) $ source .env/bin/activate.fish (.env) ~/r/adabot (master|✔) $ python3 -m adabot.circuitpython_libraries Found 501 repos to check. Found 85 submodules in the bundle. Running GitHub checks as adafruit-adabot Running Travis checks as adafruit-adabot

idle owl
#

It's past that point now in running.

slender iron
timber mango
solar whale
#

@tulip sleet nice ```Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M4 Express with samd51j19

from busio import I2C
from adafruit_seesaw.seesaw import Seesaw
import board
i2c = I2C(board.SCL, board.SDA)
seesaw = Seesaw(i2c)
CAPTOUCH_THRESH = 500

seesaw.touch_read(4)
324
seesaw.touch_read(4)
875
seesaw.touch_read(5)
191

stuck elbow
#

it just had to be done

solar whale
#

no flash ?

stuck elbow
#

well, 4 components...

solar whale
#

very nice! amazing, in fact!

tulip sleet
#

@solar whale also, you can use the seesaw object from crickit, or use the touch objects in crickit:

>>> from adafruit_crickit import crickit
>>> ss = crickit.seesaw # useful for seesaw operations
>>> crickit.touch_1.threshold
427
>>> crickit.touch_1.threshold = 500
>>> from adafruit_crickit import crickit
>>> ss = crickit.seesaw
>>> crickit.touch_1.threshold
427
>>> crickit.touch_1.threshold = 500
>>> crickit.touch_1.raw_value
330
manic glacierBOT
manic glacierBOT
slender iron
#

hi @gentle bronze !

gentle bronze
#

hi @slender iron

slender iron
#

thanks for joining discord

indigo wedge
#

Hi @gentle bronze 😃

#

Hey @slender iron could you explain a bit more in the review what you meant? 😃

slender iron
#

ah ya. will respond there

manic glacierBOT
slender iron
#

@indigo wedge ☝ better?

manic glacierBOT
#

Oh like that, I'm not sure if that's the best idea, don't think I ever saw a library do that. If we did it that way then we would need a base class so the other two could inherit from it and we would need to know what kind of uuid we have before creating a class, like this:

if uuid_str.len == 36:
    uuid = UUID128(uuid_str)
else:
    uuid = UUID16(uuid_str)

If you check other frameworks, they just have one class with usually a type property:
https://infocenter.nordicsemi....

manic glacierBOT
#

Most of those are C APIs which can't do duck typing. We don't need to do it just because bluepy does.

Ya, off the wire we'll need to do a length check, but the differences between the two will be clearer with two proper types.

  • One is standard, 16bit and has a text description. AssignedName(0x1800, "Generic Access") Furthermore, instead of providing constants for the ints we can have modules for related names dynamically loaded.
  • The other is custom, no description and may be der...
#

I didn't do it cause bluepy does it that way, I just like it being a single class ;)
For the 16-bit uuids, it's not always that they have a text description, they can be custom too. Could you explain the dynamically loaded modules, I don't think I get it.
Also I'm not sure about you example, it shows same CustomUUID class for both 16 bit and 128bit.
What names do you propose for those classes?

I think I'm just having a hard time understanding your vision.

bronze geyser
#

@slender iron thank you for the link to the micropyhon proposal. You all are so amazing. @tulip sleet also was kind enough to think to send. It may seem overboard, but I am happily overwhelmed by the thoughtfulness folks on this channel have for each other.

indigo wedge
#

@solar whale You mentioned some time back that nrf52840 scan finds fewer devices, I found the issue, the scan API changed and in s140 the scan stops after finding a device so we have to manually continue it until timeout is reached 😃

solar whale
#

@indigo wedge nice -- that was nagging me.

indigo wedge
#
>>> len(s.scan(5000))
184
#

😄

#

Of course it's multiple entries for same device, but still better than before 😉

ruby lake
#

hm, how much of ASF4 is in the Adafruit_ASFCore library?

manic glacierBOT
raven canopy
#

Hey @gentle bronze! Welcome to Discord. 👋

gentle bronze
#

thanks @raven canopy

solar whale
#

@gentle bronze Welcome -- and thanks for all the great work on the nrf52!!

sharp rain
#

Forgive the newb question I've only been tinkering w/ microcontrollers for a few weeks but... when we build CircuitPython UF2 file it's ~370KB, but my trinket only has 256KB of flash, so.. how does that work when the file is dragged onto the flash - is some magic happening to make space in memory or.. ??? 😖

simple pulsar
#

Or is it about blocking and waiting for user input? I'm just about to embark on some data flow from a Raspberry Pi -> CPX and was curious if i'm going to be able to do this - other way around is easy

sharp rain
#

@weary raven thanks for the pointer.. just found the UF2 source code for the SAMD on GitHub so the format uses 512 byte blocks to hold up to 256 bytes of flash data so that checks out 😃

manic glacierBOT
meager fog
#

@simple pulsar our current thoughts is to just allow people to create a new/separate USB-UART device

manic glacierBOT
meager fog
#

but we haven't started coding that up yet. we agree that there's no super-elegant way to do bi-directional comms unless you can be super-sure that there's no control/escape chars.

#

@gentle bronze hi thach! just saw you joined

manic glacierBOT
gentle bronze
#

@meager fog yeah, I just joined in. Lots of stuffs is going on here 😄

manic glacierBOT
meager fog
#

@gentle bronze yeah it can get a little busy - but its great if you want to chat fast. i also come by and show off stuff im working on sometimes!

manic glacierBOT
gentle bronze
#

@meager fog yeah, it is great to have all thing in one place :D.

indigo wedge
#

Dan is on a rampage 😄

manic glacierBOT
meager fog
#

@indigo wedge between you, dan, and thach - this codebase is like a whirlwind!

tulip sleet
#

@gentle bronze Hi!

indigo wedge
#

@meager fog and now with all those Issues to address its gonna be even more dynamic ;)

tulip sleet
#

i was diff'ing the atmel-samd and nrf ports/ trees to see what was missing, and I think I finished 😃

simple pulsar
#

@meager fog Do you mean a new uart on some pins so you would have to wire it up to something? Having the USB cable in makes it very attractive for development to just chat over the existing cable. I haven't tried it yet but can input() be used if you are prepared to accept blocking?

meager fog
#

@simple pulsar you can do that right now - connect ftdi/console cable to RX/TX on the circuitpython board, then use busio to read and write byes

#

what we want to do is have it thru USB - more elegant but also more work

simple pulsar
#

@meager fog thanks

gentle bronze
#

hi @merry turret , almost miss your hello message. Too many things are going on 😄

tulip sleet
#

@gentle bronze no problem, I missed your general one earlier 😃

#

it's not always this busy here

prime flower
#

@tulip sleet is SPIDevice msb first or lsb first?

tulip sleet
idle owl
#

Odd. I thought I had admin rights on Travis.

manic glacierBOT
idle owl
#

@gentle bronze Welcome!

covert oxide
#

Hello, does Circuitpython support complex numbers? saw it as part of builtins module at goo.gl/JhBwkF, but i dont actually see it doing import. Is it OK I as this type of questions here, or is it best suited for the forums?

idle owl
#

@covert oxide This is an excellent place for that question. The forums would work as well. It's been a bit quiet here this morning, so be patient and someone will answer soon 😃

onyx hinge
#

@covert oxide I don't think support for complex numbers is included.

tidal kiln
#
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit ItsyBitsy M4 Express with samd51g19
>>> foo = complex(2,3)
>>> foo.real
2.0
>>> foo.imag
3.0
>>>  
#

@covert oxide ⬆ does that work?

onyx hinge
#

import cmath

covert oxide
#

I have a trinket, it does not work there

idle owl
#

Oh could be we removed it from the Trinket build to conserve space.

onyx hinge
#

from looking at the source, it appears the cmath module is disabled on all circuitpython builds and complex numbers themselves are enabled based on whether the BOARD_FLASH_SIZE > 192000 which I am guessing does not apply to trinket (?)

tidal kiln
#
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Trinket M0 with samd21e18
>>> foo = complex(2,3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'complex' is not defined
>>> 
covert oxide
#

that is what I see, yes

onyx hinge
#

If you wanted to build your own, you could probably enable complex type on trinket but you might have to disable something else

covert oxide
#

interesting, I think I will look into it, thank you all!

onyx hinge
#

in ports/atmel-samd/mpconfigport.h you'd start by simply removing the '#define MICROPY_PY_BUILTINS_COMPLEX (0)' line (it was around line 237 in my copy)

#

however that causes the flash to be too full

covert oxide
#

right, thank you, I will play around removing something and see if I can get it to work

onyx hinge
#

wow I am having to take a LOT of stuff out. complex numbers are surprisingly heavyweight

#

and trinket m0 is very full

manic glacierBOT
#

the part when SD is enabled is currently handled inside the stack.
https://github.com/hathach/tinyusb/blob/develop/src/portable/nordic/nrf5x/hal_nrf5x.c#L178

Previously they are all inside in tusb hal, then recent Nordic sdk break non-SD api by introducing nrfx (SD API is more stable). But I think I will move it out of the stack, making the stack more generic. I will take this chance to do this

onyx hinge
#

.. removing builtin 'set' and 'help' allow complex type to be enabled for trinket m0, with 540 bytes of flash free.

covert oxide
#

wow, you are fast, thank you, I was going to remove neopixel_write

onyx hinge
#

removing help & neopixel_write doesn't seem to be enough

idle owl
#

@slender iron I forgot to add CircuitPython Librarians to the Pixie lib. Which I went back and did. And then ran Adabot again. Travis still says I don't have sufficient rights to enable this repo on Travis. Do I not have admin rights on Travis? Am I not supposed to?

slender iron
#

@idle owl wait a bit. permissions are cached

idle owl
#

Ok. That's what I was about to ask.

#

Will do.

manic glacierBOT
prime flower
#

I'm converting a command (int) into a bytearray to be sent over spidevice but something isn't working, not sure where

#

command = ((0x01 << 7) | (1 << 6) | ((0 & 0x07) << 3))

#

cmd_array = bytearray(command) produces an empty bytearray

onyx hinge
#

brentr: bytarray(int) -> an array of that many zeros. bytearray([int]) -> a bytearray with 1 element, equal to that int

#

so e.g., try bytearray([192]) instead of bytearray(192)

prime flower
#

that works, thanks jepler

manic glacierBOT
indigo yoke
#

I get

#

david (master) nrf $ make BOARD=pca10056
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
../../py/nlrthumb.c: In function 'nlr_push':
../../py/nlrthumb.c:86:1: error: stack usage computation not supported for this target [-Werror]
}
^
cc1: all warnings being treated as errors
../../py/mkrules.mk:53: recipe for target 'build-pca10056-s140/py/nlrthumb.o' failed
make: *** [build-pca10056-s140/py/nlrthumb.o] Error 1

indigo wedge
#

@indigo yoke which arm gcc version are you using?

indigo yoke
#

david (master) nrf $ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

indigo wedge
indigo yoke
#

sorry, did you mean ?

#

david (master) nrf $ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:4.9.3+svn231177-1) 4.9.3 20150529 (prerelease)

#

I have been building C++ mbed examples for nRF52840-DK board ... but would prefer to run Python (+OpenThread) if possible

tulip sleet
#

@indigo yoke you can also install from this ppa:

indigo wedge
#

I'm afraid, 4.9 might be too old, I've been using 5.4 and Travis builds with 7 I believe

tulip sleet
#

that ppa is at 7.3.1

#

we are using the version just behind that, and will switch to this one soon

indigo wedge
indigo yoke
#

without updating toolchain + removing -fstack-usage, make BOARD=pca10056 yielded

#

david (master) nrf $ make BOARD=pca10056
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Generating build-pca10056-s140/genhdr/mpversion.h
FREEZE freeze
drivers/bluetooth/ble_drv.c:115:1: error: missing braces around initializer [-Werror=missing-braces]
nrf_nvic_state_t nrf_nvic_state = {0};
^
drivers/bluetooth/ble_drv.c:115:1: error: (near initialization for 'nrf_nvic_state.__irq_masks') [-Werror=missing-braces]
cc1: all warnings being treated as errors
../../py/mkrules.mk:53: recipe for target 'build-pca10056-s140/drivers/bluetooth/ble_drv.o' failed
make: *** [build-pca10056-s140/drivers/bluetooth/ble_drv.o] Error 1

#

will update tools now

idle owl
#

Well that only took ages, but it worked and now it builds. Hooray!

mental marsh
#

Hey everyone, using CP on itsybitsy m4 with battery BACKPACK, is there a command or library to monitor the power remaining in the battery? I need to know when it needs charging since it will be hidden in the suit..

idle owl
#

You can check the voltage on the pin and when it gets below a given threshold, you know it's time to charge it. I'm not sure which pin because I've never worked with the backpack, but it should be the VBAT pin.

#

I can't remember the voltage ranges off the top of my head, but it shouldn't be too hard to find. It can get up to about 4.2V when fully charged, and drops to something when it's ready to be charged again.

raven canopy
#

3.7v would be my target for charge. You can go lower, but it comes with risks/effects.

manic glacierBOT
errant grail
#

@mental marsh Here are the battery level voltage thresholds that I've used in a few projects. Voltage isn't a very good capacity indicator, but this general case has worked okay for me.

mental marsh
#

Thank you everyone so much! Wouldnt i need to keep the current check code running in a loop and that would drain it faster?

#

Also what is the command to monitor voltage in CP?

errant grail
#

@mental marsh Let's try this again. Here's code that's specific to monitoring battery voltage. Pin A0 is connected to the center of a resistive voltage divider made of two 100K resistors. The voltage divider measures the Vbat pin. The continuous current draw of the voltage divider is about 20uA, not a significant draw for my projects. ```

from analogio import AnalogIn
import board
from simpleio import map_range # for controller range

set up analog input pin with the 2:1 voltage divider

analog_in_pin = AnalogIn(board.A0)

print("Battery voltage: ", map_range(analog_in_pin.value, 0, 65535, 0, 6.6))

### Main Loop ### . . .

manic glacierBOT
mental marsh
#

Thanks @errant grail

idle owl
indigo yoke
#

thanks all, with 7.3.1 installed, was able complete instructions without error and flash the nRF52840-DK (pca10056) board

meager fog
#

heyyy folks

#

we're slowly but surely going to doc our sensors on python-with-circuitpython rather than separating the code/libraries

#

this is our first one:

#

take a look, anything we should add/change? cause this will be the template for the next 50 guides

mental marsh
#

@idle owl perfect, thanks 😃

cunning crypt
#

@meager fog So far, the only thing I would change would be to have all CP stuff together, and all normal Python stuff together. So, CP Wiring, CP Library installation, then Python Wiring, Python Library installation. Personally, I find it less annoying to just skip one section instead of skipping, checking, skipping, checking, etc

#

The only other thing I'd say? Adding a link to the guide on installing Adafruit_Blinka under "Python Installation of BME280 Library" so people don't have to worry about searching.

errant grail
#

@meager fog It may be time to move the CircuitPython section ahead of the Arduino section in the default learning guide outline. Also, somewhere in the text should either be a section on MakeCode or a disclaimer if the device isn't quite ready for it yet. I believe that most beginners would benefit from seeing CPy and MakeCode information at the top of the list.

cunning crypt
#

I agree with @errant grail - Even if a device isn't supported by MakeCode yet, it should be acknowledged somewhere.

errant grail
#

Perhaps a set of logo graphics at the top of the guide that indicates compatibility at a glance.

torpid goblet
#

AWS Key for the S3 bucket where logs will be stored long term.

export AWS_TOKEN="< AWS token >"

Corresponding secret for the AWS key.

export AWS_SECRET="< AWS secret >"

#

@slender iron is^ internal adfruit information? Should I figure out a way to bypass aws for my local rosie testing?

slender iron
#

ya, try without

torpid goblet
#

@slender iron ok. making progress I have travis-ci.org correctly sending triggers to my box from a forked circuitpython

manic glacierBOT
#

I didn't realize 32 bit was also valid. I like the idea of standardizing to 128 bits.

It seems like the type is a way to encapsulate how much of the ID is transmitted over the air. So, could we replace type with transmit_length (in bytes)? That seems clearer to me and doesn't need the enum class.

Also, can we drop string support in favor of int or bytes-like? byte strings are smaller and simpler to use.

For reference: https://docs.python.org/3.7/library/uuid.html

The modular i...

slender iron
#

awesome! lunchtime for me

manic glacierBOT
#

I see, so now I get almost everything ;) So we would agree to keep UUID as a single class? As for the transmit_length, it sounds ok, but I think we should still have some way to get the bit value (16, 32, 128) in a fast way. Maybe just a bits property that would return 16, 32, 128?

I can drop the string support, should I also drop the deep copy, it's there cause it was copied from ubluepy.

As for the modular idea, one problem I see is can the C code reference constants from .py file...

tidal kiln
#

is there a flash eraser UF2 for the itsy m0?

raven canopy
#

@tidal kiln i don't see one on the troubleshooting page...

latent raptor
#

Problem: I have a Circuit Python Express. When plugged into my computer’s USB it boots and runs perfectly. When I run it from a USB battery pack it runs a couple lines then stalls at my while True: line and never advances. Same error with a lithium battery pack on the 3.7V input. Any ideas?

raven canopy
#

@latent raptor we'd need to see the code that the CPX is running. if you paste it here, enclose it in 3 backticks (` , usually below the escape key)

tidal kiln
#

@latent raptor can you link full code? (pastebin)

raven canopy
#

or pastebin works. 😄

latent raptor
#

Sure hang on

tidal kiln
#

or gist or equiv

#

if it's just a dozen or so lines, go ahead and post it here

latent raptor
#

@raven canopy thank you. Here it is in pastebin

#

It works fine when powered by my computer, and at the top of the code is a cpx.red_led true false which always runs, no matter the power source. But on battery it does not fall into the while loop

tidal kiln
#

@latent raptor so the cpx.red_led heartbeat in the while True: doesn't continue?

latent raptor
#

@tidal kiln correct

#

It never flashes

#

The ones before the while loop do work on any power source

tidal kiln
#

what's attached to the uart?

latent raptor
#

ESP32

#

It is powered by the same computer’s USB

#

It just sends two bytes every so often

umbral dagger
#

Sure sounds like the read is blocking and waiting

latent raptor
#

It’s strange because it only fails when on battery power...does the UART require a bit more juice?

#

I have a 2000mAh battery

tidal kiln
#

the ESP32 is unpowered with only battery?

latent raptor
#

The ESP32 is only powered by the computer’s USB.

tidal kiln
#

what are your wire connections between the CPX and ESP32?

latent raptor
#

ESP32 pin IO17 to pin A6 on CPX

tidal kiln
#

A6 = RX

#

so just the one wire?

latent raptor
#

Yes

tidal kiln
#

you need to connect the GNDs also

raven canopy
#

@umbral dagger that's what i was thinking. now i just have to remember where the UART code is... 🤔

tidal kiln
#

when both are on USB, they have a shared GND

latent raptor
#

Ok lemme try that 😃

tidal kiln
#

but when you go battery on the CPX, you're loosing that

latent raptor
#

Ahhh much better! Ok, noobie mistake. That works

#

Pulling my hair out lol

raven canopy
#

@tidal kiln is on another level when it comes to troubleshooting.

umbral dagger
#

I find that the most frustrating things often are the fault of something trivial.

tidal kiln
#

@latent raptor sweet. glad it was that easy and simple.

latent raptor
raven canopy
#

@umbral dagger uart.read() will timeout on the busio object's setting. since we were both going down that thread...

latent raptor
#

Heck yeah, thanks @tidal kiln

#

I do have a minor bug. If the esp32 powercycles the CPX stalls out the UART and fails to recover. I have to reset the CPX.

#

But I am not too worried about that bug 😃

tidal kiln
raven canopy
#

@tidal kiln yeah, i'm digging down to the common-hal to verify...

#

default is 1 second (1000ms)...

tidal kiln
#

even with signal issues, wonder how it was able to lock up. maybe something lower? io_read?

wraith tiger
raven canopy
#

and the floating RX would have at least returned bogus values, if that was the cause. no?

tidal kiln
#

i'd think so. but maybe not. not sure what the behavior would be if it were floating in one of the logic level gray zones.

#

hw might be like "so....are you a 1 or 0? guess i'll just wait here until you decide......"

raven canopy
#

undefined behavior == undefined. 😄

#

one "="? what was i thinking?

tidal kiln
#

raven canopy
#

now to hunt down some "why is DFLL setup like this on M4", before I ask Scott or Dan. 🤔 📚

raven canopy
#

yay! a distraction! 🐿

idle owl
#

😄

raven canopy
#

did you want a review on the lib too? (i peeked to make sure the submodule is gtg. it is!)

#

@idle owl done!

idle owl
#

@raven canopy Thanks. Limor already reviewed it, so as far as I know, it's good to go as well

raven canopy
#

well yeah, i'd say that counts. 😆

idle owl
#

Thank you, I can now check that off.

strange pumice
#

Is there a style policy on globals? I see a half dozen examples in the learning system with globals and a pylint comment to ignore them.

raven canopy
#

@strange pumice not that I've seen/heard of.

drowsy geyser
#

@tulip sleet Can you resend me the link for installing the GCC ARM cross-compiler toolchain on Linux? I can't find my note....

#

Or a link to the guide that describes it? 😃

raven canopy
drowsy geyser
#

Thanks @raven canopy ! I looked in the history but didn't see it.

#

That'll be right helpful. 😃

raven canopy
#

"ppa" was the key ingredient. at least for me. 😆

drowsy geyser
#

Ahhhh, of course. Thanks!

raven canopy
#

you're welcome.

drowsy geyser
#

Nice! Installing now. Boy, that's a big toolchain. 😃

#

Now I can build 3.0 latest. Which means I can flash all my devices with new firmware. Which means I can test @idle owl 's guide tomorrow! (Dependencies ending in goodness.)

raven canopy
#

All of that is a big 🎉 !!

#

@strange pumice i just read PEP8 (been a while), and didn't see any mention there. only some notes about declaration order (import first, blah, blah).

remote pike
#

I accidentally installed Circuit playground express 2.0 on my trinket m0. Now I can't start the boot loader again to install trinket 3.0 circuit python. Any ideas. When I push the reset button on the trinket the boot loader doesn't start.

raven canopy
#

@remote pike "When I push the reset button": you're double-tapping right? timing can be finicky...

remote pike
#

Yes

raven canopy
#

k. do you have the Arduino IDE installed?

remote pike
#

Yes

raven canopy
#

that would be the easiest way, IMO. upload a sketch, then use the double-tap to get back to the bootloader.

remote pike
#

Sorry. I don't have Arduino IDE on the m0. I do have it on my PC.

#

I was trying to become familiar with circuitPython on the trinket.

raven canopy
#

yeah, that's what i mean. open the Arduino IDE on your PC, then upload one of the example sketches for the Trinket M0. that will overwrite CircuitPython and the bootloader.

#

you'll need both the Arduino SAMD and Adafruit SAMD board support packages.

remote pike
#

Ok. I'll work on that. It will take me a few minutes. I'm not sure how much time you have tonight. I appreciate your help.

raven canopy
#

I'll be here a while. and, you're welcome.

remote pike
#

A few minutes might be a bit optimistic.

raven canopy
#

hehe. i was just getting to the good parts @drowsy geyser....then poof!

drowsy geyser
#

Pretty sure I'm doing something wrong (and I'll use backticks this time): ```
prm@serval:~/circuitpython/ports/atmel-samd$ make BOARD=circuitplayground_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
FREEZE ../../frozen/Adafruit_CircuitPython_BusDevice ../../frozen/Adafruit_CircuitPython_CircuitPlayground ../../frozen/Adafruit_CircuitPython_HID ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_NeoPixel ../../frozen/Adafruit_CircuitPython_Thermistor
xargs: /home/prm/circuitpython/mpy-cross/mpy-cross: No such file or directory
../../py/mkrules.mk:121: recipe for target 'build-circuitplayground_express/frozen_mpy' failed
make: *** [build-circuitplayground_express/frozen_mpy] Error 127
prm@serval:~/circuitpython/ports/atmel-samd$

raven canopy
#

did you do git submodule update --init --recursive after cloning? and make -C mpy-cross?

drowsy geyser
#

Former yes. Latter, uh, no.

#

<sheepish> Thank you. Seems to be much happier now. 😃

raven canopy
#

hehe. all good. pretty sure i've asked the same question before. 😄

drowsy geyser
#

LOL! Well, I was using my Windows 10 machine in the Linux subsystem to work ... for months. Now I got a big fancy System76 Ubuntu system and I'm trying to get everything configured right. Really appreciate the help!

#

And when UPS finally comes I can re-figure out how to make the JLink work. 😃

raven canopy
#

no worries. i was looking at system76 lappies the other day. amusing that they only mention running windows in a VM vs dual-boot.

drowsy geyser
#

Yeah, I don't bother. I run FreeBSD in a VM, but if I need/want Windows I just use the Razer....

raven canopy
#

i think it's device driver related. 🤷 yeah, i've grown to accustom to using the Vagrant VM for blinka. WSL seems too much of a hassle with no shared folders...

drowsy geyser
#

Oh! If you want into the Windows filesystem just ```
cd /mnt/c/Users/<username>/

raven canopy
#

really? when did that get implemented? last i looked it wasn't working yet...

drowsy geyser
#

It's worked for the past 10 months for me. 😃

#

I'm pretty sure it's gotten to GA and I'm not using the internal build....

raven canopy
#

steals hukuzatuna's previous <sheepish> tag

drowsy geyser
#

LOL!

#

I know there's a bunch of new stuff in dogfood right now, but this is on my Razer that's not attached to the internal Corp domain.... So it doesn't get internal-latest.

drowsy geyser
#

WooHoo! CircuitPython 3.0-latest built for all my hardware!!! CP FTW!

manic glacierBOT
#

I thought about transmit_length being bits but bytes makes it easier to slice the id. uuid.id[:uuid.transmit_length]. Bits is easy to get with uuid.transmit_length * 8.

I'd drop deep copy as well. I'm not sure why it's needed.

C files can read python state but its more complicated than its worth. I'd just have a minimal copy of what we need in C.

py files can't really extend C modules. I'd have those higher level gatt definitions in a separate lib we can freeze in if we like. A...

remote pike
#

@raven canopy I have all the SAMD modules installed on my PC. I was able to upload a sketch to the trinket. Seems like I seen a article about restoring circuitPython back to the m0 board on adafruit. I'll try to hunt that down tomorrow. I have to shut it down for the night. Thanks for the help. Is that the next step....reinstalling circuitPython to the board?

raven canopy
#

@remote pike glad you got a sketch uploaded. yep, next step is putting CircuitPython back on. should just be a matter of double tapping to get back to the bootloader.

remote pike
#

Thanks again. I'll give it a go tomorrow.

raven canopy
#

@remote pike you're welcome. and i just verified (been a while). double tap will get you back to bootloader after uploading an Arduino sketch.

sturdy furnace
#

What signal is ctrl+D (^D) when sending the reload signal to the REPL? I'm pretty sure ctrl+C is end of text?

raven canopy
#

Ctrl+D = End Of File

#

for POSIX at least.

strange pumice
#

@raven canopy - thank you for checking out PEP8.

raven canopy
#

@strange pumice i did come across a "suitable" explanation on stackexchange, which is summarized by "if you're maintaining large programs, wide use of global is difficult to trace and debug". probably not much of an issue in our mostly-embedded world.

manic glacierBOT
#

Ok, here is a sketch of what we could do. The idea is that the same object is used on the client and server. It runs in CPython as-is (actual ble is faked).

import collections
import struct

# in C

# use this to instantiate unknown devices with known services
all_services = {}

def register_service(cls):
    all_services[cls.uuid] = (cls.field_name, cls)
    return cls

# use this to instantiate known devices
all_devices = {}

def register_device(cls):
    all_s...
sturdy furnace
#

@raven canopy Thanks! I'm trying to reload the firmware from my laptop (my code requires me to turn off auto_reload(). My thinking is if I send ^D via the serial port it will reload like in the REPL

drowsy geyser
#

Oh hey, here's a @tulip sleet guide on installing and configuring the GCC ARM toolchain on Linux. Duh. 😃

sturdy furnace
#

Yay! so now I have a vscode setup where on save of my code.py in my github repo it copies it to the CIRCUITPYTHON drive (for me E:/) and reloads the firmware blinka_cooking

slender iron
#

@indigo wedge can you merge now?

manic glacierBOT
indigo wedge
#

😮

#

Merge all the things!

slender iron
#

😃

#

its weirdly mixed with push access

#

💤

solar whale
#

@idle owl I released new version of the Adafruit_CircuitPython drivers for STMPE610 and RFM69 -- I hope I did it right - If not, let me know what I should have done differently. Bumped STMPE610 up to 1.0.0 since I "think" it has addressed the known issues.

#

@idle owl looks like travis had some issues with the release 😦 -- odd since it worked for the commit -- are the rules different for release? I won't have time to look into it until tonight. Let me know if I need to do anything right away or if it ok for it to sit as for awhile.

#

In fact, I don't even understand what it is complaining about -- any guidance would be appreciated.

lavish saffron
#

Hi, I’m playing with CircuitPython 3. I’m trying to convert byte objects to string objects. The decode method isn’t implemented for byte objects. Please can you tell me whether there a simple alternative?

manic glacierBOT
raven canopy
#

I'll take a peek and see if I notice anything. I'm guessing it's RTD related... @solar whale

stuck elbow
#

@lavish saffron works for me:

>>> b'aaa'.decode('utf8')
'aaa'
lavish saffron
#

Thanks. That’s interesting. When I run the same command, it raises an AttirbuteError: ‘bytes’ object has no attribute ‘decode’. When I copy and paste into Python 3.6.5 it runs. I’ll reinstall CircuitPython and see if that helps.

main meteor
#

You could also try str(b'aaa') or unicode(b'aaa') depending on what type you want.

solar whale
#

@stuck elbow @lavish saffron Do any of the board dependent build settings (mpconfigport.h) impact this? What board are you using?

stuck elbow
#

I tried on itsybitsym0

#

@main meteor there is no unicode() in python 3

solar whale
#

just wondering if the small board < 192000 flash options are an issue.

stuck elbow
#

let me flash 3.0 on a gema

lavish saffron
#

I’m running it on a Metro M0 Express. Reinstalling CircuitPython 3.0.0 didn’t help.

solar whale
#

ok - nevermind.

stuck elbow
#

hmm, sorry, I tried on 2.x

#

on 3.x it doesn't work

#

but this works:

>>> str(b'aaa', 'utf8')
'aaa'
>>> str(b'\xc4\x85', 'utf8')
'\u0105'
lavish saffron
#

Thank you. That’s just what I need. I appreciate the time you’ve spent.

stuck elbow
#

sorry for misleading

#

now I remember a discussion in the bugtracker in micropython about dropping .decode()

raven canopy
#

@solar whale line 258 in adafruit_STMPE60.py pylint is complaining that you've renamed a module with the same name: import adafruit_bus_device.spi_device as spi_device. Not sure why it didn't complain until the merge/release.

solar whale
#

@raven canopy ah -- odd - that was there in the previous release as well.

raven canopy
#

Same with i2c on line 254. Yeah, I've seen it pass plenty. It may be a recent addition... 🤷

solar whale
#

thanks - I can make it happy, if necesary - will need to restest. For the one about the else in thr RFM69, I think Travis is just wrong - the final else Raises an exception , there is not return

#

also not changed since the last release. Travis is just getting grumpier with age.

raven canopy
#

Yeah. I would disable that one. The else is definitely used. Although, you could drop the else, and dedent the raise. It will only make it that far if none of the conditions are met. I think that is pylint's "intent" of the warning.

solar whale
#

True -- resistance is futile ...

#

Thanks -- I guess I'll make those changes, retest and submit new PR's. sigh..

#

It may not happen until this weekend.

#

Is is necessary to "cancel" or "pull back" the releases I tried today - or just let them sit until the new ones are ready

raven canopy
#

I'd let them sit. Functionally it works, so if someone grabs it if adabot updates the bundle, it should be fine.

solar whale
#

Agreed --- It's a bit annoying that these issues were not flagged at the merge stage so they could have been dealt with then. Was somethigng changed in the way pylint is used in the last few days?

#

@raven canopy The more I think about it, the more I think this should be corrected. IF there was an update to the rules between the merge and release, then I guess its not a real problem, but if the rules should not be different for merge and release. Any suggestions on how t follow up on this?

manic glacierBOT
raven canopy
#

We'll, I think @slender iron holds the keys and knowledge on the intricacies of Travis, Sphinx, et Al. But, he's out starting today I think.

solar whale
#

OK - we'll see if anyone sees this discussion -- If not, I'll raise it next Monday. Thanks

indigo wedge
#

So I'm working on a C class and have a property that's a list, is it possible to somehow get notified every time an item is appended to the list? I thought I could make my own list class that inherits list and overloads append, but unsure if that's possible in CP. I could drop the property and just have get_x and add_x and do my thing in add_x but I'd rather have a property. Any ideas? Maybe I'm not approaching this in a Pythonic way?

stuck elbow
#

@indigo wedge why do you need to do something when an item is added?

indigo wedge
#

this is for ble, when i add a characteristic to a service i need to register it in the ble driver to get a unique handle and pass it back to the characteristic, i could do this also later when the service is actually used but then the characteristic won't have the handle until then

stuck elbow
#

@indigo wedge what would happen if instead of appending to that list, someone just replaced the whole list by doing foo.bar=[new, list]?

indigo wedge
#

can you that if the property has no setter?

stuck elbow
#

so it's a property, not an attribute?

#

I see a lot of magic in there

#

can't you just pass a list of characteristics to the call that actually needs that information?

indigo wedge
#

yeah i think i might end up doing that

stuck elbow
#

or even have a method like register_charcteristics(list)

prime flower
#

@solar whale I usually have travis run (you'll need to set it up to the repo online via travis site or locally on your computer with travis-cli) on a cloned repo (adafruit_repo -> brentru_repo) before PR'ing into an Adafruit Repo

solar whale
#

@prime flower I did that - the PR passed travis build and test fine -- it was not until I released the new version that it complained.

prime flower
#

(shakes fist in air) TRAVIS!

covert oxide
#

Hi, so, I have a "mylib.py" with about 14 functions and 2 class definitions, and when using it in "myCode.py" I'm observing that the import statement takes about 16 seconds on CP 3.0, where it was almost instantly on 2.3.1... is that something anyone else has observed?

slender iron
#

@solar whale sounds like pylint was updated

solar whale
#

@slender iron OK - so just bad timing on my part.

slender iron
#

@covert oxide file an issue and we'll look at it

#

we are doing more memory stuff than before

meager fog
#

@umbral dagger hey totally no biggie but if you can remember, please squash your PR's if youve got a ton of linty-commits 😃

#

i enabled squash-n-merge on the learn guide repo as well!

slender iron
#

we disable it on most repos because it makes updating the original branch harder. I suggest squashing locally instead of during the merge

meager fog
#

@slender iron ok np - can disable it, just turned it on late last nite

#

iz gone now

slender iron
#

np, just letting you know why

meager fog
#

👍

tidal kiln
meager fog
#

@tidal kiln its not a terrible idea, and never has bricked a board.

slender iron
meager fog
#

but ill update it!

indigo wedge
#

Hi @slender iron , yes I've seen it, need some time to sit on it and think 😉