#circuitpython-dev
1 messages · Page 183 of 1
@craggy nacelle it is based in Python 3
thanks
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...
@craggy nacelle 3.4, specifically, but it's not complete 3.4.
Okay, Thanks @tulip sleet
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'"
@abstract pawn how did you install the bundle?
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.
@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?
yep. it needs to be called lib.
but is that the right folder?
what did you download that had something called libraries in it?
Adafruit_CircuitPython_Bundle-master.zip
ah. wrong zip. go here instead:
https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases
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"
that's the one you want
Argh! It won't let me put it on CIRCUITPY.
I will try and move its contents into the existing lib
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...
were you following this?
https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries
@tidal kiln if you have any time once you get Gordie up and running, do you think you could help with my text issue?
@thorny bear i'm not sure what the state of support for that is in circuitpython....let me check....
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.
@tidal kiln DOH! Somehow I got onto the CircuitPlayground Express page.
@abstract pawn can you link to what page? if there's a stale link, we should fix it.
but it looks like the CPX guide just mirrors that same page:
https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-libraries
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.
if you find it again, post it here, we'll take a look
I think I downloaded this one instead of 3.x :
adafruit-circuitpython-bundle-py-20180714.zip
Nope. Again. This is what I downloaded:
https://codeload.github.com/adafruit/Adafruit_CircuitPython_Bundle/zip/master
Not sure how I got there.
@thorny bear how were you drawing text?
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))
how did you get bitmapfont to load?
ah! so there's some kinda error like u....something won't load?
is that what you hit?
ustruct...
yep. i think maybe this stuff hasn't been updated for CP yet.
ah. so you edited the .py file in the library and changed it to use struct?
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
cool that even worked. but i think you're just working in an area that's in need of some work.
fair enough... in lieu of that - do you know how to create a different font file?
i don't. sorry.
:/
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 I'm listening... how should I do that?
ah.... @stuck elbow is here. excellent. he can answer this way better than i can.
@thorny bear it happens here: https://github.com/adafruit/micropython-adafruit-bitmap-font/blob/master/bitmapfont.py#L48-L56
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
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
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.
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
So I recently found that the original trinket could hold/play a small amount of audio. (Source: https://learn.adafruit.com/trinket-audio-player/overview) Can we do something similar with the trinket m0?
you probably also need to amend the width and height though
Ok... and you're saying to do that in bitmapfont yes?
@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.
@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)
@stuck elbow - Hey, thanks! I appreciate the input! That'll get me started!
you modify what gets included by editing thempconfigport.h file in your port directory
@solar whale thank you. I might hit you up for more info later.
Thats fine -- glad to help.
@stuck elbow Curious as to why you suggest to multiply by 2 AND have the plus one...
@thorny bear you need to multiply by 2 to make room for the extra 3 pixels
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)
?
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
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)
you can triple and quadruple in a similar way
probably use a loop, not copy the pixel calls
was going to ask if there's a .75 option.
that would be tricky
also the result would be blurry
right
you can use a smaller font and double it
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
of course those .bin files have been generated somehow
yeah. that seems like a much cleaner way to do it... any idea how though?
let me quickly try something
my google searches for creating .bin files went straight to cd-burning land... ok great...
@thorny bear can you try this file?
hit me
cool I'll find where to load it and let you know what happens shortly...
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,))
@opaque thicket you can but only really in arduino, not enough space on trinket m0 for wave and cpy audio
from those fonts: http://p.yusukekamiyamane.com/fonts/
Las fuentes de píxeles libres de regalías. Estas fuentes pueden ser usadas libremente para proyectos personales o comerciales.
@meager fog - thanks! I'm just looking to randomize some audio clips in a staples "easy" button
however, looking at the code of bitmapfont, it only works with fonts that are 8 pixels high
@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?
@opaque thicket yeah an itsym0 expres would be super easy BUT you can do it in arduino
it just kinda sux
it requires pygame
ok
@meager fog - yes please!
@meager fog - Thanks so much!
Fixes #1027.
>>> import analogio
>>> analogio.AnalogIn.value # this used to hang or (in 2.x) return an integer
<property>
>>> import board
>>> a0 = analogio.AnalogIn(board.A0)
>>> a0.value
27200
I should probably submit this upstream as well.
@meager fog I have audioio working with cp on the trinket m0 — I just had to remove some other module to make space
i tossed some convert.py thing that may do the job
@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
@meager fog you can mount an sd card :)
@stuck elbow runtime error: buffer too small...
I need to make it bigger than 8 pixels I take it
@thorny bear I guess I guessed the format wrong
@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).
ah.. ok
d/ling
buffer too small
I think we're hamstrung by the max 8px height, @stuck elbow
that font is 8 pixel high
oh
File "code.py", line 20, in <module>
File "bitmapfont.py", line 74, in text
File "bitmapfont.py", line 57, in draw_char
can you paste the complete traceback?
😄
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
can you paste the complete text of the error you are getting?
use ``` to make it formatted
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
that's enough, thanks
ah ok
hmm, line 57 is empty in https://github.com/adafruit/micropython-adafruit-bitmap-font/blob/master/bitmapfont.py#L57
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...
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
yeah, the file is all zeros
you know what, it's 5am here, I shouldn't be writing any code
lol
I'm going to bed, I will fix it tomorrow
rgr that. thank you very much for trying!
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...
excuse me, I want to ask, it means what kind and example how use it?
Good morning, what is the highest Brightness setting we can set in CP for the smart neopixels? Not floras..
@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
Thanks @tulip sleet
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 ...
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!
thanks @tulip sleet for your respon , but can you give the example of the writer? because I feel confused.
@stuck elbow Well it's making output of some sort... but that doesn't look like "hello world". 😃
@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.
@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 😉
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
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
>>> 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.
works on an M4 ```Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M4 Express with samd51j19
2**32
4294967296
.. 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
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
@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?
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...
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.
Ed Nisley's blog has some good thoughts on frequency arithmetic.
@lunar crown# have you seen the time API under http://circuitpython.readthedocs.io/en/latest/shared-bindings/index.html#modules
@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.
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 -
- 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.
- Reflash the board. UF2 is really awesome.
- Go to https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases , select the correctly file, down...
@thorny bear I give up
Some useful time information, but no timers.
@lunar crown CircuitPython doesn't support user timers
@lunar crown what are you trying to do? Maybe there is another way.
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.
@lunar crown we will have to wait for someone with more experience to chime in
time to make a couple of Crow's featherwings
PR is in for
git library patching. would love comments from any and all (but tannewt has final say, of course 😄). https://github.com/adafruit/adabot/pull/11
@raven canopy wow - you will put a lot of "helpers" out of work 😉
nah...they'll just get to spend more time helping with better stuff. that was kattni's response to me once on "automation". 😄
withe the advent of the CRIKITS anf M4's I may have to have a "yard sale" . What a nice set of tools.
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?
Welcome to Talkingwav, the website that offers a ton of free wav sound files to download. You'll find we have a great selection of some of the funniest...
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.
@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?
@lunar crown take a look at PulseIn it'll measure time between edges for you
Yup! This is a good idea. A website with pictures of all the boards would make it easier to filter every thing down. May not needed a single zip then.
We should also include up to date examples and demos.
I agree with you in general but think this issue is too general to be actionable. More specific suggestions are welcome, including PRs to improve ReadTheDocs.
Good idea! Want to try changing it? Its here: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/index.rst
GitHub guide is here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
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
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
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.
I think it's as simple as changing false to true in this line: https://github.com/adafruit/circuitpython/blob/master/main.c#L333
@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.
@stuck elbow Ooh. your suggestion deleted code.py. This is what I wanted. Thank you.
@bronze geyser note that this firmware will format the filesystem every time it boots
@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.
@bronze geyser @stuck elbow An alternative is a way to get into safe mode: that will prevent the bad code.py from running so you can clean things up without losing everything in the filesystem: https://github.com/adafruit/circuitpython/issues/990
@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.
or even a commmand you would run to reboot to safe mode
@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.
I wonder, has anybody ever used the fact that it blinks out the error message?
@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...
@stuck elbow Do you mean a host computer command or a REPL command to get to safe mode?
I mean something like microcontroller.reset(safe_mode=True)
but of course that won't work if your code made it crash
yes, i am trying to figure out one simple way to indicate going into safe mode.
another possibility is a watchdog being fed by the python interpreter
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
@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
@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
@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 I am not in Mu...it's running headless...so not clear how to ctl-c.
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.
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.
@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
@tulip sleet Thank you. I find myself killing the jlinkserver and some of the gdb goo in Activity Monitor (I'm on mac).
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
@tulip sleet thank you. Oooh...something new to learn!
also i have shell aliases for starting up gdb, building, etc.
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
@simple pulsar anything in dmesg?
No, i'll check again
also check what lsusb says
I did go looking for a device in /dev/dsi
the most common problem is using a usb cable without data lines...
/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
@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?
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)
@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.
@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
In the issue on the repo, Dan's suggestion of using SWDIO seems quite workable. Yes, ESP would prove the tricky one. As always. 😄
Should be able to handle it somehow in mpconfigport.
Yes, I'll figure out how to fix this and do a pull request. I should be a good way to learn CircuitPython workflow.
I didn't see how to assign this to my self in git hub.
Wow. Pretty exciting. SWDIO pulled down worked. Thank you.
Also added a UUIDType enum-like class for determining UUID type.
@bronze geyser it did? Did you implement it in main.c? I don't think it should/would work "out of the box"... Here is the issue with discussion so far: https://github.com/adafruit/circuitpython/issues/990
@slender iron Trying to run Adabot and getting a KeyError: login. Did the access token change?
no. I ran it ok last night
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.
@hathach Are you looking at this?
hmmm. did MS just pull the plug on github?
yep. looks like they're on it.
@slender iron No pin?
<@&356864093652516868> meeting in 20 minutes!
Huh. Yeah. GitHub is down. But I don't see anything internally about the status. Systems aren't really integrated yet.
GitHub Unicorn! though
perfect time to meet
I've never gotten that fail page from them before now.
Boo, I'm at work and can't hop in to the CP meeting.
Hello, Just going to listen and learn. At work so I can't give full attention:(
kk
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.
after action review
ok.. I can hear... gotta love discord's arcanery
discord-canary's pretty good, too. ;)
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. 😃
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!
not hearing
I can hear ya.
I be hearing yous guys.
I hear voices in my head
brb
can hear on iphone and linux, but not on MAc
GitHub is back, btw.
I can hear fine on mac
Excellent!
I'm just lurking.
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.
I'm here today
@drowsy geyser Will you have hug reports or status update?
alsa has issues storing settings across hour boundaries
Just going to listen and learn. At work so I can't give full attention. responses will be slow:(
Hugs to everyone for working so hard all the time. No status (haven't done anything recently)
Ok thanks 😃
fritzing ftw ;-)
Yeah, it is. I installed v5 on my Linux box and it took a while.
I like ladyada's "KeyKaiCad" from Thursday...
i just say "GifCad"
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
I'm just lurking today.
Just an idea for Scott, could pre-record the intro segment and playback. Might reduce some of the load 😃
And he likes to change it up each week 😃
@sweet wedge for CircuitPython I take it
hehe "where's the fun in that :-P"
@sweet wedge you're just after the pinouts on the 2x3?
@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.
Ah, question, anybody know when the ARM GCC cross-compiler toolchain will be available for Ubuntu 18.04 LTS?
@sweet wedge it's the same as on Arduino: http://forum.arduino.cc/index.php?action=dlattach;topic=84190.0;attach=181990
it is now
@tulip sleet Ah, ok. I was looking at the non-PPA release. I'll go check that out. Thanks!
i don't think they will update the release in the regular repos
@tulip sleet ahh. Ok, thank you.
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 😃
haha very true.
We try to ensure educators and beginners to be able to get started with little friction
weird mic is borked
hug report to scott - pypi and jerryn/dastels for finding issues with AIO Python library
AH! Happy birthday!
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.
happy b-day Scott!
BTW, mu 1.0.0-rc1 is out.
nice microphone audio, @quick remnant
hope to retain coveted "last but not least" spot. but, Dan can have it... 😄
Getting older is better then the alternative.
Dan and I have the high end covered
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
push to talk
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.
cricket
He is wise beyond his years.
oh wow you're 16? awesome
MSB?
0b100000 ?
hug report: @turbid radish for spelling out PWM technique when using an analog panel meter, in a GUIDE.
https://learn.adafruit.com/trinket-powered-analog-meter-clock
(Trinket Powered Analog Meter Clock - learn GUIDE)
I'm very interested in PWM'ing the Adafruit 50 uA Analog panel meter (D'Arsonval-Weston movement):
refs: http://adafru.it/252
https://en.wikipedia.org/wiki/Galvanometer
Off & on, you're welcome
group hug and congrats on 3.0
holy smoke
@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.
synergy?
mic workin yay
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.
@turbid radish Your Trinket book was my first introduction to the new generation of microcontrollers. Excellent. Thanks!
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
see ya there mike 😄
ooO chance to get Mike's autograf
oh my, @slender iron without a computer!?!
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. 😃
The release candidate for Mu 1.0.0 is out! This is the last step before the final release of Mu 1.0. Apart from a few minor bug fixes, the biggest change from beta 17 is the inclusion of various translations for the user interface. Full details can be found in the changelog.
@plucky flint Super exciting!
@plucky flint I just pip3 installed it.
@plucky flint, congrats!!
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... 😃
@plucky flint yayyy congrats!!!
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.
thanks folks. 🐮 ❤ 
Yay KiCad 5.0!
k-eye-cad
@umbral dagger I have some CP drivers for those e-ink displays
I'm happy being called "dastels"
I am also a dave. too many of us on the inter web i am threebits
yes, brightness isn't implemented yet 😦
@umbral dagger if it helps: https://hackaday.io/project/100853-circuitpython-badge/log/139310-the-look-up-table-holds-the-secret
https://forum.kicad.info/t/how-to-pronounce-the-word-kicad/4227/21 the video in the last post from the project leader says "kee-kad"
@stuck elbow Cool. thanks!
Be gentle... 😄
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
-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.
btw, the more you get advanced in git, you will find that everything keeps getting easier
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)
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.
that is my update --^
no
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)
apart from some short times when it was completely broken, the master seemed to be pretty stable to me
😊
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!'
yeah, esp8266 was broken all the time, but it was like that with 2.x too, so no change :)
@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.
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..
sometimes you have silicon bugs that the vendor libraries handle, that can take quite a bit of hair pulling to do without them
@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
http://adafru.it/3417 feather tripler
audio's very choppy 😕
dropin out. gotta run. cheers all.
I'm off.
👋
🎁
.oO(.. crickits) ..
Thanks everyone!! Hope your Monday is awesome possum!!
thanks, bye
Thanks!
👋
I framed mine last week. Still need to hang it.
They have ledges in old buildings that are used to hang art from, on a descending long rod/hook thing.
Yeah it can. Don't realize until you try to paint. 😡 light frames + 3m command strips FTW.
cheers!
I'm out too. Later taters!
@slender iron
https://www.oldhouseonline.com/articles/how-to-hang-pictures-in-an-old-house
Like that. 'picture rails'
Functional crown molding of sorts...
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. ;)
@umbral dagger hey you round?
@meager fog Yes
do you own an android phone?
Nope
I had a nexus 7 once to test with but it seems to have been lost in a move
haha eveone owns a Nexus 7 Somewhere
Just iOS devices here
would you be interested in this project for a guide/port
oops brbr
I saw that go by in a feed earlier
yawn
@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
i think cplay express actually would be good
because you could start with the two onboard buttons
then wire up external buttons if desired
Excellent point
ill put it in basecamp so you dont have to think about it 😃
could show that as an alternate
ok will chat with mike and we'll figure out how to test
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).
http://www.morseexpress.com/bencher/by2.jpg
That's the one I had (but not a Bencher -- MFJ, I think)
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.
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!
This blog entry suggests it's possible to debug interrupts with the J-Link:
http://blog.atollic.com/what-you-need-to-know-about-debugging-interrupts-and-exceptions-on-cortex-m-devices @bronze geyser
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...
@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?
@tulip sleet updated the Bundle and the crickit.touch_n works as expected -- thanks
@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.
@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 = 500seesaw.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)
@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.
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.
looks around I didn't do it. I think. 🤔
This was happening earlier.
And Scott ran it fine yesterday
so
It's likely me
I assume.
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". 😆
@torpid goblet not required but a good idea. why are you setting up rosie?
<@&356864093652516868> Here is the recording from today's meeting: https://youtu.be/xBWaIQLYbvQ
Notes with time codes are available here: https://gist.github.com/tannewt/7c9a7035808c7cbcd4491e3b37ff6205 Thanks to @kattni for taking notes! Join here for ...
Thanks @slender iron!
thanks for doing the notes!
@slender iron really just a learning experience. I am a bit of a testing geek:) I am curious how your system works.
kk. not very well yet 😃
It seems weird to have a separate notion of type. Could we actually have two separate classes?
@solar whale touch pin 0,1,2,3 was wrong. It was corrected to 4,5,6,7: https://github.com/adafruit/Adafruit_CircuitPython_seesaw/commit/7806f2e194cd03ed112b4ccc72c1f2c9c0ce97fb#diff-ef3f3169f2340e6a134d45e8f93e5d60 https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/crickit-tour#4-x-capacitive-touch
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)
@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?
@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...
👍
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.
@idle owl it may be GitHub. they're still in "recovery efforts". github_user is captured from a call to github.get("/user").json().
i'm running some patch tests, so let me try the same call real quick.
@slender iron i'm finding only partial agreement, i'd suggest no code change. just keep the property as light and point out this a non-unit specific value:
http://circuitpython.readthedocs.io/en/3.x/docs/design_guide.html#sensor-properties-and-units
but maybe change the code comments to reflect this:
https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/master/adafruit_circuitplayground/express.py#L66
you can add a print so it prints whatever github user is
@tidal kiln sounds ok to me. can you follow up?
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'}
@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.
well...actually, i do have my OAuth key entered. hmm...
probably outage related
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.
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 did you create rosie or is it based on an upsteam project?
@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
@bronze geyser related to your work: https://github.com/micropython/micropython/issues/3930
I have the NeoPixel on Crickit CPX flashing in magenta (power sense -- wants a 5VDC supply on 2.1 mm barrel jack, to stop flashing):
https://github.com/wa1tnr/saw-saw/tree/testing-bb
@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 = 500seesaw.touch_read(4)
324
seesaw.touch_read(4)
875
seesaw.touch_read(5)
191
no flash ?
well, 4 components...
very nice! amazing, in fact!
@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
@tannewt ah no, I am resolving #1021 usb issue. Will look at this afterwards.
@tannewt I'm not sure I understand, could you elaborate?
hi @gentle bronze !
hi @slender iron
thanks for joining discord
we had a weekly meeting earlier you might want to listen to: https://youtu.be/xBWaIQLYbvQ
Notes with time codes are available here: https://gist.github.com/tannewt/7c9a7035808c7cbcd4491e3b37ff6205 Thanks to @kattni for taking notes! Join here for ...
Hi @gentle bronze 😃
Hey @slender iron could you explain a bit more in the review what you meant? 😃
ah ya. will respond there
One class for the standard, short UUIDs and one for the long custom ones. That way we can check type with standard isinstance.
@indigo wedge ☝ better?
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....
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.
@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.
@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 😃
@indigo wedge nice -- that was nagging me.
>>> len(s.scan(5000))
184
😄
Of course it's multiple entries for same device, but still better than before 😉
hm, how much of ASF4 is in the Adafruit_ASFCore library?
atmel-samd uses ~2.7v as brownout limit. This is the lower operating limit for a number of external SPI flash chips.
See ports/atmel-samd/supervisor/port.c, which also includes logic for reporting previous brownout to startup logic so it will go into safe mode.
Also CIRCUITPY_CANARY_WORD is #if 0'd out here and should be enabled.
Hey @gentle bronze! Welcome to Discord. 👋
thanks @raven canopy
@gentle bronze Welcome -- and thanks for all the great work on the nrf52!!
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.. ??? 😖
Hello. Has there been any update on https://github.com/adafruit/circuitpython/issues/231 since it was last updated? Is that fundamentally about bi-directional communication or does it apply to one way flows across serial over USB?
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
@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 😃
Use the I2S peripheral.
- update tinyusb for wanted char
- move usb code into usb.c
There's a separate PDM peripheral with a built-in decimation filter.
The nRF52 chips don't have a DAC, so any audio output would need to be done using PWM.
sorry there is a bit off issue, the current code will swallow the ctrl+c as well, hold on, I will fix it.
See ports/atemel-samd/common-hal/microcontroller/Pin.c for existing implementation.
We want to be able to claim pins that are reserved for, e.g., status NeoPixels or DotStars
There is a TEMP peripheral to measure the on-chip temperature. Looks very easy to use: a register returns the temp in degrees C.
Like the SAMD chips, there is no true EEPROM.
@simple pulsar our current thoughts is to just allow people to create a new/separate USB-UART device
should be OK now. I am not sure if the lib/utils/interrupt_char.c is OK to edit. So I add a separated interrupt_char.c with modification under nrf/ . It only need to tell the usb stack to trigger callback when receiving the Ctrl+C
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
split off nrf52 issue into #1043.
@meager fog yeah, I just joined in. Lots of stuffs is going on here 😄
There is a QDEC (quadrature decoder) peripheral that does the work.
There is an RTC peripheral that runs off the low-frequency clock.
Closing since ESP8266 is fixed by #926, and nRF is split out.
Thanks @nickzoic!
RIght now nrf/common-hal/supervisor/Runtime.c always returns true.
@jerryneedell could you retest this now that we use nRFx for I2C?
Not when using USB: https://github.com/adafruit/circuitpython/blob/master/ports/nrf/supervisor/serial.c#L94 And for HW UART I'm not sure it's possible to detect it.
@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!
The COMP (comparator) peripheral description says it does "Single-pin capacitive sensor support".
@meager fog yeah, it is great to have all thing in one place :D.
Dan is on a rampage 😄
split this into Bluetooth and wired USB support?
As used on existing SAMD Express boards.
I don't see an explicit issue for this, but maybe I missed it.
@indigo wedge between you, dan, and thach - this codebase is like a whirlwind!
@gentle bronze Hi!
@meager fog and now with all those Issues to address its gonna be even more dynamic ;)
i was diff'ing the atmel-samd and nrf ports/ trees to see what was missing, and I think I finished 😃
@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?
@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
Ah, great! I only read the first line of that routine :)
note to myself: The flash chip is GD25Q16CTIGR right
OK great, I only saw the first definition in that file.
Remember to use nRFx :D
@meager fog thanks
hi @merry turret , almost miss your hello message. Too many things are going on 😄
@gentle bronze no problem, I missed your general one earlier 😃
it's not always this busy here
@tulip sleet is SPIDevice msb first or lsb first?
@prime flower MSB by default, but occ want other: https://github.com/adafruit/circuitpython/issues/775
I don't think this ifdef is needed, I did the fix for having usb and SD co-exist and no extra code is needed here.
Odd. I thought I had admin rights on Travis.
Will try to remember it :D. I went through the time when Nordic sdk upgrade requires massive amount of work for migration. So I often to write the code in its generic form. The new nrfx seems to do a great job :D
@gentle bronze Welcome!
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?
@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 😃
@covert oxide I don't think support for complex numbers is included.
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?
import cmath
I have a trinket, it does not work there
Oh could be we removed it from the Trinket build to conserve space.
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 (?)
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
>>>
that is what I see, yes
If you wanted to build your own, you could probably enable complex type on trinket but you might have to disable something else
interesting, I think I will look into it, thank you all!
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
right, thank you, I will play around removing something and see if I can get it to work
wow I am having to take a LOT of stuff out. complex numbers are surprisingly heavyweight
and trinket m0 is very full
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
.. removing builtin 'set' and 'help' allow complex type to be enabled for trinket m0, with 540 bytes of flash free.
wow, you are fast, thank you, I was going to remove neopixel_write
removing help & neopixel_write doesn't seem to be enough
@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?
@idle owl wait a bit. permissions are cached
@arturo182 do we define SOFTDEVICE_PRESENT when SD is selected, I couldn't find it within the makefile
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
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)
that works, thanks jepler
It actually looks like we don't define it, it's defined usually in the Nordic SDK which we don't use. Should probably define it in the Makefile if SD is not empty, because even nRFx checks for it sometimes.
@arturo182 it uses throughout Nordic code, it is good idea to use it to detect SD existence as well. I think for peripheral that is shared with SD, nrfx will need that to detect the SD existed and enabled.
btw, could you brief me on how to run a simple ble script e.g advertising something. I will check if changes break anything when the SD is running.
For sure!
The simplest way I can think of to check if BLE works is:
import ubluepy
p = ubluepy.Peripheral()
p.advertise(device_name='Python')
After that you should be able to see a device named Python when scanning, I use https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en to test it.
Following the instructions at: https://circuitpython.readthedocs.io/en/latest/ports/nrf/README.html, make BOARD=pca10056
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 yoke which arm gcc version are you using?
david (master) nrf $ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
that's the wrong gcc, you need special gcc for atm microcontrollers, you can find it here https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
Download the GNU Embedded Toolchain for ARM, an open source suite of tools for C, C++ and Assembly programming for ARM Cortex-M and Cortex-R families.
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
@indigo yoke you can also install from this ppa:
This PPA is an alternative to toolchain released at https://launchpad.net/gcc-arm-embedded. The source codes for both are same. Currently supports Ubuntu 10.04/12.04/14.04/14.10 32 and 64 bit.
Detailed explanations to Launchpad PPA can be found at https://help.launchpad.net/...
I'm afraid, 4.9 might be too old, I've been using 5.4 and Travis builds with 7 I believe
that ppa is at 7.3.1
we are using the version just behind that, and will switch to this one soon
@indigo yoke I think you could get around this error by removing -fstack-usage from https://github.com/adafruit/circuitpython/blob/master/ports/nrf/Makefile#L65
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
Well that only took ages, but it worked and now it builds. Hooray!
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..
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.
3.7v would be my target for charge. You can go lower, but it comes with risks/effects.
I think we can skip this. We just can throw an error on construction.
@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.
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?
I would actually like to have this at some point so maybe let's keep the issue open :)
This is USB only. A BLE HID issue would be good too.
@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 ### . . .
Could we have a separate module for it since its not a DAC? Arduino merges the two together but I'd rather not.
Thanks @errant grail
@mental marsh You can also write a function to do the math and then call the function https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in#get-voltage-helper
thanks all, with 7.3.1 installed, was able complete instructions without error and flash the nRF52840-DK (pca10056) board
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
@idle owl perfect, thanks 😃
@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.
@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.
I agree with @errant grail - Even if a device isn't supported by MakeCode yet, it should be acknowledged somewhere.
Perhaps a set of logo graphics at the top of the guide that indicates compatibility at a glance.
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?
ya, try without
@slender iron ok. making progress I have travis-ci.org correctly sending triggers to my box from a forked circuitpython
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...
awesome! lunchtime for me
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...
is there a flash eraser UF2 for the itsy m0?
@tidal kiln i don't see one on the troubleshooting page...
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?
@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)
@latent raptor can you link full code? (pastebin)
or pastebin works. 😄
Sure hang on
@tidal kiln https://pastebin.com/khmfQYjE
@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
@latent raptor so the cpx.red_led heartbeat in the while True: doesn't continue?
@tidal kiln correct
It never flashes
The ones before the while loop do work on any power source
what's attached to the uart?
ESP32
It is powered by the same computer’s USB
It just sends two bytes every so often
Sure sounds like the read is blocking and waiting
It’s strange because it only fails when on battery power...does the UART require a bit more juice?
I have a 2000mAh battery
the ESP32 is unpowered with only battery?
The ESP32 is only powered by the computer’s USB.
what are your wire connections between the CPX and ESP32?
ESP32 pin IO17 to pin A6 on CPX
Yes
you need to connect the GNDs also
@umbral dagger that's what i was thinking. now i just have to remember where the UART code is... 🤔
when both are on USB, they have a shared GND
Ok lemme try that 😃
but when you go battery on the CPX, you're loosing that
@tidal kiln is on another level when it comes to troubleshooting.
I find that the most frustrating things often are the fault of something trivial.
@latent raptor sweet. glad it was that easy and simple.
@umbral dagger uart.read() will timeout on the busio object's setting. since we were both going down that thread...
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 😃
@raven canopy @umbral dagger the wording in the doc kind of sounds like the timeout only happens when nbytes is not specified:
http://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/UART.html#busio.UART.read
hopefully it's there either way
@tidal kiln yeah, i'm digging down to the common-hal to verify...
looks like it will timeout if nothing is received, or after something is read but the buffer isn't full: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/busio/UART.c#L250
default is 1 second (1000ms)...
even with signal issues, wonder how it was able to lock up. maybe something lower? io_read?
This is what was playing in the back of my mind while I read @tulip sleet 's nightlight learn guide: https://youtu.be/NhjSzjoU7OQ
Group: They Might be Giants Congrats to TMBG: 1 + Million Views Birdhouse In Your Soul (Official Video) - They Might Be Giants: http://www.youtube.com/watc...
@tidal kiln could be. the timeout doesn't penetrate that far: https://github.com/adafruit/asf4/blob/master/samd21/hal/src/hal_io.c#L69
and the floating RX would have at least returned bogus values, if that was the cause. no?
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......"
≡
now to hunt down some "why is DFLL setup like this on M4", before I ask Scott or Dan. 🤔 📚
Can someone take a look at this please? https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/84
yay! a distraction! 🐿
😄
did you want a review on the lib too? (i peeked to make sure the submodule is gtg. it is!)
@idle owl done!
@raven canopy Thanks. Limor already reviewed it, so as far as I know, it's good to go as well
well yeah, i'd say that counts. 😆
Thank you, I can now check that off.
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.
@strange pumice not that I've seen/heard of.
@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? 😃
@drowsy geyser this was in the history: https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa
Thanks @raven canopy ! I looked in the history but didn't see it.
That'll be right helpful. 😃
"ppa" was the key ingredient. at least for me. 😆
Ahhhh, of course. Thanks!
you're welcome.
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.)
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).
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.
@remote pike "When I push the reset button": you're double-tapping right? timing can be finicky...
Yes
k. do you have the Arduino IDE installed?
Yes
that would be the easiest way, IMO. upload a sketch, then use the double-tap to get back to the bootloader.
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.
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.
here is the learn guide for the Arduino IDE setup: https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/arduino-ide-setup
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.
I'll be here a while. and, you're welcome.
A few minutes might be a bit optimistic.
hehe. i was just getting to the good parts @drowsy geyser....then poof!
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$
did you do git submodule update --init --recursive after cloning? and make -C mpy-cross?
hehe. all good. pretty sure i've asked the same question before. 😄
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. 😃
no worries. i was looking at system76 lappies the other day. amusing that they only mention running windows in a VM vs dual-boot.
Yeah, I don't bother. I run FreeBSD in a VM, but if I need/want Windows I just use the Razer....
i think it's device driver related. 🤷 yeah, i've grown to accustom to using the Vagrant VM for
. WSL seems too much of a hassle with no shared folders...
Oh! If you want into the Windows filesystem just ```
cd /mnt/c/Users/<username>/
really? when did that get implemented? last i looked it wasn't working yet...
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....
steals hukuzatuna's previous <sheepish> tag
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.
WooHoo! CircuitPython 3.0-latest built for all my hardware!!! CP FTW!
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...
@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?
@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.
Thanks again. I'll give it a go tomorrow.
@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.
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 - thank you for checking out PEP8.
@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.
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...
sure, will do it as soon as I can.
@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
Oh hey, here's a @tulip sleet guide on installing and configuring the GCC ARM toolchain on Linux. Duh. 😃
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 
@indigo wedge can you merge now?
@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.
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?
I'll take a peek and see if I notice anything. I'm guessing it's RTD related... @solar whale
@lavish saffron works for me:
>>> b'aaa'.decode('utf8')
'aaa'
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.
You could also try str(b'aaa') or unicode(b'aaa') depending on what type you want.
@stuck elbow @lavish saffron Do any of the board dependent build settings (mpconfigport.h) impact this? What board are you using?
just wondering if the small board < 192000 flash options are an issue.
let me flash 3.0 on a gema
I’m running it on a Metro M0 Express. Reinstalling CircuitPython 3.0.0 didn’t help.
ok - nevermind.
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'
Thank you. That’s just what I need. I appreciate the time you’ve spent.
sorry for misleading
now I remember a discussion in the bugtracker in micropython about dropping .decode()
@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.
@raven canopy ah -- odd - that was there in the previous release as well.
Same with i2c on line 254. Yeah, I've seen it pass plenty. It may be a recent addition... 🤷
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.
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.
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
I'd let them sit. Functionally it works, so if someone grabs it if adabot updates the bundle, it should be fine.
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?
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.
OK - we'll see if anyone sees this discussion -- If not, I'll raise it next Monday. Thanks
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?
@indigo wedge why do you need to do something when an item is added?
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
@indigo wedge what would happen if instead of appending to that list, someone just replaced the whole list by doing foo.bar=[new, list]?
can you that if the property has no setter?
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?
yeah i think i might end up doing that
or even have a method like register_charcteristics(list)
@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
@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.
(shakes fist in air) TRAVIS!
@solar whale sounds like pylint was updated
@slender iron OK - so just bad timing on my part.
@covert oxide file an issue and we'll look at it
we are doing more memory stuff than before
@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!
whew ok - this is now passing https://travis-ci.org/adafruit/Adafruit_Learning_System_Guides
we disable it on most repos because it makes updating the original branch harder. I suggest squashing locally instead of during the merge
np, just letting you know why
👍
we may want to consider updating the text here:
https://learn.adafruit.com/introducing-itsy-bitsy-m0/uf2-bootloader-details#updating-the-bootloader
to be a little more "you typically don't have to do this"
I think some people are seeing that as part of a general fix for non-bootloader related issues, ex:
https://forums.adafruit.com/viewtopic.php?f=62&t=138345
@tidal kiln its not a terrible idea, and never has bricked a board.
@indigo wedge see this? https://github.com/adafruit/circuitpython/issues/586#issuecomment-405794592
but ill update it!
Hi @slender iron , yes I've seen it, need some time to sit on it and think 😉