#circuitpython-dev

1 messages Β· Page 147 of 1

timber mango
#

what else might I remove to get some memory?

stuck elbow
#

you don't have rgb.mpy?

timber mango
#

sure I do

#

the rgb.mpy can be removed without error. the rgb.py cannot be removed (otherwise ... no attribute 'color565' )

stuck elbow
#

it should be there

timber mango
#

well, I have them both. but not enough memory πŸ˜ƒ

stuck elbow
#

as long as .py files is there, CircuitPython will load that

#

by the way, changing the order of imports may help

timber mango
#

I tried ... in vain

stuck elbow
#

are you also importing anything else?

timber mango
#

import time
import board
import busio
import digitalio
import adafruit_gfx.gfx as gfx
import adafruit_rgb_display.ili9341 as ili9341

stuck elbow
#

the first 4 don't take memory, as they are built-in

opaque patrol
#

per the example in github..``` from adafruit_rgb_display import color565

#

but you should remove rgb.py and only use the mpy

timber mango
#

@opaque patrol: doing this brings me back to 'AttributeError: 'module' object has no attribute 'color565' '

stuck elbow
#

@timber mango I just realized I gave you the wrong link for the mpy files

#

it's the micropython version of the library

#

you should get the circuitpython one

opaque patrol
#

@timber mango What version of CP do you have and what is the version on the library? The library version can be found in the VERSION.txt file in the lib folder

stuck elbow
#

sorry about that

timber mango
#

@opaque patrol: it is the bundle 2.2.1 that I installed, the same 2.2.1 for CP (as far as I understand ... sure I did not get anything like version 3.x.x)

opaque patrol
#

I am loading 2.2.1 on my Metro M0 to check. It was in 2.2.0 so you would think it is in 2.2.1

timber mango
#

@stuck elbow: do not worry - i replaced according to your new reference but still: I must have rgb.py as well

#

same result about memory consumption

stuck elbow
#

@slender iron this doesn't look correct:

MemoryError: memory allocation failed, allocating %u bytes
opaque patrol
#

If you have rgb.py then that might cause a name collision with the color565 in the mpy

timber mango
#

@opaque patrol: is it not an file '...uf2'-file that starts my CP? in this case I run 2.2.3

opaque patrol
#

The uf2 contains circuitpython. The libraries are in the lib folder. Those are in the link I pasted above

#

If you look in the lib folder, there should be a folder named 'adafruit_rgb_display' and this contains the library files including rgb.mpy

timber mango
#

correct - it is there. the bundle I used up to now dated Feb-05.

opaque patrol
#

If you type this in the REPL, does it give an error? ``` from adafruit_rgb_display import color565

timber mango
#

fine, no errors.

opaque patrol
#

Then you should be able to use it in your file. Unless you are also importing the rgb.py file

stuck elbow
#

can you paste the full error?

#

maybe the example code is wrong

timber mango
#

still the same: as soon as i use the code that you sent above without the rgb.py I get the error. putting rgb.py back in place, the error is gone but memory shortage comes.

opaque patrol
#

The gfx is for micropython. I think everything that is in that is in the rgb_display cp library

#

Try using on these as your imports ```import time
import board
import busio
import digitalio

import adafruit_rgb_display.ili9341 as ili9341
from adafruit_rgb_display import color565

#

Here is the example in the ILI9341 file....I can't say for sure if it is up-to-date, but it should be better than trying to use the gfx ``` import busio
import digitalio
import board
from adafruit_rgb_display import color565
import adafruit_rgb_display.ili9341 as ili9341
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
display = ili9341.ILI9341(spi, cs=digitalio.DigitalInOut(board.GPIO0), dc=digitalio.DigitalInOut(board.GPIO15))
display.fill(color565(0xff, 0x11, 0x22))
display.pixel(120, 160, 0)

timber mango
#

It looks pretty much the same ...
I enclose the (meanwhile) modified example name "ili9341_test"# Simple test of primitive drawing with ILI9341 TFT display.

This is made to work with ESP8266 MicroPython and the TFT FeatherWing, but

adjust the SPI and display initialization at the start to change boards.

Author: Tony DiCola

License: MIT License (https://opensource.org/licenses/MIT)

#import gfx
#import ili9341
#import machine

Build-in Libraries

import time
import board
import busio
import digitalio

Extra Libs which take RAM

import adafruit_rgb_display.ili9341 as ili9341
from adafruit_rgb_display import color565
import adafruit_gfx.gfx as gfx

Setup hardware SPI at 32mhz on ESP8266 MicroPython.

#spi = machine.SPI(1, baudrate=32000000)

Setup Metro-M0 SPI bus using pins (instead of hardware SPI):

from board import D13, D12, D11, D9, D10
spi = busio.SPI(clock=D13, MOSI=D11, MISO=D12)

For the Metro-M0

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

Setup ILI9341 display using TFT FeatherWing pinout for CS & DC pins.

display = ili9341.ILI9341(spi, cs=cs, dc=dc)

Optionally create faster horizontal and vertical line drawing functions using

the display's native filled rectangle function (which updates chunks of memory

instead of pixel by pixel).

def fast_hline(x, y, width, color):
display.fill_rectangle(x, y, width, 1, color)

def fast_vline(x, y, height, color):
display.fill_rectangle(x, y, 1, height, color)

Initialize the GFX library, giving it the display pixel function as its pixel

drawing primitive command. The hline and vline parameters specify optional

optimized horizontal and vertical line drawing functions. You can remove these

to see how much slower the filled shape functions perform!

graphics = gfx.GFX(240, 320, display.pixel, hline=fast_hline, vline=fast_vline)

Now loop forever drawing different primitives.

...

idle owl
#

@timber mango Can you edit your message and place three backticks (the key at the top left of your keyboard with the tilde) on either side of your code? It makes it much easier to read.

timber mango
#
# adjust the SPI and display initialization at the start to change boards.
# Author: Tony DiCola
# License: MIT License (https://opensource.org/licenses/MIT)
#import gfx
#import ili9341
#import machine

# Build-in Libraries
import time 
import board
import busio
import digitalio
# Extra Libs which take RAM
import adafruit_rgb_display.ili9341 as ili9341
from adafruit_rgb_display import color565
import adafruit_gfx.gfx as gfx

# Setup hardware SPI at 32mhz on ESP8266 MicroPython.
#spi = machine.SPI(1, baudrate=32000000)
# Setup Metro-M0 SPI bus using pins (instead of hardware SPI):
from board import D13, D12, D11, D9, D10
spi = busio.SPI(clock=D13, MOSI=D11, MISO=D12)

# For the Metro-M0
dc   = digitalio.DigitalInOut(board.D9)
cs   = digitalio.DigitalInOut(board.D10)

# Setup ILI9341 display using TFT FeatherWing pinout for CS & DC pins.
display = ili9341.ILI9341(spi, cs=cs, dc=dc)

# Optionally create faster horizontal and vertical line drawing functions using
# the display's native filled rectangle function (which updates chunks of memory
# instead of pixel by pixel).
def fast_hline(x, y, width, color):
    display.fill_rectangle(x, y, width, 1, color)

def fast_vline(x, y, height, color):
    display.fill_rectangle(x, y, 1, height, color)

# Initialize the GFX library, giving it the display pixel function as its pixel
# drawing primitive command.  The hline and vline parameters specify optional
# optimized horizontal and vertical line drawing functions.  You can remove these
# to see how much slower the filled shape functions perform!
graphics = gfx.GFX(240, 320, display.pixel, hline=fast_hline, vline=fast_vline)

# Now loop forever drawing different primitives.
...```
#

πŸ˜ƒ

#

@idle owl: the backtick is not on all keyboard in the same position. indeed, I had to google how backtick looks like to find it top right hand sided ... πŸ˜ƒ

idle owl
#

Oh good to know! Thank you!

opaque patrol
#

@timber mango Remove the gfx from import and comment out the line ``` graphics = gfx.GFX(240, 320, display.pixel, hline=fast_hline, vline=fast_vline)

#

These functions are built in to the ILI9341 library in CP

#
    display.fill_rectangle(x, y, width, 1, color)

def fast_vline(x, y, height, color):
    display.fill_rectangle(x, y, 1, height, color)
#

They can be called simply as ```
display.hline(x,y,width, 1, color)
display.vline(x,y,height, color)

timber mango
#

success, I can apply the two instructions above.

#

how can I write text to the display?

stuck elbow
#

I'm afraid we don't have the library for that yet

timber mango
#

thanks to all of you !!!!
... i learnt quite a lot tonight. It's midnight in Europe and I call it a day. I'll drop by from time to time to see how libraries progress.
Good night - and good luck πŸ˜ƒ

tulip sleet
opaque patrol
#

The %u means unknown πŸ˜ƒ

stuck elbow
#

@tulip sleet oh, cool

#

@tulip sleet I'm trying to get the gamepad module to work in 3.0, but I'm hitting a weird problem β€” it works when the GamePad object is created from the REPL, but not when it's in a frozen module

tulip sleet
#

@stuck elbow can you import it at all when it's frozen?

stuck elbow
#

yes, importing works, it's where I create it that matters

#

the crash happens in the tick function as soon as it tries to read the pin state

tulip sleet
#

did you freeze gamepad or something that uses it?

stuck elbow
#

something that uses it

tulip sleet
#

if you .mpy the something that uses it and import that, does it also crash?

stuck elbow
#

yes

tulip sleet
#

so the problem is that the using code is .mpy, not that it's frozen? If the using code is .py, it's OK?

stuck elbow
#

yes, sorry, I wasn't precise

#

ok, one more datapoint, if the .mpy file imports a .py file in which GamePad is created, it crashes too

#

I will report an issue and describe it in detail

tulip sleet
#

@stuck elbow thanks!

brazen bluff
#

Hi everyone. I just added a new linux system and went with Mint. I'm wondering if I want to use the adafruit classic playground. How do I install circuitpython on Mint?

timber mango
#

Mu is our recommended editor and is cross platform

brazen bluff
#

I'm able to unzip the tarball but I"m not sure what to do from there?

stuck elbow
#

do you have any board from Adafruit, like the Feather M0 or the Circuit Playground Express?

solar whale
#

@brazen bluff circuitpython executes on the micro controller, not on your host system. You can use your linux system to install circuitpython on the microcontroller, but unfortunately, it won’t run on a CircuitPlayground Classic. You need one of the supported boards. There is a list here. https://www.adafruit.com/category/956.

steady flower
#

hello world!

solar whale
#

@steady flower Hello!

steady flower
#

I'm new here. just created an account

solar whale
#

Welcome - Are you using CircuitPython?

steady flower
#

yes. I have a Circuit Playground Express.

solar whale
#

Nice!

steady flower
#

I have some basic programming experience with it-I've made simple animations with the Neopixels and stuff

solar whale
#

It is a great platform for leaning - both programming and how to use the various sensors.

steady flower
#

I agree.

#

I got the STLs of the case that the Ruiz brothers made for the Playground, and printed one out for mine. it works great!

solar whale
#

That's great! They have provided some great cases for different boards and projects.

steady flower
#

yeah. I like their designs.

#

question-does Mu work on older Windows machines?

stuck elbow
#

it should

#

it's just python and qt

steady flower
#

cool. thanks

carmine hornet
#

So none of the outputs on my trinket m0 are working

#

Can someone help please?

#

I need it for a project that's due tomorrow

#

Even pin 13 isn't working

stuck elbow
#

define "working"

#

how are you testing it?

carmine hornet
#

Can't control the output

#

Here's my code:

stuck elbow
#

can you tell us what you are doing exactly, and how you know it's not working?

carmine hornet
#
import board
import time

motor = DigitalInOut(board.D1)
motor.direction = Direction.OUTPUT

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
while True:
    motor.value == True
    led.value == True
    print("on")
    time.sleep(1)
    motor.value == False
    led.value == False
    print("off")
    time.sleep(1)```
#

It prints on and off, but nothing is actually happening

stuck elbow
#

what do you expect to be happening?

carmine hornet
#

Pin 13 and the D1 should turn on, wait a second, and turn off

stuck elbow
#

how are you checking if they are on/off?

carmine hornet
#

The led onboard should turn on, and the led cconnected to d1 should turn on (it's labelled as motor, because I put a relay there before, but used an led for debugging)

#

They were working before

stuck elbow
#

how is the led connected?

carmine hornet
#

D1 to resistor to led to ground

#

Also, the led is staying on and not turning off and the onboard led is doing the opposite

stuck elbow
#

and the cathode is to ground?

carmine hornet
#

Yes

#

The led is lighting up for some reason, but not turning off

stuck elbow
#

you say it worked before, what did you do with it just before it stopped working?

carmine hornet
#

I changed the relay

#

But the relay before wasn't working either

#

And it was working, but then it just stopped

stuck elbow
#

how was the relay connected? is it just a relay, or is it a relay module with a transistor on it?

carmine hornet
#

Relay with transistor and optocoupler

rotund basin
#

Anyone know if usb communication is in the Cpython, so I can communicate with another device via usb?

stuck elbow
#

@rotund basin what kind of another device? and by cpython you mean the normal python on your PC?

#

@carmine hornet I'm sorry, I'm out of ideas about what you could try

carmine hornet
#

I going to re-flash circuitpython to see if that helps

stuck elbow
#

you can also try disconnecting everything you have connected

manic glacierBOT
rotund basin
#

@stuck elbow I mean a gps or a cellular module that is connected to a feather by usb

#

Usb = full duplex communications

stuck elbow
#

I'm not sure circuitpython supports the host mode of the usb

rotund basin
#

Hmm

stuck elbow
#

I think that the samd21 microcontroller can act as a host in some limited cases (for a keyboard, for example), but otherwise it's mostly in a device mode

#

that is, something you connect to the usb, not something that you connect usb to

rotund basin
#

Ok cool, it's not that important at the moment πŸ˜ƒ

solar whale
#

@carmine hornet I treied you code on a trinket_m0 and get teh same results - D13 stays on - looking at it.

carmine hornet
#

D13 doesn't stay on for me, D1 does

#

D13 doesn't turn on at all

stuck elbow
#

@carmine hornet I see the problem, you use == instead of =

carmine hornet
#

Of course I did

stuck elbow
#

sorry I didn't catch that

solar whale
#

yes - just saw the ==!!

carmine hornet
#

And D1 was staying on because of the way my circuit was designed

solar whale
#

sorry - I was looking at the wong led (power was on πŸ˜‰ . replacing the == with = now D13 blinks. I don;t have D1 connected

manic glacierBOT
carmine hornet
#

The relay still won't work

#

I'm trying to figure out why

timber mango
#

its not turning off? You sure its not a latching relay?

carmine hornet
#

The relay doesn't turn on or off

#

I tried the cicuit with an led and it works

#

I also tried it with the relay connected to 3v and it works

#

I'm rebuilding the circuit now

timber mango
#

ok

carmine hornet
#

Should the relay have a resistor?

#

Does it need one?

timber mango
#

I am not sure what you are doing but I don't see why it would need one, but then again I am unfarmiliar with your project.

#

an Led would

carmine hornet
#

And........ there's a click

#

Yee

timber mango
#

you want to limit current to an LED to prevent from burning it out, but a relay I'm not really sure but I would think as long as your pulsing it within its rating I don't see why you would need one

#

yay!

carmine hornet
#

So there's a click, but it still isn't working

#

Maybe I need 5v to the relay

timber mango
#

are you using a transistor?

carmine hornet
#

Yes, and an optocoupler

timber mango
#

ok cause was searching and found some troubleshooting for a npn transistor but not to do with an optocoupler

carmine hornet
#

The clicking is very faint

#

And I only hear it when it turns off

timber mango
#

hmm I hope that don't mean a dead relay, faint is bad

carmine hornet
#

It works when I connect it from 5v to ground

#

Also, the optocoupler and transistor work, I tried them with an LED

timber mango
#

Yea I'm not really sure, wish I knew moer about hardware maybe I can look up while you tinker.

carmine hornet
#

Just tried with a different relay

#

Louder noise, no motor

#

Oh, the battery isn't on

#

Odd, the motor sometimes works

timber mango
#

perhaps this post will help

#

it includes a schem and is using the same parts as you

carmine hornet
#

I used that circuit

#

Oh wait, I forgot the diode!

#

Let me try that

timber mango
#

yea was wondering that but heh

carmine hornet
#

I'm also using the power from the trinket

#

Maybe a different power supply will help

timber mango
#

to run the motors you mean? yea.

carmine hornet
#

No, in the circuit diagram the relay is connected to a seperate power supply

#

IT WORKWETKJRKJLWRJIORGJIDFPGJOFDOJGPDFJOGFOGJPS

#

Sorry

#

But it works

timber mango
#

yay!

manic glacierBOT
timber mango
#

On the circuit playground express, is there a way to control the volume of the speaker? I see the tone_volume in _sine_sample, but I'm not sure how one would modify that function to allow the volume to be defined by a parameter

#

I know there is a set volume in makecode, will have to dig if it gives up the code

#

examining the code looks like:

#

music.setVolume(128)

#

but that is the javascript from makecode

#

is that javascript? I am working in circuitpython

#

ahh. Hmm. good to see that it is possible, but now to figure out how that would be done in python. Is the source for that javascript available somewhere?

#

yea just trying to see if maybe there is an example brb

manic glacierBOT
opaque patrol
#

I don't know if you can adjust the volume directly but theoretically the amplitude of the sine wave controls volume (I think)

timber mango
#

yes, BD, I do believe you are right. now I just need to add a function to change that dynamically.

opaque patrol
#

@timber mango You are the first person to recognize the initials

timber mango
#

hah, my technician's license finally pays off. what do I win? πŸ˜„

opaque patrol
#

I think the value I replaced with v2 might be changing the amplitute. It is difficult to tell

timber mango
#

yes, that would give you 15 steps of volume to play with?

opaque patrol
#

No, I am still testing it...

stuck elbow
#

I think it should be just v2, not 2 ** v2

#

then you get more range

timber mango
#

that may be a bit much (2^15) to fiddle with. maybe match the makecode 2^7 value?

opaque patrol
#

I modified the sample code from above to increment the value so you can get an idea... ```
from digitalio import DigitalInOut, Direction
import audioio
import board
import array
import time
import math

FREQUENCY = 440 # 440 Hz middle 'A'
SAMPLERATE = 8000 # 8000 samples/second, recommended!

Generate one period of sine wav.

def gen_sine_wave(v2):
length = SAMPLERATE // FREQUENCY
sine_wave = array.array("H", [0] * length)
for i in range(length):
sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** v2) + 2 ** 15)
return sine_wave

enable the speaker

spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
spkrenable.direction = Direction.OUTPUT
spkrenable.value = True

vs = 14.0
while vs < 16.0:
vs += 0.25
print(vs)
sine_wave = gen_sine_wave(vs)
sample = audioio.AudioOut(board.SPEAKER, sine_wave)
sample.frequency = SAMPLERATE
sample.play(loop=True) # keep playing the sample over and over
time.sleep(1) # until...
sample.stop() # we tell the board to stop

#

Not sure if that helps or not, It might be changing the tone, I don't have a good ear for that

timber mango
#

here is a guitar project that describes adjusting the volume to get rid of the high volume buzz, I was trying to isolate the exact line but I'm not having much luck, anyway it might be something to look over, he also has code on github here is the link:
http://scruss.com/blog/2017/12/27/circuit-playground-express-chord-guitar/

opaque patrol
#

He adjusted the wav files to change the volume

timber mango
#

ahh ok was wondering why I could not find an adjustment even in the github doh sorry

opaque patrol
#

At the bottom it says "This is roughly how I sythesized the samples" is a link to another articule which contains a link to Sox, a free sound processing program

timber mango
#

thanks for the info, all. I'll look into this further and put in an issue on the repository. I'm not quite to the level of putting in a pull request myself

idle owl
#

@timber mango When you get to that point, don't hesitate to ask for help with GitHub and git!

timber mango
#

@idle owl I will keep that in mind! I'm very impressed by the community that works on circuitpython. I know you're working hard on that, so thank you for all your work!

idle owl
#

I'm glad to hear that! And we all thank you πŸ˜ƒ

#

@timber mango Scrolling back... What code are you using? There's some issues with a couple of the snippets posted and I want to make sure you're starting on the right track.

timber mango
#

@idle owl I'm working from scratch with the circuitpython library. I'm working on the idea of a cpx theremin, but I need to be able to change the volume of the tone quickly in response to a change in capacitance on one of the inputs

idle owl
#

Oh nice!

timber mango
#

the idea is nice, but as I've come to appreciate lately: PoCorGTFO πŸ˜„

idle owl
#

Ok. We updated the documentation in a few places as we found better ways to work with the onboard speaker on the CPX. As well, there are updates in CircuitPython itself to make the sound stuff work way better. So make sure you're using the most up-to-date builds as you get started.

timber mango
idle owl
#

Which link?

timber mango
idle owl
#

Oh. So it does. Good catch! Thanks!

#

@timber mango The link should be updated now

neon ferry
#

Hello everyone. I've been enjoying CircuitPython a lot. I noticed that my project stops after a few hours and it seems to be running out of memeory. Is it normal to manually call the MicroPython garage collection occaisonally? Or shold I just arange to only allocate memeory at startup? Other ideas? Any answers appreciated and nice job on the platform!

#

garbage* not garage πŸ˜ƒ

idle owl
#

It's not necessarily abnormal, but you also shouldn't necessarily need to run garbage collection. What's the project?

timber mango
#

have you tried leaving it running with a serial connection open? maybe there is an error being thrown that would be helpful in figuring out where the issue is coming from?

neon ferry
#

It's a little alarm clock that get time from NIST TCP TIME protocol (a string that they send you when you conenct). I return a list of [hours,minutes,seconds] from a function that gets time from the string. I think that is the things that is alllocating. I was jsut surprised since I'm new to Python and especially this Python.

#

Oh and there is some string formatting too whcih might allocate.

#

Hey bsx, no exceptiuno, btu I added "print("free: " + str(gc.mem_free()))" and it creeps up every loop πŸ˜ƒ

idle owl
#

Neat project!

neon ferry
#

Or down i mean!

idle owl
#

Hmm ok

neon ferry
#

So do you guys have any "run forever" CircuitPython projects?

idle owl
#

I have a lamp that's been running for 3 days but it's not gathering more data, it simply runs its loop.

#

It does sound like you're loading up memory and it's not getting cleared.

timber mango
#

same. I have something waiting for input from button or touch, but it doesn't connect to anything outside those inputs. how are you doing the TCP connection? is it possible that you are caching something from that connection that may not be clearing when it loops?

neon ferry
#
    # Get the time string from NIST.  This uses time procotol rather than
    # more efficient NTP, because I could not find a way in MicrpPyton to
    # get date and time from seconds since 1970.
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    #s.connect(('​time.nist.gov', 13))
    s.connect(('132.163.97.2', 13))
    b = s.recv(1024)
    s.close()
    return b.decode('ASCII')
idle owl
#

Have you tried adding a gc.collect() in it to see if it helps? I've not worked with gc enough to know how effective it is in code - I've usually used it in the REPL.

neon ferry
#
    # Example: b'\n58158 18-02-09 17:26:41 00 0 0 802.0 UTC(NIST) * \n'
    s = s.replace('-', ' ')
    s = s.replace(':', ' ')
    fields = s.split()

    hours = int(fields[4])
    minutes = int(fields[5])
    seconds = int(fields[6])

    # Get rid fo military time
    if hours > 12:
        hours = hours - 12

    # Convert to PST
    hours = hours - 8
    if hours < 0:
        hours = hours + 12

    return [hours, minutes, seconds]```
#

kattNI: I jsut tried using "gc.enable()" to see that exact thing

idle owl
#

We currently have an issue open to add gm.time - it's being worked on but it's not implemented yet.

neon ferry
#

Ya that issue came from a convo with me πŸ˜ƒ

idle owl
#

Oh nice! Ok

neon ferry
#

Hey duh, the gc.enable seems to be doing it πŸ˜ƒ

#

Still glad I asked though

idle owl
#

Oh ok, good!

neon ferry
#

Alright, alright, still learnign the platform. Good stuff and thanks for your thoughts.

idle owl
#

You're welcome! Never hesitate to ask. Multiple times I've asked a question and realised my answer simply from talking it out. It happens!

neon ferry
#

embarrased πŸ˜‰

#

Not!

timber mango
#

@neon ferry Thank you for sharing, I didn't realize that was something to worry about. gc.enable() has been added to my knowledge base now!

neon ferry
#

I'm used to the desktop as well!

idle owl
#

It's an unsual case to need it. There are places where CircuitPython goes garbage collection on its own, but obviously in this case, it's not at times that are helping.

#

But gc is great to have, it's true.

neon ferry
#

It's a major part of the decision to use CircuitPython for sure. THat adn you all seem to have done the work for the boards...

idle owl
#

πŸ˜ƒ

neon ferry
#

Anyway, time to go make a box for it! See you next time

tulip sleet
#

@neon ferry gc.enable() turns on garbage collection, but it's turned on already by default. To force a garbage collection at a particular time, do gc.collect(). If you want to double-check whether it's on, do gc.isenabled()

neon ferry
#

Hi Dan. Just saw this. Hmm. Maybe that was not my issue then. It would have been strange to have it off by default now that I think about it. Thanks for the reply! I've added some exception handlers, and I'll post back when I figure it out. Jim.

tulip sleet
#

@neon ferry there can still be fragmentation, which might be the problem you're having. So putting a gc.collect() in the main loop might help, and then check and see whether gc.mem_free() is still decreasing steadily. GC is not run until free space gets tight.

neon ferry
#

I'm going to let it run as it takes a while to die. Maybe it is not even that and I'm instead getting an exception during networking. Thanks for your ideas, it helps! I have some info logged to the serial port now so I won't miss it I think.

manic glacierBOT
candid stump
#

Anyone know how to force the mu editor to recognize circuit playground instead of thinking it is looking for a microbit? This is on a mac. CIRCUITPY is mounted, but restarting mu results in it still thinking I am trying to use a microbitl

raven canopy
tulip sleet
#

@candid stump only more recent versions of mu support circuit playground

#

what version are you using?

ruby lake
#

only one thing left to code for first module playground example program, knob selection of midi cc controlelr type

slender iron
#

<@&356864093652516868> and everyone else. We're on for our normal meeting tomorrow (Monday) here in Discord. Its at 11 am Pacific / 2 pm Eastern. See you then!

indigo wedge
#

8PM CET, got it!

slender iron
#

how are things going @indigo wedge ?

indigo wedge
#

Things are good, it's 7.30AM here, getting ready for work :D

slender iron
#

great! πŸ˜„ Have a good day. I'm doing my homework before the meeting tomorrow πŸ˜ƒ

indigo wedge
#

Nice!

slender iron
#

yup yup, helps me get ahead for the week

manic glacierBOT
#

We had a bad cookiecutter for a while that added extra lines into the README.rst in the ReadTheDocs badge like this:

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-vcnl4010/badge/?version=latest

    :target: https://circuitpython.readthedocs.io/projects/vcnl4010/en/latest/

    :alt: Documentation Status

It should be:

.. image:: https://readthedocs.org/projects/adafruit-circuitpython-vcnl4010/badge/?version=latest
    :target: https://...
fierce oar
#

Hello CP wizards! I need help: I can't get my gemma m0 to work in my project, code worked fine on my trinket m0. Have been trying to work through the CP guide to fix my issues, but keep hitting dead ends. Hoping someone has a moment to help me troubleshoot tomorrow evening, thanks in advance!

manic glacierBOT
stuck elbow
#

@fierce oar it's hard without knowing what the issues are

manic glacierBOT
manic glacierBOT
manic glacierBOT
tidal kiln
#

@strange juniper so it was just a USB 3.0 issue? (sorry for delay)

fierce oar
#

@stuck elbow didn’t want to type too much without anyone around for dialogue, figure it’s something simple so I’ll check back after work tonight.

tidal kiln
#

@fierce oar can you describe what happened?

manic glacierBOT
fierce oar
#

@tidal kiln I had been running the CP NeoPixel sample code on a Trinket M0 with NeoPixels, then I moved everything over to a Gemma M0 and changed the pin number and the NeoPixels won’t light. When I try to make changes to the main.py file, a small change like just changing the PIN number, I can’t save the file because it’s out of space

#

I’m on a MacBook Pro, I tried to reinstall the default files, but not enough space for them even though I deleted everything I could see, so I thought it was the hidden files issue. I didn’t have the energy to dig into terminal last night so I was looking for the files to copy over that keep the hidden files from being placed on the drive but I couldn’t find them

manic glacierBOT
fierce oar
#

Anywhoo I can post links to what I’m talking about when I’m back at my computer after work, gotta hit the traffic now πŸ˜ƒ thanks!

tidal kiln
#

k. later. good luck with commute.

manic glacierBOT
indigo wedge
#

7 commits away from 10k πŸ˜„

manic glacierBOT
neon ferry
#

Just a note for posterity regarding some questions I was asking yesterday: Dave is correct that the garbage collection is indeed on by default (it would be madness if not), and that was not my problem. (The real problem is not being used to Python yet.) Thank you to all helpers.

#

(I meant Dan) /over

tidal kiln
#

@neon ferry you can also edit your previous post(s) LIKE THIS! πŸ˜€

solar whale
#

without getting too deep into the weeds, can anyone shed any light on this error. ```Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "vl53l0x_test.py", line 13, in <module>
File "vl53l0x_test.py", line 12, in <module>
File "adafruit_vl53l0x.py", line 498, in range
File "adafruit_vl53l0x.py", line 291, in _read_u8
File "adafruit_vl53l0x.py", line 291, in _read_u8
File "adafruit_bus_device/i2c_device.py", line 86, in readinto
TypeError: extra keyword arguments given

neon ferry
#

@tidal kiln Goctha

solar whale
tidal kiln
#

@solar whale what's vl53l0x_test.py?

solar whale
#

I've never seen this on any other board, so I suspect it is an nrf52 issue, but wanted to see if anyone recogniced somethin inthe bus_device stuff that would indicate it is an issue there.

tulip sleet
#

@solar whale where is the adafruit_vl53l0x.py code?

solar whale
#

@tidal kiln it is the test code for the vl53l0x driver.

#

Just a sec- I'll post it - slightly modified from example.

#
from board import *
import busio
import time

import adafruit_bus_device.i2c_device as i2c_device
import adafruit_vl53l0x


with busio.I2C(PA27,PA26) as i2c:
    vl=adafruit_vl53l0x.VL53L0X(i2c)
    while(True):
        print ("distance " , vl.range)
        time.sleep(1)

tidal kiln
#

why the context manager for busio.I2C?

tulip sleet
#

line 86 in i2c_device.py just passes in the kwargs it gets, so we have to go back to _read_u8. Could you point to that code?

solar whale
#

just a sec

#

I think taht is what you wanted, correct?

tulip sleet
#

oh I was spelling it wrong "one" vs "el"

solar whale
#

what really puzzles me is that it runs for awhile before failing.... the error looks more like a fundamental syntax error.

tidal kiln
solar whale
#

@tidal kiln I'll try that.

#

yup ```

import vl53l0x_example
Range: 8190mm
Range: 8190mm
Range: 141mm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "vl53l0x_example.py", line 25, in <module>
File "adafruit_vl53l0x.py", line 498, in range
File "adafruit_vl53l0x.py", line 291, in _read_u8
File "adafruit_vl53l0x.py", line 290, in _read_u8
File "adafruit_bus_device/i2c_device.py", line 102, in write
TypeError: extra keyword arguments given

tulip sleet
#

it does look like some corruption going on, since the same code is executed multiple times in the loop.

solar whale
#

OK - so maybe it is a misreporting of the error - A timeout is a lot more understandable

tidal kiln
#

does line 498 of your copy of adafruit_vl53l0x.py jive with the repo?

solar whale
#

I'm running the .mpy from the 3.x Bundle release

fading solstice
#

time out defaults 0

solar whale
#

@fading solstice sorry - I'm not sure how to interpret that - is 0 the error number for timeout?

fading solstice
#
class VL53L0X:
    """Driver for the VL53L0X distance sensor."""
    # Class-level buffer for reading and writing data with the sensor.
    # This reduces memory allocations but means the code is not re-entrant or
    # thread safe!
    _BUFFER = bytearray(3)

    def __init__(self, i2c, address=41, io_timeout_s=0):
# pylint: disable=too-many-statements
#

io_timeout_s=0 if defaults to no timeout

solar whale
#

ah - yes - it is usually not enabled.

fading solstice
#

problably not line 498?

solar whale
#

an there is significant variability in the measuremnet times when running this code.

#

I'll admit, the traceback does not make a lot of sense to me.

fading solstice
#

agreed

solar whale
#

I'll try this on some differnt boards and see if I can reproduce it on anything other than the nrf52.

idle owl
#

@slender iron Do you want me to do the release on NeoPixel? Or did you plan to?

solar whale
#

FYI - I just ran the same code on a feather52 (I was running it on the PCA10056 NRF52840 DK board) and so far, the error has not been reporducible,

#

very intersting. This does appear to be an issue with that board. At least that helps focus the investigation. Thanks for the help. @tidal kiln @tulip sleet and @fading solstice

manic glacierBOT
#

I have been seeing an issue with I2C on the PCA10056 board with the CircuitPython master as of this morning:

Adafruit CircuitPython 3.0.0-alpha.1-140-g0388a57 on 2018-02-12; PCA10056 with NRF52840

I am opening this as a "heads up" and I'll continue to experiment with it.
The error reported below is using the vl53l0x driver from the current "bundle" and the test code from the examples subdirectory of the repo
https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X

for t...

timber mango
#

When I see something I don't understand from a reporting mechanism like that traceback, I usually introduce a new error (which functions as a breakpoint) to try to find where things went wrong.

manic glacierBOT
slender iron
#

<@&356864093652516868> starting the meeting soon!

tidal kiln
#

no mic. just going to listen in this week. nothing new from me. group hugs to all.

idle owl
#

Ok thanks @tidal kiln

indigo wedge
#

8PM CET

#

πŸ‡ͺπŸ‡Ί

idle owl
#

Keyboard ambience.

errant grail
#

A life-rhythm.

slender iron
idle owl
#

And we're happy to help you with learning GitHub!

indigo wedge
#

πŸ‘

timber lion
#

cant unmute

#

brb

indigo wedge
#

Hug report for Kevin aka. microbuilder (don't think he's here, someone relay πŸ˜‰ ) for being super cool about having to review all my PRs and @solar whale for testing my nRF changes πŸ˜ƒ

idle owl
#

@indigo wedge Keep rocking it! Kevin is super happy to have the help. You're doing great!

indigo wedge
#

Thanks πŸ˜ƒ

idle owl
#

@errant grail That's great to hear, thank you for the feedback! Super helpful.

timber lion
raven canopy
#

Hugs: @tannewt for a really good review and suggestions on Trellis lib. Group hug for support efforts this week on discord; I think the community really values this, and it keeps new members coming back.

inner raft
#

I may have found a minor bug in main.py that ships on the Trinket M0. The wheel() function returns an array of values. This works for the DotStar lib but doesn’t seem to work for the NeoPixel lib. Other examples of wheel() for NeoPixels returns a tuple, which does work.

indigo wedge
#

This week I'll try to look at #588 (Rename pins to match nRF convention), #615 (Add safe mode to nRF boards) and general nRF HAL cleanup.

idle owl
#

@inner raft You are correct. When did you purchase your Trinket?

indigo wedge
#

Correct πŸ˜ƒ

inner raft
#

2 weeks ago

idle owl
#

@inner raft Hmm good to know. I was under the impression that we had updated to resolve that. I'll look into it. Thanks for letting us know!

prime flower
#

balancing robots >>>

opaque patrol
idle owl
#

@prime flower If you make a PR for it, you can request the reviews through that. Otherwise you can just let us know when you're ready and make sure we're aware of location and so on. If you do create the PR, make sure to include a comment about not wanting it merged until you have reviews on it.

#

@inner raft One more question: did you purchase your Trinket directly from Adafruit or through a reseller?

prime flower
#

sure! I'm going to push the repo public by Wednesday, EOD. I'll put the new examples (USB-HID, CapTouch, IR) on a PR and the rest has already been committed.

#

thanks

inner raft
#

Direct from adafruit. I can dig up the order num if needed.

idle owl
#

@inner raft No need. I wanted as much info as possible on the timeline. This is perfect. Thank you!

opaque patrol
#

30 years for a 9V battery is pretty good lifetime

inner raft
#

Ordered Jan 31 it looks like.

idle owl
#

@inner raft Perfect, thank you.

errant grail
#

@tulip sleet Super idea!

manic glacierBOT
timber mango
#

FRAM if you don't need too much storage.

tidal kiln
errant grail
timber mango
#

nuuuuuuuuuuuuuu hardware!

idle owl
#

nu nu nu

timber mango
#

itz excitin

idle owl
#

I got mine too!

solar whale
#

mine come tomorrow 😦

indigo wedge
#

πŸ˜„

raven canopy
#

mission accomplished? πŸ˜„

ruby lake
#

pipe dream: usb data pins on feather header

timber mango
#

@idle owl ill opena n issue for that now

idle owl
#

@timber mango Excellent

raven canopy
#

Let me know what drivers you want help ported. That's easy...ish. @idle owl

timber mango
#

no status updates, lots of little things πŸ˜ƒ played with webusb

#

yep! πŸ˜ƒ

#

hug reports to tonyd for updating firmata to CPX, lets us move away from the classic CP

#

kattni for working on ikea project

#

arturo for helping with nrf52

#

dastels for awesome guides - keep em comin!

#

wait what??

#

what did i say 😦

#

oof

#

ok sommersoft worked on trellis and its great

#

ok that passed

#

i didnt swear! promise πŸ˜ƒ

#

and danhalbert for hacking on webusb / UF2 with me

#

thats it!

#

This week, I was able to interface CP2104 PiUART to
an old 8051-based microcontroller project, to replace an
aging MAX3232 serial interface to the host PC. I also
finally figured out how to do the RESET and C2 (two-wire
programming) lines for this development system, which
requires pin sharing. The C2 interface provides in-
circuit debugging as well as programming an uninitialized
device. Since the Silabs C8051F330D only has 20 pins (it
shipped in a now-deprecated DIP-20 package) and C2 isn't
used all that often, it makes sense to share the pins for
both C2CK and /RST (RESET). It all works now, exactly as
the original amrFORTH system did. Serial bootloader code
tweaking on both the host PC and the microcontroller figured
as well.
PiUART == awesome!
Also did a 14-segment alphanumeric display this week, the
hard way. ;) Kept up on discipline and have been diligently
capturing schematics, using Fritzing.

idle owl
#

@raven canopy I will, thanks! The guides I'm going to be starting with are Trinket, but I'll definitely open an issue and let you know if we run into needing something ported.

raven canopy
#

Update: fought LED changes to Trellis all day Saturday; don't try forcing class inheritance when it isn't needed. Got past that, now just working out the buffer slicing for LED & buttons. No movement on isSerialConnected, but that's a quick one to finish. Will visit open issues later in the week for next task.

#

Makes total sense.

slender iron
raven canopy
#

Brb...

timber mango
#

lol

#

kattni drops knowledge!

indigo wedge
#

Working on it πŸ™‚

timber mango
#

im into alpha release!

indigo wedge
#

I think the HAL cleanup will allow me to get a better overview of what works and what doesn't.

slender iron
timber mango
#

just very tiny ones

#

yahh

#

i have to update the testers yes

#

but no strong ETA

#

the testers burn in the bootloader

#

i just haven't updated them - so busy!

#

BUT

#

you can load in the update_uf2.bin

#

and MAGICALLY it will become uf2 capable

#

yes m0 is weird in that you can remove the bootloader prot fuses via userland

#

which is kinda odd but hey whatever, good for us

#

i just havent gotten to updating the testers

#

you can update bootloader whenever you like, its low risk

tulip sleet
timber mango
#

yep webUSB is the only big update

tulip sleet
#

use the "update-bootloader" files. You can use the .ino version, compile it and upload it via Arduino, or use the .bin with bossac.

timber mango
#

yah there is a risk, we've not seen it come up yet

#

(someone needing to jlink)

#

that is correct

idle owl
#

Hah! Good thing, because I didn't even think about the possibility of bricking anything.

timber mango
#

use bossac -> update_uf2.bin

#

make sure its the update_uf2.bin!

#

gotta go later!

idle owl
#

@timber mango Later! Thanks for stopping in!

timber lion
#

i have to run too to a 12pm

timber mango
#

we gots hive mind here

slender iron
opaque patrol
#

I gotta go, see ya later.

raven canopy
#

Later BD

slender iron
#

bye @opaque patrol !

prime flower
#

@idle owl if you need any arduino <-> circuitpython reference, the explorers guide for metro / explorers for circuitpython is intended for that purpose...also lmk if there are any arduino "helpers" which I might've missed (stuff that's been ported over is mostly in simpleio, like shift/servo/tone)

#

oh also - totally unrelated but I had to restore an iphone that bricked itself (with all my google authenticator codes on it) this weekend. remember to back up your phones/auth software as often as you back up your computer, and have other forms of recovery than just your phones

idle owl
#

@prime flower Will do. I'm going through the super intro Arduino guide first. I'm already to a point of basically being able to translate general functionality. I've literally never done anything with Arduino before last week, so it's getting familiar with Arduino first that I'm doing now.

raven canopy
#

How far from MPy do you want to get with 8266?

prime flower
#

nice! the explorers guides are loosely based off of those. I'm excited to see what you think of arduino, coming from circuitpython

#

(its kinda rare to see someone going that direction)

idle owl
#

Add to that the fact that I learned Python almost entirely through CircuitPython.

#

I'll let you know πŸ˜ƒ

raven canopy
#

To bridge that: esp32 waiting on MPy or roll our own?

timber mango
#

In Arduino IDE if you want to get into subdirectories for larger projects, name the first level below the project level 'src' so that all paths begin with './src'. #include <Arduino.h> in any .cpp file.

raven canopy
#

The question comes up alot about it, which is why I ask

idle owl
raven canopy
#

πŸ‘

idle owl
#

Thanks!

prime flower
#

πŸ‘‹

errant grail
#

Thanks!

indigo wedge
raven canopy
#

I have a topic, but next week is cool though. Later taters (and caters).

tidal kiln
#

πŸ‘‹

umbral dagger
#

bye

prime flower
#

bye

timber mango
#

is meeting still happeining?

#

weeds

#

ok l8r! just heard some tyypin πŸ˜ƒ

slender iron
#

@timber mango nah, we wrapped up

timber mango
#

ok thx

errant grail
#

Thanks everyone. Appreciate the answers and interactive discussion! Bye!

timber mango
#

(that was the results for 'aloha')

#

@slender iron for 3.0 did y'all discuss a beta checklist?

#

sorry i missed 😦

slender iron
#

we talked at a high level but opted to do it out of the meeting

indigo wedge
#

It's nice working having people in the background, too quiet now πŸ˜„

inner raft
#

@tidal kiln yes I still have the original main.py that shipped with the trinket saved off

timber mango
#

Yeah that's my routine for newly arrived targets -- get the goodies off them before exploring.

solar whale
#

Cool! feather_m0_adalogger now boots to FEATHERBOOT - woohoo! Thanks!

inner raft
timber mango
tidal kiln
#

@inner raft yep. that's returning a list alright. i think there might be different versions of wheel floating around. unfortunately. i just checked the current gemma version and it's a list also. we'll try and update these when we can.

#

@inner raft do you know how to convert that code to tuple? if not, can provide.

inner raft
#

oh yeah I'm an old hat at regular python πŸ˜ƒ

#

is there a way to get errors out of code when it runs on the Trinket? I'm spoiled by python stack traces in other environments.

opal elk
#

boot_out.txt I think

#

for errors with boot. otherwise check the serial connection.

timber mango
#

REPL

inner raft
#

is there a doc on getting REPL access to the trinket's interperter? I missed that somehwere...

timber mango
#

Yeah the tutorials have a 'chapter' on that.

inner raft
#

ah! so there is. thanks!

timber mango
#

Jump in there, skim -- a reasonable shortcut list is in the left column.

#

You can edit main.py on your host pc hard disk and then copy it to the mounted USB volume, and also have a serial session going to the REPL. There's some interaction between the two.

inner raft
#

Yeah this is pretty cool so far! I love being able to just save main.py and have it automatically start running on the trinket! Not that the Arduino way of doing thigs was hard, but this is certinaly slicker πŸ˜ƒ Nice job all.

timber mango
#

Type Control C whenever you don't understand and cannot seem to interact with REPL.

inner raft
#

neat!

timber mango
#

If you created mine.py you would type 'import mine' in the REPL. That would load it. You can design mine.py so that nothing happens when loaded. In that case you might type 'mine.startup()' to run a function.

inner raft
#

ah that's a cool idea

timber mango
#

eval() is a pretty amazing thing

sick creek
#

webUSB for blinka that would be cool

manic glacierBOT
indigo wedge
#

that was easier than i thought πŸ˜„

manic glacierBOT
manic glacierBOT
manic glacierBOT
stuck elbow
#

@slender iron Sorry for missing the meeting

#

@slender iron I have been thinking some more about the esp8266 and did some looking around, and I think I want to try to make a 32u4 that speaks MTP on one end, and ampy on the other.

idle owl
#

@stuck elbow No apologies needed.

river quest
#

hi hi @here say hi to blinka, she arrived today

stuck elbow
#

you look a little like an evil overlord with a pet πŸ˜ƒ

tidal kiln
#

hi blinka!

timber mango
#

Barney went on a diet

ruby lake
#

Falcor!

stuck elbow
#

wasn't Falcor more white?

ruby lake
#

well, yeah

stuck elbow
#

and, like, hairy?

manic glacierBOT
timber mango
#

That's like 3:5 scale

#

I'd like to see an 18-footer Mho ;)

idle owl
raven canopy
#

RE: evil overlord: "Dr. Adafruit and Misses Blinklesworth" star in "Mho's Resistance 2: Mystery on the Circuit Playground Express" (best I could do after a Monday at work)

timber mango
opaque patrol
timber mango
#

No, no .. the Makezine article lists that as the access point. It's a Well-Known <whatzit>

raven canopy
#

stable, and another one (1.x i think), were turned off b/c of out-dated information.

#

but, you make a very good point

#

@slender iron can we redirect on RTD pages? see @timber mango's comments above.

timber mango
#

Then you click on 'Our API docs' (which is a hyperlink) and you get .. bupkus.

stuck elbow
#

I guess the official python tutorial may be a good place to look at too.

raven canopy
#

we could probably also get Make to update the link...

#

"latest" should always be available...

timber mango
#

Without being toooo strident -- there's a whole rant about persistence of URLs and that sort of thing. Apple basically implemented that rant in the form of persistent identifiers on its HFS+ filesystem.

stuck elbow
#

well, we don't control readthedocs

timber mango
#

That's about as good an answer as there can be. "It's not ours to say".

stuck elbow
#

that url wasn't supposed to be published anyways

#

we have no "stable" docs

#

I'm not going to argue with you, of course, getting a 404 is a bad experience

tidal kiln
#

@timber mango yah, that makezine link appears to be not valid, are you just pointing that out, or are you wondering where to go?

timber mango
#

I'm thinking in terms of the beginner, but he said 'examples' so I was all abouit that.

#

A short list of major resources might go well in the sidebar of the Tutorials for the main products running CP.

tidal kiln
timber mango
#

I'm kind of Warf ONE BRIDGE when it comes to things (like books) having well-known-locations.

#

Just seems wrong to change locations by fiat.

#

"It was hard enough finding it once."

stuck elbow
#

and that won't be changing

timber mango
#

I think you get what I'm saying. ;)

stuck elbow
#

I do, but there is really nothing I can do about it personally

#

other than to point to the correct address

timber mango
#

You do enough already. ;)

#

I posted the initial message figuring someone would say "oh that's not supposed to happen" and it'd be fixed in 2 minutes.

#

Any other outcome was off the script. ;)

tidal kiln
#

unfortunately we don't have edit access to the host site

stuck elbow
#

sorry, we kind of use what tools are out there, they are not perfect

#

you know, computers

#

at least you can buy a good shovel

timber mango
#

Did you happen to see Showtime's /Twin Peaks/ reboot? Dr Jacoby and his shovels. ;)

stuck elbow
#

I did not, I was quoting Erasmus Smums

timber mango
#

It's a good quote.

stuck elbow
#

oh, nice, didn't know they can do that

slender iron
#

will set up the redirect now

#

thanks for the link @tulip sleet and the heads up @timber mango

#

doesn't work πŸ˜•

#

I'll email caleb and see if he can update it

ebon horizon
#

Is there a single place where CircuitPython examples exist? I feel like the only way I'm finding example code is "random" articles on the Learning pages.

slender iron
#

@ebon horizon let me find the repo

storm folio
#

In a quandary - we’re building a cool data logger for almost every sensor we can think of for a North Pole expedition. Best board seems to be PyBoard but CP doesn’t appear to run on it. We need to get a RFM69 working to transmit the data. Any suggestions?

slender iron
#

all the new guide code goes there

#

@storm folio it shouldn't be too hard to get the rfm69 drivers for circuitpython working on micropython

ebon horizon
#

@slender iron oh okay. I guess that qualifies as a list.

timber mango
#

Anyone have an idea as to how I could smooth out a capacitance read from touchio.TouchIn(board.A1).raw_value without losing too much resolution?

slender iron
#

thats the closest I can think of

#

@ebon horizon we've also added examples to each driver repo as well

storm folio
#

@slender iron I didn’t feel like porting the 720+ lines of code if I could avoid it. I already wrote some bridging classes (MyPin,MySPI) to start and that fooled most of it. I’ve found use of β€œmonotonic” time and the Micropython supports time differently (easy to fix). Unlike all the other drivers I already ported, this one is more difficult to debug.

stuck elbow
#

@storm folio I guess you will have to implement the rfm69 communication yourself, the cp library is very basic and probably not enough for your use case anyways

ebon horizon
#

@slender iron What I was really hoping for, and I feel like is needed, is a nice "examples" structure. How to digital IO, how to serial, etc. I'm finding the stuff, but it's all scattered about

slender iron
#

@storm folio sounds like you've got most of it working!

storm folio
#

@slender iron @stuck elbow I suppose I think I may just proxy through a Feather.

slender iron
#

@ebon horizon there are similar examples for other boards too (@idle owl and @timber mango plan on unifying them soon)

ebon horizon
#

@slender iron yeah, like. funny, i've been on that page a dozen times the past couple of days, never made it that far down

timber mango
#

The Metro M0 Express was my go-to for "I bet they already thought of this" hunting. It was the best documented of the new boards, around July-August 2017 timeframe, I beleived.

ebon horizon
#

maybe 6, but you get my point

slender iron
#

@ebon horizon we're still refining the docs πŸ˜ƒ

ebon horizon
#

@slender iron but thank you. that is the kind of list I had in mind

stuck elbow
#

@storm folio it's not like the datasheet for rfm69 is secret knowledge or that a simple communication would require years of study β€” and I'm guessing you want to have this thing robust

ebon horizon
#

πŸ˜ƒ

slender iron
#

great! I'm glad we have it somewhere πŸ˜ƒ

stuck elbow
#

@storm folio so adding extra parts just to run a library is probably not a good idea

#

one more thing that can break, etc.

timber mango
#

The main problem with the documentation is that it explains things in a way that someone with very little experience can follow (and succeed with). This creates a 'oh no .. please .. oh no' problem for the person with a large working vocabulary who just needs to find it quickly.

slender iron
#

@timber mango caleb updated the link for me

idle owl
#

Is time.monotonic() in milliseconds?

slender iron
#

thanks for the heads up @timber mango !

#

@idle owl seconds

idle owl
#

ok thanks

stuck elbow
#

@timber mango I think that we have both reference docs (for experienced people who just need to know what is there) and tutorials etc. (for less experienced people)

#

I suppose we don't have much in the middle

ebon horizon
#

there's sort of a in between that's missing. not to draw parallels, but kind of like the arduino reference documentation

#

don't get me wrong, you can find what you need. it's just a bit of work

stuck elbow
#

as always, but it would be nice to make it less work

slender iron
stuck elbow
#

in the worst case you can look at the source code and the schematics πŸ˜ƒ

timber mango
#

Oh I'd rather have the 'oh no' stuff than not have it. It's just I have to develop my own relationship to it (which I have). Mozilla helps a lot because it supports a simple /search kind of interaction with the current web page.

ebon horizon
#

since we're on the topic of documentation. πŸ˜ƒ how do I send characters over serial (from terminal to circuitpython)

timber mango
#

@ d I use the schematics all the time. Never found a real discrepancy, either. ;)

slender iron
#

@ebon horizon pyserial on your computer and input in circuitpython

#

that would be something good to have a guide on. you aren't the first person to ask about it

stuck elbow
#

I think you can also simply echo stuff to /dev/ttyACM0

ebon horizon
#

okay

#

I should have tried that

slender iron
#

@idle owl if @quick oyster wants to chat tonight I am free for the next hour or two

ebon horizon
#

sorry to have to ask, so what about non-blocking?

slender iron
#

we don't have a way currently. I believe @timber mango looked into it and python doesn't have a non-blocking way itself

#

what are you trying to do?

ebon horizon
#

send single characters over serial to control the program

#

like +, - to increment variables

slender iron
#

@ebon horizon is trying over usb I believe @timber mango

#

@ebon horizon I don't think we have a good solution now

ebon horizon
#

@timber mango that only works if I'm connected to a usb to serial adapter

#

which, okay, maybe that's what I do for now

stuck elbow
#

in normal python you would first set the terminal into a non-blocking or half-blocking mode

#

or use a library that does it for you, like the curses

#

alternatively, you could do a select on the sys.stdin

#

but no select in cp

ebon horizon
#

yup

manic glacierBOT
slender iron
#

knowing how its done in python is super helpful. do we have an issue for it already?

#

(if not, we should)

stuck elbow
#

I think it's not so simple, because neither spi nor i2c devices are input streams that you could select on

stuck elbow
#

or any other i/o we have

slender iron
#

right

stuck elbow
#

the repl might actually be the simple case

#

I mean the usb serial, with sys.stdin

timber mango
#

Yeah I get confused and forget myself. I designed it for the TX/RX pair and the UART, then wonder why there's no traffic on the USB port. ;)

#

The CP2104 comes up as /dev/ttyUSB0 in Linux. It has a TX/RX pair to talk to the microcontroller directly on its TX/RX pair.

storm folio
#

@stuck elbow @slender iron Thanks, but we’re receiving rfm69 on a feather already, one more feather allows us to move forward tonight on other things. I’ll finish porting the Adafruit library when I get a break.

slender iron
#

keep us posted @storm folio . I hope its reliable enough for you. CircuitPython is very young still

manic glacierBOT
ebon horizon
#

thanks guys. got my matrix ... matrixing

timber mango
#

(toMATo)

ebon horizon
#

my proof of concept was to build a LED matrix and then write the CP code. Turns out, I would have had it working in a single day, if my NPN and PNP trays didn't get mixed up

#

(the serial stuff I was asking about was to debug the behavoir.)

manic glacierBOT
#

@wolf adding this would be awesome! I don't know much about asyncio myself so it'd be great to chat about what is needed for it. I know micropython has uasyncio but haven't looked at it myself. I'd want us to match the way CPython works even if MicroPython doesn't.

When are you available to chat or what guidance can I help with? I'm on Discord during the days Pacific time and can hop on other times if I know ahead of time. Thanks!

slender iron
#

glad you got it working @ebon horizon

ebon horizon
#

I'd share it, but it's for my post this week. I don't know want my new secret crush to see it before the 14th. πŸ˜‰

slender iron
#

πŸ˜ƒ post it then!

timber lion
#

very nice looking web-based sprite editor

raven canopy
#

RX/TX on boards that have it run through the UART, IIRC. Although, you still get the USB data if it's hooked....i think that's what I read.

timber lion
#

pretty much all ready to go πŸ˜ƒ

idle owl
#

@slender iron @quick oyster doesn't do late nights during the week, he's got early mornings. I can't say for sure but afternoons will probably work best.

slender iron
#

that was @opaque patrol I think @timber lion

#

k, I'm flexible @idle owl just gotta plan ahead

idle owl
#

@slender iron Yep that was the plan πŸ˜ƒ

slender iron
#

yay stackoverflow

idle owl
#

@slender iron I saw that one! I didn't click, but read the preview in search.

#

I understand these better than I realised. That's excellent.

opaque patrol
#

@timber lion That looks nice, I will have to check it out

manic glacierBOT
slender iron
timber mango
#

@raven canopy in Arduino IDE it's as simple as Serial.print() vs Serial1.print() to redirect to one or the other. The default is the external interface used to program the device (TX/RX can't be easily coerced to serve in that role afaik). The SAMD21G18A has some kind of internal USB interface -- that's the one using Serial.print().

manic glacierBOT
slender iron
manic glacierBOT
ebon horizon
#

@slender iron good background, thanks

slender iron
#

you're welcome!

manic glacierBOT
#

Telling me that we want to match CPython over MicroPython is exactly the kind of guidance I'm looking for. I'll have to figure out the details; I'm starting from scratch here. Anything you can tell me about goals, constraints and dreams will be a help. I am Eastern time, so my 4pm (about when I arrive home from work everyday) might be convenient for both of us. Once we pick a time, just about any day works for me. Work for you? (and @dhalbert and @kattni)

idle owl
#

@slender iron For building CP, where did I get the arm-gcc for mac?

slender iron
#

I think brew install gcc-arm-embedded

#

you may need to add a source

#

or brew cask install gcc-arm-embedded

manic glacierBOT
slender iron
manic glacierBOT
idle owl
#

@tulip sleet Do we still need to build mpy-cross before we can make circuitpython?

tulip sleet
#

@idle owl only for frozen modules (i.e., CPX, right now)

idle owl
#

Ok, so if we are building for the CPX, then we need mpy-cross?

tulip sleet
#

yes

#

it used to build automatically, then we turned that off, but it probably should build automatically in a smarter way.

idle owl
#

Realising I haven't done this in a while or setup this new machine to build CP.

tulip sleet
#

new Mac or the Linux box

idle owl
#

Go into the mpy-cross directory and do a make something..?

#

Mac

tulip sleet
#

yeah jus make in that dir

idle owl
#

Ok

tulip sleet
#

you could make clean;make

fierce oar
#

update on my earlier issue, it's somehow magically working now kinda πŸ˜ƒ yay!

timber mango
#

anyone have an experience with smoothing out touchio.touchin().raw_value? it is pretty jumpy and it'd be nice to have it as a more stable proximity sensing value

idle owl
#

@fierce oar Yay!

fierce oar
#

colors are funny on my neopixels though, all white and not rainbow cycling like they're supposed to. but they're lighting up now!

idle owl
#

Hmm. Did you ever post your code or the context? Did you want help or are you still troubleshooting on it yourself πŸ˜ƒ

fierce oar
#

id love some help if you're not too busy

#

i posted the context briefly this morning but can re-summarize

idle owl
#

I'm helping another friend too, but that won't be long. Yah, please resummarise!

manic glacierBOT
idle owl
#

@tulip sleet Sorry, one more thing: is it /atmel-samd/ or /ports/atmel-samd/?

tulip sleet
#

atmel-samd on 2.x, ports/atmel-samd on master (3.x)

idle owl
#

ahh ok

tulip sleet
#

MicroPython reorganized the tree and put all the ports under ports/

timber mango
#

I haven't done a build in months. ;)

idle owl
#

It hasn't been that long for me, but long enough apparently. It was all in my history before

#

make BOARD=circuit_playground_express doesn't work

timber mango
#

seems to me there was a directory where if you did an 'ls -1' in it the names of the directories matched the necessary targets for BOARD there.

fierce oar
#

I had the Circuit Python NeoPixel demo code running on a trinket m0 with a short strand of neopixels attached, and it was working fine. then I swapped the board to a gemma m0 and couldn't get the neopixels to light

idle owl
#

@tulip sleet what am I missing... it's something obvious.

timber mango
#

Trinket you pick your own pin; on Gemma I'm not sure what pin is used.

tidal kiln
#

@idle owl for mpy-cross?

idle owl
#

@fierce oar using the demo code from trinket and gemma? or from a separate neopixel example?

#

@tidal kiln no, for building CP for a CPX

fierce oar
#

i tried a bunch of things last night, including removing and restoring files, and today they're lighting but the colors are wrong

raven canopy
#

BOARD=circuitplayground_express

idle owl
#

@raven canopy oi thank you!

#

@fierce oar is your strip RGBW?

timber mango
#

that underscores my observation /andon

fierce oar
#

one sec i'll grab some links

raven canopy
#

all good. i usually ls boards when in the ports/atmel-samd after not building for a while.

idle owl
#

@raven canopy FREEZE ../../frozen/Adafruit_CircuitPython_BusDevice ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_NeoPixel ../../frozen/Adafruit_CircuitPython_Thermistor Traceback (most recent call last): File "../../tools/preprocess_frozen_modules.py", line 6, in <module> import semver ModuleNotFoundError: No module named 'semver' make: *** [build-circuitplayground_express/frozen_mpy] Error 1
Thoughts?

fierce oar
#

Everything you always wanted to know about Adafruit NeoPixels but were afraid to ask

tulip sleet
#

@idle owl git submodule update --init --recursive

raven canopy
#

yep...that's what i was thinking

idle owl
#

This is all coming back to me now

fierce oar
#

omigosh sorry lol

#

how do you post a chunk of code

timber mango
#

three backticks top and bottom on a line by themselves

idle owl
#

@fierce oar Three backticks on either side, the one on the upper left of the keyboard by the tilde ~

#

@fierce oar You soldered up your own strip from single pixels?

fierce oar
#
# CircuitPython demo - NeoPixel

import board
import neopixel
import time

pixpin = board.D1
numpix = 10

strip = neopixel.NeoPixel(pixpin, numpix, brightness=0.3, auto_write=False)


def wheel(pos):
    # Input a value 0 to 255 to get a color value.
    # The colours are a transition r - g - b - back to r.
    if (pos < 0) or (pos > 255):
        return (0, 0, 0)
    if (pos < 85):
        return (int(pos * 3), int(255 - (pos*3)), 0)
    elif (pos < 170):
        pos -= 85
        return (int(255 - pos*3), 0, int(pos*3))
    else:
        pos -= 170
        return (0, int(pos*3), int(255 - pos*3))

def rainbow_cycle(wait):
    for j in range(255):
        for i in range(len(strip)):
            idx = int ((i * 256 / len(strip)) + j)
            strip[i] = wheel(idx & 255)
        strip.write()
        time.sleep(wait)

while True:
    strip.fill((255, 0, 0))
    strip.write()
    time.sleep(1)

    strip.fill((0, 255, 0))
    strip.write()
    time.sleep(1)

    strip.fill((0, 0, 255))
    strip.write()
    time.sleep(1)

    rainbow_cycle(0.001)    # rainbowcycle with 1ms delay per step
#

oh hey i did it

#

yes

idle owl
#

Nice!

#

OK

timber mango
#

Put in 'python' on the same line as the top backticks for syntax highlighting

idle owl
#

First off, it's strip.show() now.

#

I don't know if that will fix the issue you're reporting though.

tulip sleet
#

if there are two different versions of CPy on the two boards that might explain it.

fierce oar
#

yes i soldered the nano neopixels to wire by hand in series

#

oh yes that's one of my questions! how does one know which version of cp is on one's board?

idle owl
#

Can you connect to the REPL?

fierce oar
#

i couldnt figure it out last night, and i saw that there are specific downloads based on your version

idle owl
#

Are you on Windows/Mac/Linux?

fierce oar
#

mac

timber mango
#

auto_write=False

idle owl
#

@fierce oar Or if you're using Mu editor, you can do it through the editor

storm folio
#

@slender iron any thought of a CP build for the PyBoard?

raven canopy
#

@timber mango since, .show()/.write() is being called, auto_write being off won't make a diff.

tulip sleet
#

@storm folio it's a different manufacturer's chip, so would be a lot of porting. And it's not our board

tidal kiln
#

@fierce oar
when you connect to REPL you'll get a banner with verison:

Adafruit CircuitPython 2.2.3 on 2018-02-05; Adafruit CircuitPlayground Express with samd21g18
>>> 

or, just look in boot_out.txt, might have same info

storm folio
#

How about making a board with similar (Or better) specs?

timber mango
#

@tidal kiln was that a REPL syntax tag or what? sweet.

fierce oar
#

oh the boot_out.txt has it now (last night it was empty, but i reinstalled files at some point)
Adafruit CircuitPython 2.2.3 on 2018-02-06; Adafruit Gemma M0 with samd21e18

tidal kiln
#

@timber mango no, just the backticks trick, but with syntax hilighting

tulip sleet
#

@storm folio we're working on M4 boards: SAMD51x

fierce oar
#

apologies for my noobishness, i don't really speak computer

idle owl
#

@fierce oar Ok that's the most recent. So you'd want the library from the 2.x bundle

#

@fierce oar No apologies needed!

#

@fierce oar You can also do inline code by putting a single backtick on either side of the line you want to look like code

storm folio
#

@tulip sleet M4 would be awesome. For now I’m stuck between PyBoard and M4 and CP (and not M4). I could switch to other controllers, but the number of io/ports are super helpful for our project.

tulip sleet
#

@storm folio We have M4 dev boards and are actively working on that for CPy 3.0. But we don't do estimated dates - sorry! - it will be ready when it's ready.

fierce oar
#

ok i installed mu and now i can see the repl

idle owl
#

@fierce oar The code is working for me on a CPX (with the right pin identified). Hmm.

#

(That was the closest thing I had with neopixels on it)

#

Changing write to show, while correct, didn't make a difference in the function of it.

fierce oar
#

yep my pin is right, and it's connecting fine (i can see it updating when i make changes and save) but the colors are just funky - is there somewhere to identify what kind of color profile is being used? like in the arduino code?

storm folio
#

@tulip sleet no problem! Python (and the Adafruit CP libraries) have made most things super easy. Much easier than we thought it would be. I’ve ported a few classes, but it wasn’t much work. It is sad that MP and CP aren’t somehow closer (so we would have to do almost no work) but we get it.
For this project we can’t wait for the new hardware, but we’ll use it when it comes out in the future. Thanks!

raven canopy
#

@fierce oar are you sure you have the PID 2427 neopixels that you linked earlier?

fierce oar
#

@raven canopy yup

raven canopy
#

okie dokie. just wanted to make sure they weren't a GRB version.

fierce oar
#

yes that was my thought too

idle owl
#

@fierce oar My first thought was that they were RGBW which messes things up like your'e saying, but that's not it

fierce oar
#

weirdly they display the right colors with the same code on my trinket m0 though

timber mango
#

Use another port pin.

idle owl
#

Did you try reflashing CircuitPython onto the Gemma?

fierce oar
#

@idle owl yes

idle owl
#

Ok.

fierce oar
#

@timber mango have not tried that, will do, one min

tidal kiln
#

@fierce oar since you're working with bare neopixel, are you sure it's not a hardware issue

fierce oar
#

@tidal kiln pretty sure, it works perfectly on the trinket m0, but there could be something hardware related i don't understand

#

be right back

manic glacierBOT
tidal kiln
#

if you're getting them to work on the trinket, then probably not. have you gone back and tested on the trinket?

fierce oar
#

@tidal kiln yes, just checked it again, still works correctly on the trinket (colors are right and cycle through the rainbow)

#

changed to pin D2, neopixels are all white, no cycling (on pin D1 it was mostly white but i could still see it cycling through incorrect colors

#

trying others

idle owl
#

Try powering it off of the Trinket but using the gemma for data

fierce oar
#

ok, one sec, need another cable

timber mango
#

I would target the first pixel in the strand and ignore all the other pixels. If that one cannot be made to respond correctly, target the next one in line. It would also be simpler to have a second pixel just for the device under test. Test that one once on the known system (to gain confidence) then transfer it to the unknown system.

fierce oar
#

ooh that worked @idle owl

idle owl
#

@fierce oar Ok it's a power issue with the Gemma then

fierce oar
#

neopixels are doing what theyre supposed to

timber mango
#

score!

idle owl
#

@fierce oar Were you powering it from the vout or 3vo on Gemma?

fierce oar
#

ahhh yes i definitely was powering it on vout instead of 3vo

idle owl
#

Same on Trinket or no? USB or 3vo on Trinket?

fierce oar
#

no 3v on trinket

idle owl
#

Ok try 3vo on Gemma

fierce oar
#

yep it's working

idle owl
#

Excellent!

fierce oar
#

omg i feel so silly

#

thanks for all that help yall πŸ˜ƒ

timber mango
#

You will do the same for others. ;)

idle owl
#

@fierce oar I would have thought it would work on both, so don't feel silly.

fierce oar
#

but! all the other issues really threw me, and by the time i got to the unknown power issue i was already very confused πŸ˜ƒ

timber mango
#

I wasn't even going there. I was going for cold solder joints and damage to the array from transferring it from one controller to another.

fierce oar
#

little things like not being able to save my .py files directly made me think something else was going on

idle owl
#

@fierce oar Tons of variables

fierce oar
#

but i just need to get more familiar with using circuit python

#

i'm very used to the arduino ide guiding me along

timber mango
#

and 3vo ;)

raven canopy
#

those must be sennnnssssiitive. i've never had a problem pushing npix at 5v with a 3.3v signal.

#

well, not that few npix...

fierce oar
#

these are the second tiniest things ive ever soldered πŸ˜ƒ i guess they're pretty finicky

timber mango
#

Signalling at 5v with 3.3 vcc would be far worse.

fierce oar
#

but they look so cool!

idle owl
#

@fierce oar That's awesome!

raven canopy
#

those little suckers are in the no. mustn't drink coffee until AFTER i solder these category.

fierce oar
#

@raven canopy yep! they're easy to lose, but hard to forget!

timber mango
#

Let's just be glad that Elvis never had access to them. ;)

fierce oar
idle owl
#

@fierce oar So cool!

fierce oar
#

thanks for helping me troubleshoot that, t's so helpful to have brains that are farther away from your project than your own πŸ˜ƒ hugs to all!

raven canopy
#

very chic!

idle owl
#

@fierce oar I'm glad we got it sorted!

tidal kiln
#

Yay! Nicely done @idle owl

idle owl
#

@tidal kiln Thanks! πŸ˜ƒ

tidal kiln
#

@fierce oar are those to go along with those blinky eye lashes?

fierce oar
#

@tidal kiln tee hee... no i don't actually have those eyelashes (they belong to my friend), and i don't think i could stick those on my eyelids πŸ˜ƒ but these are actually less practical than those! mostly for photoshoots, a short costumed/cosplay event

raven canopy
#

they'd make for great flashlights...or fantastical "go yonder" pointers. πŸ˜„

#

npix, white, and full brightness is just shy of sunlight on the equator...

manic glacierBOT
#

In code I find consistency a good thing. If everything is lowercased there is no need to remember whether one should use capital letters or not. For example lux might be confusing. Is it acronym or word? Should it be sensor.lux or sensor.LUX? Also when seeing sensor.TVOC one is not really sure if it is a constant or property.

I do not have strong feelings about this, but my choice would be lowercased acronyms sensor.tvoc and sensor.eco2.

idle owl
#

RGBW at full brightness gets even closer.

raven canopy
#

i remember the first time i turned a set on. of course i stared directly at them while hitting upload. 🌞

#

from that point on, setBrightness(25) was part of every new sketch.

fierce oar
#

dimming them definitely helps with photography too

#

wow i'm much happier using mu, even for the small changes i make to the code

idle owl
#

Good!

raven canopy
#

i still haven't broken away from PuTTY and IDLE...keep saying i'm going to, but then I get working on something and, well..yeah. πŸ˜„

#

when did it become 11PM? holy moley. well, new new Trellis LEDs are working again. might as well stop there.

timber mango
#

πŸ’€

manic glacierBOT
slender iron
#

@fierce oar I have a spare itsybitsy if you want to use it

fierce oar
#

@slender iron ooh too kind! i'll have to think of an excuse to use it in my next project! πŸ˜ƒ

#

piiiiiins for days!

slender iron
#

πŸ˜„

#

it also has a pin with a level shifter for neopixels at 5v

manic glacierBOT
manic glacierBOT
timber lion
#

turns out there are almost 22k characters in traditional and simplified alphabets.. at 12x12 fonts that's 300kb alone of font data to try storing on the 256kb flash πŸ˜ƒ

#

"we're going to need a bigger boat"

#

luckily there are subsets of 'only' 7k or maybe up to 13k that are the most common

timber mango
#

Can just store them on the 2mb flash no?

timber lion
#

unfortunately no extra space on the nrf51 that the microbit/sinobit use πŸ˜ƒ

timber mango
#

Yea true, wish Adafruit would carry spi flash chips again and give us a 4mb option on the M0, its why I can't wait for Esp32 to have micropython.

#

Its a power hog a bit though I'll have to dig into how it is with the radio off might still not much of a battery powered sensor though. Adafruit Needs some low power stuffs.

steel copper
#

Add a microSD card reader? It will steal some pins from the 2x13 but for good purpose.

stuck elbow
#

samd21 is pretty low power, I would think?

timber mango
#

Low power as in microamp and nanoamp range. They are good chips but not low power, good for 99% of uses though I'll agree.

#

Just such a struggle to get performance and low power if only we could bridge the gap between a moteino and a feather M0. I'm sure could desolder a lot of stuff and thow on a better regulator, but is a niche area so I can see why its not on the top of the list.

#

I"m late to the game but the fram msp430 type stuff comes to mind, I'm surprized something was never arranged with Adafruit seeing their relationship with Ti

#

Competition is great but there are so many great chips that sometimes it seems competition and ease of use really hamper moving superior tech forward.

#

It don't help that our addtion to ease of use, coupled with the face pace of new chip releases helps keep us under the cutting edge. Esp8266 is a great example when 32 has been out so long and far superior hardware wise.

#

I'm so used to spell check messing up everything I say that I now do it myself. almost 2am that my cue for bed.

stuck elbow
#

you won't get circuitpython running on any microamp-range chip

#

but there are some AVR-based boards out there

jovial wind
#

@timber mango I've run MicroPython on the esp32...

manic glacierBOT
#

BTW, if you put any new test code and examples together, feel free to include them in either the ports/nrf/examples folder or a board level examples folder if it's board specific.

I'm convinced a lot of people look directly at the code repo and examples that ship with it as their first point of contact, so having up to date examples there makes sense to me, and being in the repo generally increases the chance of them being up to date with the latest API changes, especially with things ...

timber mango
crystal pumice
#

hey, so im playing a lil bit with the feather dotStar and the feather M0 express. im following the tutorial. uploaded the animation example of the xmas tree and snow. it gave me the following: File "code.py", line 2, in <module>
MemoryError: memory allocation failed, allocating 128 bytes

#

ive got only two libs in the lib folder

#

what am i missing?

solar whale
#

@crystal pumice The memory allocation is due to lack of RAM and not related to the amount of files stored on the device. You can try just rebooting and trying again. Sometimes after a clean boot more memory is avaialble. If that does not work, check that all library files on your system are .mpy files. It takes more memory to load a .py file. Only your code.py files or other files you created shouled be .py files.

crystal pumice
#

ah okay ive got dotstar_featherwing.py in the lib

#

and adafruit_dotstar.mpy

solar whale
#

where did you get doststar_featherwing.py ?

crystal pumice
#

downloaded from one of the links in one of the guides

#

but i see the example code got: import doststar_featherwing

#

so is there an mpy version?

solar whale
#

looking...

#

hmm not seeing one but you can create one if you want to see if that helps. What OS is your computer?

rotund basin
#

Hey all, got my new feather adalogger πŸ˜ƒ , but bossa can't find the device?? πŸ€” , I'm on Ubuntu

solar whale
#

@rotund basin - should be /dev/ttyACM0 is that what you tried?

rotund basin
#

Did without the dev

#

Will try in a min

solar whale
#

that should work.

rotund basin
#

Without the/dev it says no device found

solar whale
#

I ran into taht yesterday because I hsd not plugged in my USB cable πŸ˜‰ just checking...

rotund basin
#

It shows up on ls /dev/ttyACm*

solar whale
#

wht command are you using - I have used bossac -e -w -v -R -p ttyACM0 image.bin

rotund basin
solar whale
#

hmmm - other thatn the obviosu things like verify that it is a data capable cable, Im at a loss. - check dmesg out but after you plug it in - it should be recognized as ttyACM0 -- with capital M

#

just at thought- I never have used the -i try without that

crystal pumice
#

@solar whale ive got win10

solar whale
#

@crystal pumice if you look at https://github.com/adafruit/circuitpython/releases and scroll down to the 2.2.0 release, you will see version of mpy-cross for various systems Download the windows version then run mpy-cross dotstar_featherwing.py in the directory where you have the files. this will create dotstar_featherwing.mpy - delete the .py file from your featehr and copy the .mpy version to the lib folder.

#

@rotund basin FYI - I just used bossac on my adalooger yesterday so I know it can be done.... it does not look like your system is seeing the USB device

rotund basin
#

Ubuntu does recognize it

#

Dmesg is good

#

It's unknown, but still lists as acm0

solar whale
#

lower case?

crystal pumice
#

@solar whale when i run the exe its opens a CMD window and then it shuts down instantly. is there another way to compress py to mpy?

solar whale
#

@crystal pumice hmm - I don't have a windows system so I have not seen that. Hopefully someone else online can help there? - give me a minute and I'll create an .mpy version

crystal pumice
#

10q king!

solar whale
#

just replace dotstar_featherwing.py with it.

ruby lake
#

hm, I might be able to write a patch manager in cp

solar whale
#

@rotund basin FYI - here is my syslog from when I plugged in the adallogger ```Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.585166] usb 3-3.4: new full-speed USB device number 28 using xhci_hcd
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.706447] usb 3-3.4: New USB device found, idVendor=239a, idProduct=8015
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.706451] usb 3-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.706454] usb 3-3.4: Product: Feather M0 Adalogger
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.706456] usb 3-3.4: Manufacturer: Adafruit Industries
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.707307] cdc_acm 3-3.4:1.0: ttyACM0: USB ACM device
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.708411] usb-storage 3-3.4:1.2: USB Mass Storage device detected
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.708601] scsi host7: usb-storage 3-3.4:1.2
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.710397] input: Adafruit Industries Feather M0 Adalogger as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.3/0003:239A:8015.0007/input/input16
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.769503] hid-generic 0003:239A:8015.0007: input,hidraw4: USB HID v1.11 Mouse [Adafruit Industries Feather M0 Adalogger] on usb-0000:00:14.0-3.4/input3
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.770910] input: Adafruit Industries Feather M0 Adalogger as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4/3-3.4:1.4/0003:239A:8015.0008/input/input17
Feb 12 15:32:09 Ubuntu-Macmini kernel: [78667.830088] hid-generic 0003:239A:8015.0008: input,hidraw5: USB HID v1.11 Keyboard [Adafruit Industries Feather M0 Adalogger] on usb-0000:00:14.0-3.4/input4

#

note it was seen as ttyACM0 - upper case ACM.

rotund basin
#

Yes of course , I'm typing on my phone and it auto correct

#

Is that in bootloader mode ?

solar whale
#

ah - yes - I did the "double" tap to enter bootloade mode.

rotund basin
#

My device doesn't come up as adafruit in bootloader

solar whale
#

did oyu enter bootlader mode before running bossac?

rotund basin
#

Yes

solar whale
#

hmmm -- just to verify connection - can you try using Arduino to load "blinky"

rotund basin
#

I
I despise arduino

#

The host windows computer doesn't recognize it ether πŸ€”

#

It's unknown device

#

On com5

solar whale
#

I'm stumped - hopefully someone else with more suggewtions will be on soon....

tulip sleet
#

@rotund basin Let's make sure it's an Adalogger M0 and not 32u4, right? When you double-click the reset button, what happens to the red LED?

#

also is it windows7 or 10?

#

also make sure you're using a USB cable that's not charge-only. If new verify it passes data with something else (like a phone or another adafruit board)

solar whale
#

@tulip sleet I noticed that the last few CP releases have not include the mpy-cross builds - Is that intentional? Also should the "windows" version run on Windows 10? a user this morning had some problems with it.

tulip sleet
#

@solar whale - not intentional - I have to copy them by hand. The old versions should work fine. I have run the Windows version on Windows 10: I think I created it on Windows 10. Who's the user?

solar whale
#

@crystal pumice tried it and had some probllem - scroll back to to 941 AM.

tulip sleet
#

they're running it by double-clicking. You have to run it on the command line.

#

it doesn't have a GUI

solar whale
#

Ah - good to know.

tulip sleet
#

@crystal pumice you have to run mpy-cross.exe on the command line: it doesn't have a GUI. Just do mpy-cross.exe nameofyourpythonfile.py

rotund basin
#

@tulip sleet it has the SD card lol .. when I go to bootloader mode it goes from red and green blinks to red solid

solar whale
#

@rotund basin there are two versions of the adalogger M0 and 32U4 it should be lablel on the silkscreen.

rotund basin
#

Not at it now, but my invoice days m0

#

Says

manic glacierBOT
#

Because it will add another board to the repo that will need to be updated as well, and will create a conflict. I can merge this one in as well and the conflict will be in the BL PR, it just needs to be handled in one of them but I've had my head down in code all day and haven't had a chance to try this one out so I was going to submit the BL PR for review, and then find a solution to keep both of these happy.

If you want to get this in right away, I'll test it later tonight and manage the...

timber mango
#

Heya folks! some exciting news today ~ Particle has some new boards out and they're Feather compatible!

#

but most exciting, the y have an nRF52840 processor on board. THE SAME CHIP WE'LL BE SUPPORTING IN CIRCUITPYTHON!

#

w0w πŸ˜ƒ