#circuitpython-dev

1 messages ยท Page 202 of 1

tidal kiln
#

@idle owl not sure what's up. the files show up after running submodule add

$ git submodule add https://github.com/adafruit/Adafruit_CircuitPython_Bundle.git libraries/drivers/cap1188
Cloning into 'repos/Adafruit_CircuitPython_Bundle/libraries/drivers/cap1188'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 1080 (delta 20), reused 36 (delta 19), pack-reused 1042
Receiving objects: 100% (1080/1080), 185.80 KiB | 605.00 KiB/s, done.
Resolving deltas: 100% (634/634), done.
$ ls -a libraries/drivers/cap1188/
.   CODE_OF_CONDUCT.md  .gitignore   libraries  README.md   requirements.txt  update_scripts
..  .git                .gitmodules  LICENSE    README.txt  .travis.yml       update-submodules.sh
idle owl
#

That's really weird. It's acting like you're doing the submodule update recursive. I guess do git add and only add the appropriate files? The two that are supposed to be different

#

Instead of a git add . or something. Depending on your setup, it might be easier to do another PR if you don't want to deal with removing files from the current one.

tidal kiln
#

let's do another pr. i've tried various things and can't get git to behave. i've probably got my current local state all messed up at this point.

idle owl
#

Sounds good

tidal kiln
#

do you know the proper way to "delete" the current/wrong submodule?

idle owl
#

um.... I did yes. Let me check bash history. I think it's submodule remove or something.

#

This maybe? git submodule deinit libraries/libname/

#

Because I don't know why else I would have that in my history.

#

Looks like I must have done the same thing at some point.

tidal kiln
#

didn't really remove it

idle owl
#

hmm

tidal kiln
#

if i just remove the files from libraries/drivers/cap1188 and push that to current PR, will that fix it?

idle owl
#

I'm not sure. Try it?

slender iron
#

submodules are finnicky you may need to deinit it

tidal kiln
#

oh. and i think i see an issue with my hand hack of .gitmodule

raven canopy
#

There's always:

git reset --hard
git submodule update --init --recursive
git revert <original sub-module commit>
git submodule add <drivers/cap1188>

Unless reset won't properly handle submodules. Never tried it on the bundle...

tidal kiln
#

i tried some reset hards, but you've added a few other commands

raven canopy
#

That's just thinking out loud. It's still git, so ๐Ÿฆ„s and ๐ŸŒˆs.

#

And :sorcerer:s.

tidal kiln
#

@raven canopy i was resetting to a specific commit hash, if that matters

idle owl
#

@tidal kiln To verify: that sensor does SPI and I2C both right?

tidal kiln
#

yes

idle owl
#

thanks

raven canopy
#

@tidal kiln probably a viable option. I was resetting to current, which is why I included the revert for the original commit.

tidal kiln
#

what is <original sub-module commit> in the revert command

raven canopy
#

Whatever the commit hash is for the first CAP1188 commit to the bundle. Just helps document the commit history and clean up the tree.

#

If you were resetting to the commit prior to that one, then my way is probably just the long way around.

idle owl
#

@tidal kiln Fixed the issue with CAP1188 not deploying to PyPi. So that's done.

#

unless I'm preempting something you're already doing, in which case ignore me and carry on.

gusty kiln
#

submodules are just the best, aren't they?

tidal kiln
#

@idle owl i forgot to change the line [submodule "libraries/cap1188"] also in first PR

#

so now that's fixed and i just deleted files in cap1188 folder

#

those changes are pushed

idle owl
tidal kiln
#

yep

idle owl
#

Also, why is the URL for it the bundle URL? [submodule "libraries/drivers/cap1188"] path = libraries/drivers/cap1188 url = https://github.com/adafruit/Adafruit_CircuitPython_Bundle.git

tidal kiln
#

gah!

#

:table_flip:

#

the entry in .gitmodules just needs to be:

[submodule "libraries/drivers/cap1188"]
    path = libraries/drivers/cap1188
    url = https://github.com/adafruit/Adafruit_CircuitPython_CAP1188.git

right?

#

wait

idle owl
#

waiting

tidal kiln
#

that

idle owl
#

Yes, that's what the entry should look like, but it should be automatically added when you do git submodule add. You shouldn't have to manually do anything with it. That's also what adds the submodule.

tidal kiln
#

yah, but that's adding all the files for some reason too

idle owl
#

You still need to add the submodule into the correct place. The PR has the incorrect one deleted, so that happened correctly.

#

Hmm.

#

It doesn't appear to have done it for me.

#

oooh there it goes. It did this time.

#

so that's entirely weird.

tidal kiln
#

i'm sure it's probably just my local state, but i can't figure out what/why

idle owl
#

Because I git added the files, and it was fine, but then when I did git reset HEAD filenames and then created a branch, and then added it back again, all the files were there.

#

@tidal kiln ok so I just recloned the entire bundle and added it, and so far it's playing nice. Do you want me to do a PR for it?

tidal kiln
#

yes please.

manic glacierBOT
#

The Adafruit sponsored development of CircuitPython is very beginner focused so myself or @dhalbert will not get to this anytime soon. I do agree that it'd be useful for advanced users. I'd be happy to help someone else implement this.

I think we'd actually want two different modules:

  1. A memory module that gives direct access to RAM which is generic across all CircuitPython ports.
  2. A <port>_memory module that gives access to the full memory space. Having this as a platform specif...
idle owl
#

that won't fix removing the current version of it though. hmm.

#

ok I'm going to try doing it manually. see if the PR buggers itself.

#

Hooray! It looks like it did.

#

See if Travis likes it or not.

raven canopy
#

Travis should change their mascot to Gandalf. That way when it fails, they can flash The Grey and say "You shall not pass!"....

idle owl
#

places offerings before the Temple of Travis

#

Hooray!

tidal kiln
#

works for me

#

i'm not sure why my libraries/drivers/cap1188 folder was not showing up in PR

idle owl
#

There. I'll keep a clean version of the bundle locally for adding modules in case this happens again. And continue using my crazytown one that has all the libs actually loaded into it from doing all the PyPi stuff.

tidal kiln
#

i even tried adding it manually

idle owl
#

ยฏ_(ใƒ„)_/ยฏ

tidal kiln
#

^^ that | fontsize+=1e6

raven canopy
#

git checkout -b crazytown added to memory bank

idle owl
#

@raven canopy ๐Ÿ˜„ Exactly.

#

Went to a hockey game last night and someone messaged me talking about pip not installing the extra files they needed, and I said we needed to pip install a better team already. (We lost.) At least I got a literal lol out of him. Which I'm sure was needed. ๐Ÿ˜„

manic glacierBOT
#

Our neopixel library is known to be a bit slow. We have partially complete PixelBuf work that is a C helper to speed up all RGB led drivers.

I don't think many Python programmers will jump from Python to assembly without knowing C first. Just like supporting direct memory access isn't a priority for us, supporting assembly isn't either. It's a very advanced feature that is not useful to beginners. However, I'm always happy to help someone else add and support a feature like it. So, let me ...

tidal kiln
#

try pip3 install next time ๐Ÿ˜ƒ

raven canopy
#

pip install late-90s-Detroit-Redwings? ๐Ÿ˜†

tidal kiln
#

@idle owl i wonder if my using the bundle URL was what screwed things up

#

the bundle was the submodule for the bundle

idle owl
#

@raven canopy Exactly! ๐Ÿคฃ

#

@tidal kiln I don't know, it shouldn't have. But who knows.

tidal kiln
#

i'm just going to merge your PR - cool?

idle owl
#

yup

#

That's what it's there for ๐Ÿ˜ƒ

#

@slender iron Your travis encrypt -r trick worked on another repo. So thanks for that.

slender iron
#

๐Ÿ‘

tidal kiln
#

@idle owl done and thanks

idle owl
#

No worries! Submodules are their own brand of weird. It happens.

#

@raven canopy and @tidal kiln I'm going through my email backup. Thank you SO MUCH for all the work you're doing on libs with really solid reviews and PRs!

tidal kiln
#

np. there's been a lot hacktoberfest activity. it's great.

manic glacierBOT
opaque patrol
#

What board do we select in the Arduino IDE with the Hallowing?

tidal kiln
#

there should be a Hallowing entry in the list

#

let me check exact location / text....

#

Adafruit Hallowing M0 under Adafruit SAMD Boards

#

if it's not showing up, update your BSP

#

current version is 1.2.3

opaque patrol
#

I thought I had updated this last week, apparently not...thanks

tidal kiln
#

np. the update is pretty new.

manic glacierBOT
#

My worry with having all of them under one module is that we won't be able to pick and choose which to have in particular builds. We've already set a guideline that feature availability is done at the module level instead of the class level. If we have it under network then we'd need to have them all there.

I think we'll add more under network in the future so we could also just leave it.

#

My worry with having all of them under one module is that we won't be able to pick and choose which to have in particular builds. We've already set a guideline that feature availability is done at the module level instead of the class level. If we have it under network then we'd need to have them all there.

I think we'll add more under network in the future so we could also just leave it.

solar whale
#

@tidal kiln thanks for the LSM303 issue! Well done!

tidal kiln
#

my guess - 12 bit got in the mix because of the temperature register

#

and then libraries got propagated from libraries propagated from libraries

fierce oar
#

hello! i

idle owl
#
tidal kiln
#

and then some of the original libraries were fixed, but not the propagated ones

#

hey @fierce oar

fierce oar
#

i'm making progress on my project from yesterday, but now i'm getting an invalid syntax error for a line in my code that just says pixels.show()

#

oh and i am sticking with my CPX for now, put the hallowing aside for another project ๐Ÿ˜ƒ

idle owl
#

Can you provide some context?

tidal kiln
#

check indent

idle owl
#

Or do that first ^^

fierce oar
#

should i just post my code? oh yes it could be an indent thing , im always incorrectly indenting

tidal kiln
#

how long is code?

fierce oar
#

maybe this is enough for you to see?

        cpx.play_tone(pitch, .1)
        pixels.fill((125, pitch, 80)
        pixels.show()
        time.sleep(.25)```
#

should it not be the same indent as the line above it?

idle owl
#

@fierce oar If you want to post code, surround it with three backticks on either side, before it and after it. It's the key next to the 1 key on a US keyboard.

tidal kiln
#

and you can edit your previous post

fierce oar
#

oh neato, thanks!

tidal kiln
#

missing a )

idle owl
#

Makes it easier to read. You can type a message before and after it too if you want, whatever's outside the backticks will show up as a message.

solar whale
#

or one to many (

fierce oar
#

ohh one too many ( in the line above? i think i see it

idle owl
#

No, it's missing a paren. .fill requires two because the tuple is the single argument provided to it.

manic glacierBOT
#

Thank you @tannewt !

A few notes:

@micropython.native gave me about 2x performance improvements without any code changes. It doesn't allow invalid python - but you are restricted to a subset of the language: with is not supported, generators are not supported, and raise must be used with an Argument. But you can only decorate specific hot paths, so it is opt-in at the function leve...

solar whale
#

oops -- sorry -- I'm still not tuned to tuples

idle owl
#

No worries!

#

It was months before I knew how to explain why it required two sets of parens.

tidal kiln
#

pixels.fill((125, pitch, 80))

fierce oar
#

ah! thanks!

idle owl
#

( @fierce oar a single backtick on either side of something makes it inline code... so you know another trick)

fierce oar
#

omg i just learned like 3 things in one minute - you all are amazing ๐Ÿ˜ƒ

idle owl
#

One of these days I'm going to need to build a thing and you're going to be the one teaching me. Give it time ๐Ÿ˜ƒ

#

@tidal kiln Hey on the CAP1188 what's the point of the side with the LEDs? I don't see it used or explained anywhere.

fierce oar
#

omg i just amazed myself and i need to share lol

idle owl
#

@fierce oar do it!

tidal kiln
#

@idle owl do you mean the L1 etc pins?

idle owl
#

@tidal kiln I do, yes

fierce oar
#

i got an error saying can't convert float to int, so i looked up how to convert a float to an int and added it in to get this pitch = int(sonar.distance*100) and it worked!

idle owl
#

Aren't those LEDs?

#

@fierce oar That's awesome! Great job!

tidal kiln
#

@fierce oar cast master!

idle owl
#

lol maybe for you ๐Ÿ˜„

#

but lay it on me, let's see if I can get it

#

Also it turns out they're mentioned in "Pinouts" on the sensor guide. I guess I needed to click further before I asked. Still, explain please.

tidal kiln
#

the CAP1188 has the cute feature of having pins that are intended to be used for LED indicators of touch

#

the breakout board includes LEDs already tied to these pins

#

but if you want to do something different with them, then they are available on the header pins as well

idle owl
#

wait so do the LEDs go on if you touch on the C-side? (I haven't wired it up yet)

tidal kiln
#

yep

idle owl
#

Oh. Ok...

#

So you touch on the C-side and it triggers the pin on the L-side?

#

so you can use it as an output?

#

but also the LED?

#

(conflating the explanation in the guide with what you're telling me, not sure if I conflated correctly.)

tidal kiln
idle owl
#

ah ok

#

Oi now that I have the option I want to design a board that does a thing, but then I look at things like this and realise waaaaaay out of my league.

tidal kiln
#

yes - you could use them as output also, or think of them as 3.3V level digital outs

idle owl
#

Ok

#

Hooray I understood! ๐Ÿ˜„

tidal kiln
#

but i'd probably read the datasheet to verify their exact nature before hooking something up

idle owl
#

read as: don't hook something up.

#

Datasheets are still a magical mystery to me. Except for LIS3DH.

tidal kiln
#

some datasheets are a magical mystery for everyone cough LSM303

#

@idle owl i'll check on those PR's if i can. just got a FRAM. but first i'm going to see if we can wrap up @pastel panther's MAX driver

idle owl
#

@tidal kiln Thank you. I agree, wrapping that one up would be great.

manic glacierBOT
#

@hathach I stumbled on this while looking at the datasheet for something else. It says to use high drive strength to drive the QSPI pins:

[page 267, section 6.19.1]

2. To ensure stable operation, set the GPIO drive strength to โ€œhigh driveโ€. See the GPIO โ€” General
purpose input/output on page 141 chapter for details on how to configure GPIO drive strength.

idle owl
#

Bleh this wiring diagram is a mess. SPI for CAP1188 is annoying.

#

there. That's somewhat better.

manic glacierBOT
#

Currently nrf DigitalInOut uses high (strong) drive strength on the output pins, but none of the other peripherals for digital outputs are set to do that. The nrfx drivers all use standard drive strength,including, interestingly, I2C (TWIM).

We changed the atmel-samd to use high drive in the past, which is why I did the same for nrf DigitalInOut.

I could reconfigure the SPI, PWMOut, etc. pins to have high drive after initializing the devices.

Standard drive is typical 2ma, hi...

#

On Sat, Oct 13, 2018, at 06:32, Scott Shawcroft wrote:

My worry with having all of them under one module is that we won't be
able to pick and choose which to have in particular builds. We've
already set a guideline that feature availability is done at the
module level instead of the class level. If we have it under network
then we'd need to have them all there.
Ah, right. Yeah, how I would have done it would be to have different
classes appear under network (network.WIZNET5K, netwo...

wraith tiger
#

Today I discovered that if I switched my chromebook to the chrome os beta channel, I could get access to linux apps (debian stretch in a vm). I'm curretly installing mu. I''m not sure if I'll have access to the usb ports, though.

idle owl
#

Neat!

pastel panther
#

@tidal kiln I fixed the lint issues and travis is green again

tidal kiln
#

@pastel panther cool. i signed off. pinged scott since he hasn't. we'll see what he might have to say. ๐Ÿ˜ƒ

pastel panther
#

coolio; thanks

tidal kiln
#

@fierce oar just noticed in your code:

        cpx.play_tone(pitch, .1)

that was recently fixed. make sure you're using the 3.0.3 firmware.

idle owl
#

@tidal kiln For CAP1188, what are the properties worth mentioning in the guide? Some of that looks like more internal or advanced level stuff.

meager fog
#

@tidal kiln @umbral dagger hey ktown went thru the datasheet and updated the lsm303 library

#

if ya wanna do a minor release

umbral dagger
#

@meager fog Excellent!

#

@umbral dagger Internally I expect? No changes to the API?

tidal kiln
#

@meager fog yah. saw that. was just hoping for some useful info - but got a PR instead. ๐Ÿ‘

#

@idle owl value and raw_value are going to be the main properties

meager fog
#

yeah its confusing because they say '16 bit' and then '12 bit' but its zero-padded 12-bit data in a 16-bit int

#

so top 4 bits are always 0's

#

(or 1's if negative)

tidal kiln
fierce oar
#

@tidal kiln oh thanks! i am using 3.0.3, does that mean I need to write the cpx.play_tone line differently?

tidal kiln
#

nope. it'll just do what you expect now.

fierce oar
#

oh! awesome, thanks!

idle owl
#

@tidal kiln Thanks

tidal kiln
#

the idea is it works just like touchio

#

it's currently missing threshold though

idle owl
#

I haven't used touchio in so long, heh.

umbral dagger
#

@tidal kiln Hmm.. now Y isn't changing for me.

#

@tidal kiln Before it was becasue it was Z being returned as Y and rotating on a tabletop didn't effect Z.

#

@tidal kiln Now, if I rotate in 3d, Z behaves as expected... Y is stable regardless how I manipulate it.

#

@tidal kiln I'll keep looking

tidal kiln
#

can you add a print(raw_values) in the lib to see what the unpack is returning

umbral dagger
#

@tidal kiln Y is stable at -4096

#

4K... suspicious

tidal kiln
#

๐Ÿ˜ฆ

#

print(self._BUFFER) are the bits for Y even changing?

umbral dagger
#

@tidal kiln constant at F000

#

weird

tidal kiln
#

yah. at that point it has nothing to do with updated code.

umbral dagger
#

ya

#

updated code looks good... I like the wider spread of values

tidal kiln
#

power cycle it

umbral dagger
#

you mean turn it off and turn it on again?

#

I did ๐Ÿ˜ƒ

tidal kiln
#

yah. i was trying to make it sound techy though.

#

there's an enable call int __int__

#

maybe it can get in a weird state?

umbral dagger
#

Now I2C is fubar

tidal kiln
#

oof. what's your setup? board, wiring, etc...

umbral dagger
#

OK.. that's back (CPX with a flora LSM303 backpacked to it)

#

Back with constant Y

#

I'll try another LSM303

#

Not to later.. maybe tomorrow.

#

Tacos to make soon.

raven canopy
#

Thanks @umbral dagger. now i want ๐ŸŒฎs too!

pastel panther
#

Tacos for dinner!
Supongo que me voy a Los Tacos de Pancho despuรฉs del trabajo

#

(No hablo espaรฑol mรกs que poder ordenar mal los tacos)

raven canopy
#

argh! research options and applicability on an idea, write out an issue comment novel, proof-read and re-verify...find a single line of information that blows up the whole idea. well...time for Friday down-time I guess. ๐Ÿ˜ก ๐Ÿ˜ถ ๐Ÿ––

idle owl
#

@raven canopy ๐Ÿ˜•

raven canopy
#

s'all good. happens a lot. ๐Ÿ˜„

steep moth
#

๐ŸŒฎ๐ŸŒฏ

raven canopy
#

i was thinking about cron'ing the weekly summary straight to the repo. and almost simultaneously allowing for that webpage that has been discussed...

idle owl
#

Which page?

raven canopy
#

that one... only remembers it being discussed; doesn't remember the exact purpose ๐Ÿ˜†

#

was it for making firmware easier to download? instead of pointing to the release page...

idle owl
#

Oh.

#

Right, ok, I feel like we have some semblance of a thing up.... ๐Ÿค”

raven canopy
#

ears stand at attention
nice! hadn't heard anything about it lately. #leeks

idle owl
#

I... may be wrong.

#

Trying to verify my brain.

raven canopy
#

#leeks_status_revoked

idle owl
#

Ok maybe it was only talked about.

raven canopy
#

this was the single line that blew up my ideer: Travis CI can deploy your **static files** to GitHub Pages after a successful build. emphasis mine.

idle owl
#

oh hmm

raven canopy
#

if only it wasn't constrained to static files...would've worked perfectly.

idle owl
#

sighs Why does this work in code.py but not in the REPL? ```python
import board
import busio
import digitalio
import time
from adafruit_cap1188.spi import CAP1188_SPI
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D5)
cap = CAP1188_SPI(spi, cs)

while True:
for i in range(1, 9):
if cap[i].value:
print("Pin {} touched!".format(i))
time.sleep(0.1)```

marble hornet
#

@slender iron how finished would you say displayio is?

idle owl
#

Without the time.sleep() it works in the REPL.

marble hornet
#

ratehr how close to the near "finished" api ?

idle owl
#

but add that and it doesn't print anything.

raven canopy
#

@idle owl error?

idle owl
#

No error, simply doesn't print.

pastel panther
#

@raven canopy I'm sure it doesn't help but serving "static" pages can produce dynamic content if you're willing to get your hands dirty with some JS

raven canopy
#

hmm..i wonder if an interrupt is squashing the USB/serial comms.

#

@pastel panther yeah, in reading up on Pages, it seems that side is pretty customizable. but, not allowing Travis to generate new content destroyed my idea. (and JS...yuk #personalfeels)

idle owl
#

eh forget it. Not worth fighting with, the output can be spammed

pastel panther
#

@raven canopy what type of content were you thinking about? I thought that travis could generate just about anything

raven canopy
#

@pastel panther was looking to automate the weekly adabot summary, that gets used for the meeting notes.

pastel panther
#

That should be very possible

raven canopy
#

am i misinterpreting "static content"?

idle owl
#

HAH. The nature of the board made it think all the pins were touched repeatedly in order because I connected wires to it after it was already started up. So it didn't have time to calibrate. Which meant it spam printed each in name in order which is exactly what I needed anyway.

pastel panther
#

probably; by that they mean "not a cgi"/ dynamic content

raven canopy
#

@idle owl BOOM. You win. ๐Ÿ˜„

pastel panther
#

in that context it just means that pages isn't generating new content on every request

raven canopy
#

hmm...maybe I will click "Comment" instead of "Cancel".

idle owl
#

Oooh you haven't cancelled yet? Do it!

#

Comment I mean.

#

Not hit cancel.

#

Which I realised after I sent that sounded more like my intent.

raven canopy
#

hehe. why does life have these difficult choices? ๐Ÿคฃ

pastel panther
#

hah

raven canopy
#

i shall add an addendum to my comment outlining the "this needs further investigation"...

idle owl
#

Valid.

raven canopy
#

i mean, novels want to be longer, right?

idle owl
#

Always ๐Ÿ˜„

pastel panther
#

@raven canopy I would be surprised if we couldn't do what you're suggesting. I forget what's available from python web frameworks but there is doubtless a templating system that were can feed stats into from travis that will produce a nice html page that Github Pages can serve

idle owl
#

The LEDs on this board make it too much fun.

raven canopy
#

commented... thanks @pastel panther for jumping in and reversing my course.

pastel panther
#

Lol if that's a novel, I'm Tolstoy

raven canopy
#

well, for a GitHub issue... I have much longer works. ๐Ÿ˜„

#

and with that...its pizza+antman time. (ikr...no ๐ŸŒฎs. ๐Ÿ˜ฆ)

idle owl
#

Have a good one @raven canopy!

marble hornet
#

i haz an arbitrary question ? may i ask?

pastel panther
#

You may

marble hornet
#

is it quicker to run an else command or just set a var to 0?

pastel panther
#

can you post a snippet of what you mean?

marble hornet
#

sure

#
            self.clear()
            self.selected = 1
            self.place()
self.selected = 1
#

vs...

#
if self.active:
    self.clear()
self.selected = 1
if self.active:
    self.place()
#

vs.....

#
            self.clear()
            self.selected = 1
            self.place()
else:
    self.selected = 1```
pastel panther
#

It's a bit hard to grok the logic there but regardless an else vs setting a variable shouldn't have a tangible difference.

marble hornet
#

okay

#

thanks sid!

pastel panther
#

np

tidal kiln
#

@idle owl adding threshold will be a good next feature for CAP1188. for now, you can call recalibrate and it will do it auto style.

marble hornet
#

anyone know an expected date for displayio support "officially" ?

marble hornet
#

if any

lone sandalBOT
fierce oar
#

Traceback (most recent call last):
File "main.py", line 51, in <module>
File "main.py", line 33, in rainbow_cycle
File "neopixel.py", line 167, in setitem
File "neopixel.py", line 124, in _set_item
ReloadException:
soft reboot

tidal kiln
#

@fierce oar looks like you've just saved that example as main.py?

fierce oar
#

yes, i guess that was the file that was already on my gemma from before i updated

tidal kiln
#

no. that's ok. just trying to figure out how you're running it.

fierce oar
#

yes, i just copied it into the main.py file

tidal kiln
#

what are you using for neopixels and how are they connected?

fierce oar
#

three sewable neopixels connected soldered together with wires and alligator clips from the wires to the gemma, data in on the first pixel going to D1

tidal kiln
#

did you change code to use D1?

fierce oar
#

yes

#

i just pasted the example code into my main.py file and changed the pin and number of pixels, should i paste the code here?

tidal kiln
#

just set something up real quick and tested

#

seems to work ok

#

what are you powering with?

fierce oar
#

its just plugged into my computer

#

oh let me check the cable!

#

still not working, but it seems to give me slightly different errors every time

#

this time it said

#

Traceback (most recent call last):
File "main.py", line 51, in <module>
File "main.py", line 34, in rainbow_cycle
File "neopixel.py", line 216, in write
File "neopixel.py", line 227, in show
File "neopixel.py", line 227, in <listcomp>
File "neopixel.py", line 193, in brightness
ReloadException:
soft reboot

#

did you check it on a gemma m0?

tidal kiln
#

yep

#
Adafruit CircuitPython 3.0.3 on 2018-10-10; Adafruit Gemma M0 with samd21e18
>>> 
soft reboot

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

...neopixels chugging away

#

as a quick sanity check, try changing main.py to just be the simple blink example

fierce oar
#

im taking the alligator clips out of the equation, i didn't want to solder to this gemma yet but maybe i just have to

tidal kiln
#

i'm using alligator clips to a nepixel stick on a breadboard

fierce oar
#

my wires are really tiny though, and i just wiggled them and the neopixels flickered

tidal kiln
#

are you able to disconnect the neopixels from the gemma easily - like with the alligator clips?

fierce oar
#

omg figured it out, i just made a silly mistake and connected my gemma to the last neopixel instead of the first one (i'm soldering them face down)

#

clearly i've been at this too long today and need to take a break ๐Ÿ˜ƒ

#

interesting that it made my repl give me those errors though? the errors made me think it was code related

#

it probably always does that but i never noticed it before

tidal kiln
#

ok. cool. you figured it out. was trying to find a dotstar blink you could run.

#

nvm

fierce oar
#

thanks so much for your help @tidal kiln

tidal kiln
#

yah, the error is misleading. really no way for it to tell that wiring.

fierce oar
#

having a cooler head to help step through it logically is so helpful ๐Ÿ˜ƒ

tidal kiln
#

that's kind of weird error - not one you typically get with just a simple code error

#

and you could also see how it wasn't the same every time

#

so those together kind of point to something more hardware-y than code-y

#

wiring? power? etc.

#

and you found it - wiring

fierce oar
#

yeah a real red herring, i started looking those terms up and found notes about the 3.0.3 update and thought it was an issue with the libraries being updated, or the reload exception thingy

#

good reminder for me - always check the wiring, even when it seems like it wouldn't be related

tidal kiln
#

also, the more normal code related exceptions will hopefully have a useful message

#

the one you were hitting had none

fierce oar
#

good to know that when that happens it's probably not the code

#

i had no idea that incorrect wiring would travel back up the pipeline and show up on my computer like that

tidal kiln
#

exactly what it was done is kind of unknown, but obviously it didn't like it

fierce oar
#

no it did not

#

im also using tiny tiny wires so the alligator clips were pretty fiddly, there were lots of points that could have been the culprit actually ๐Ÿ˜ƒ glad it was just one thing that was wrong

pastel panther
#

hey @idle owl when you have a minute I'm about ready for a ADXL345 repo

manic glacierBOT
#

The main reason for configurable drive strength isn't power saving, but EMC. By choosing only as much strength as necessary, you can pass EMC tests, without having to add series resistors. This is especially important for high speed buses. But having a high drive strength doesn't necessarily mean, that this current flows through the pin. When driving bus lines, the current will flow only when the level changes, and only as log as you need to charge or discharge the line capacitance.

I thi...

manic glacierBOT
lone sandalBOT
haughty bobcat
#

Does anyone know why my Circuit Python program runs fine when the REPL is open but gives me an error when not connected to a pc?

raven canopy
#

@haughty bobcat we'll need some specifics. components & code at least...

haughty bobcat
#

all of the code?

raven canopy
#

yeah, that would help...

haughty bobcat
#
import board
import pulseio
import array
import adafruit_dht
import adafruit_dotstar as dotstar
from digitalio import DigitalInOut, Direction, Pull
 
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
ir_led = pulseio.PWMOut(board.D0, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
switch = DigitalInOut(board.D2)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
dht = adafruit_dht.DHT22(board.D1)
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.3)

trig_command = array.array('H', [9027, 4457, 594, 585, 576, 578, 573, 582, 568, 585, 576, 578, 573, 581, 569, 585, 576, 578, 572, 1654, 573, 1653, 575, 1652, 575, 1653, 575, 1652, 575, 1653, 575, 579, 571, 1630, 598, 1629, 598, 583, 578, 576, 574, 580, 571, 583, 578, 576, 574, 580, 570, 584, 577, 577, 573, 1654, 574, 1653, 575, 1652, 575, 1652, 575, 1652, 576, 1651, 576, 1652, 575, 40320, 9038, 2200, 603])
dot[0] = (0, 0, 255)
while True:
    humidity = dht.humidity
    if (humidity > 86):
        dot[0] = (0, 255, 0)
        ir_send.send(trig_command)
        time.sleep(120)
    if (humidity < 74):
        dot[0] = (255, 0, 0)
        ir_send.send(trig_command)
        time.sleep(120)
    if 74 <= humidity <= 86:
        dot[0] = (0, 0, 255)
 
    time.sleep(0.01)  # debounce delay```
raven canopy
#

well, i see nothing there that should rely on a PC. how are you powering it?

haughty bobcat
#

with a 1 amp USB power brick

solar whale
#

@haughty bobcat is that code saved as code.py or main.py? What board are you running it on?

haughty bobcat
#

trinket m0

#

is there a key combo to enter REPL?

solar whale
#

Control C

haughty bobcat
#

By the way, this is CircuitPython 3.0.2.

raven canopy
#

no. that's just a PEP8 (code formatting) warning. won't effect code execution.

solar whale
#

it works in REPL? how do you start it ?

haughty bobcat
#

ok, that may have been a wrong way to say it

#

It only works when MU is open and the serial console is open.

#

So I close MU, and it get a series of flashes when I click the restart button

solar whale
#

in serial console try - control C then control D -- is should reboot and run

haughty bobcat
#

yeah

#

runs fine

#

I should mention that earlier on I was printing to the serial console to graph humidity data, but I deleted all print commands.

solar whale
#

if you exit mu then press RESET -- what doe the trinket DOTSTAR do?

haughty bobcat
#

blinks

#

it's solid blue but another part of the dotstar blinks

solar whale
#

what color

haughty bobcat
#

um....I'd call it purple when it mixes with the blue

#

So it turns green, then turns blue. Then another color inside the dotstar blinks and turns the color purple

solar whale
#

one problem is that you can't read a DHT that fast -- try a 2 second delay -- not likely causing this problem, but something to be carful of.

haughty bobcat
#

is time.sleep(0.01) measured in seconds?

solar whale
#

only an issu for hum between 74 and 86

#

yes

#

you don't have a delay there

haughty bobcat
#

for some reason the code takes over the serial

solar whale
#

what do you mean?

haughty bobcat
#

nevermind...

#

I just thought it normally goes into "Press any key to enter repl" by default because I've never used Ctrl C to get into it.

solar whale
#

try toggling the D13 LED in the loop just to see if the code is running.

#
    humidity = dht.humidity
    if (humidity > 86):
        dot[0] = (0, 255, 0)
        ir_send.send(trig_command)
        time.sleep(120)
    if (humidity < 74):
        dot[0] = (255, 0, 0)
        ir_send.send(trig_command)
        time.sleep(120)
    if 74 <= humidity <= 86:
        dot[0] = (0, 0, 255)
    led.value = !led.value 
    time.sleep(2)  # debounce delay
haughty bobcat
#

ok

#

says it's invalid syntax

solar whale
#

oops -- just a sec

haughty bobcat
#

led.value = True

#

I tried that

#

It worked on an earlier revision of this code but not anymore

#

actually, everything is good

solar whale
#

??

haughty bobcat
#

Ok so here's where I am:
Red LED turns on during the loop. Loop runs when MU is open, once MU is closed and the Trinket is restarted the loop is not running, the LED is not on.

solar whale
#

led.value = not led.value

haughty bobcat
#

I used led.value = True

solar whale
#

led.value = not led.value will make it blink

haughty bobcat
#

ok

#

Just saved and it's blinking

#

The code is running fine

#

As soon as I close MU and restart the code will not run.

#

I'm getting the feeling this is a bug.

solar whale
#

try this in repl and post the results -- want to see what is on the board. ```import os
os.listdir()

haughty bobcat
#

['.fseventsd', '.metadata_never_index', '.Trashes', 'boot_out.txt', 'System Volume Information', 'lib', 'main.py', 'README.txt']

solar whale
#

ok - thanks

raven canopy
#

can you open a file explorer, copy the main.py to your PC, and verify that your changes are being saved to the file? i vaguely remember an issue with Mu that it wasn't saving correctly...

haughty bobcat
#

saved fine

raven canopy
#

k

haughty bobcat
#

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

This is interesting

#

Why is my py file giving output if there's nothing to output?

#

Pay no attention to the main.py code.py transition. I was just trying it.

raven canopy
#

that's standard behavior on a reload. its just letting you know that anything after that message is from the program.

tidal kiln
#

but why code.py?

solar whale
#

hmmm - good question

raven canopy
#

i read the message to mean they changed the filename: Pay no attention to the main.py code.py transition. I was just trying it.

haughty bobcat
#

Because I switched it

tidal kiln
#

ok

#

try very basic blink and see if you get same behavior

#
import time
import board
from digitalio import DigitalInOut, Direction

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT

while True:
    led.value = False
    time.sleep(0.5)
    led.value = True
    time.sleep(0.5)
haughty bobcat
#

this one runs fine when mu is closed

tidal kiln
#

As soon as I close MU and restart the code will not run
restart = what here?

haughty bobcat
#

also runs fine from a power brick

#

nice and green dotstar led

#

Pressing the button

tidal kiln
#

reset button on trinket?

haughty bobcat
#

yes

tidal kiln
#

and "will not run" = the led isn't blinking?

haughty bobcat
#

The code is not running properly and the dotstar is giving a series of blinks.

haughty bobcat
#

I've seen that

#

To be entirely honest I can't tell what color is being blinked.

solar whale
#

I get it to fail -- Dotstar is flashing a code

haughty bobcat
#

The blue part of the dotstar is on the entire time while the other part of the dotstar is blinking

#

So it's hard to tell

#

Just updated to the circuitpython 4.0 alpha

#

same behavior

tidal kiln
#

@solar whale did you set up hardware, dht, switch, etc?

solar whale
#

I have DHT -- no switch

haughty bobcat
#

the switch isn't used in my latest code

tidal kiln
#

looks like it's not being used anyway

solar whale
#

long yellw -- 2 short yellows -- 4 blues

haughty bobcat
#

I'm using a non adafruit DHT with a built in resistor. It also has 3 instead of 4 pins.

#

It's always worked with adafruit code though

tidal kiln
#

and it is now, right? the issue is just the odd behavior of it only running with MU/REPL?

haughty bobcat
#

yes

solar whale
#

for me it fails if I RESET the board w/o screen connected -- I am not using mu

#

it works if I open screen - control C - ControlD

haughty bobcat
#

That's what I'm getting

#

It seems I've made magic code that causes Circuit Python to malfunction.

tidal kiln
#

@solar whale can you post full code you're testing. i'm setup with DHT now also.

solar whale
#

just a sec -- founds a typo

#

nvmd -- It works for me now - will ost code.

#

bink test ```
import time
import board
from digitalio import DigitalInOut, Direction, Pull

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
while True:
led.value = not led.value
time.sleep(2) # debounce delay

#

full code ```

import time
import board
import pulseio
import array
import adafruit_dht
import adafruit_dotstar as dotstar
from digitalio import DigitalInOut, Direction, Pull

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
ir_led = pulseio.PWMOut(board.D0, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
switch = DigitalInOut(board.D2)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
dht = adafruit_dht.DHT22(board.D1)
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.3)

#trig_command = array.array('H', [9027, 4457, 594, 585, 576, 578, 573, 582, 568, 585, 576, 578, 573, 581, 569, 585, 576, 578, 572, 1654, 573, 1653, 575, 1652, 575, 1653, 575, 1652, 575, 1653, 575, 579, 571, 1630, 598, 1629, 598, 583, 578, 576, 574, 580, 571, 583, 578, 576, 574, 580, 570, 584, 577, 577, 573, 1654, 574, 1653, 575, 1652, 575, 1652, 575, 1652, 576, 1651, 576, 1652, 575, 40320, 9038, 2200, 603])
trig_command = array.array('H', [902])
dot[0] = (0, 0, 255)
while True:
humidity = dht.humidity
if (humidity > 86):
dot[0] = (0, 255, 0)
ir_send.send(trig_command)
time.sleep(120)
if (humidity < 74):
dot[0] = (255, 0, 0)
ir_send.send(trig_command)
time.sleep(120)
if 74 <= humidity <= 86:
dot[0] = (0, 0, 255)
led.value = not led.value
time.sleep(2) # debounce delay

#

both work at RESET

#

will try with mu

haughty bobcat
#

this makes no sense...

#

there must be a problem with one of the libraries or something

solar whale
#

interesting -- it does fail after quitting mu

haughty bobcat
#

The ir code came from one of Tony Ds streams where he showed how to duplicate IR remotes.

#

via repl

raven canopy
haughty bobcat
#
  File "adafruit_dht.py", line 180, in measure
RuntimeError: A full buffer was not returned.  Try again.```
#

thats new

#

just a one off error it seems, didn't repeat

solar whale
#

nothin odd in log

tidal kiln
#

there are 2 minute sleeps when an IR code is sent

haughty bobcat
#

that is on purpose

#

when the humidity is too high, an IR code is sent to have the humidifier turned off.

#

the IR switch I'm using is just toggled. So same IR code is used for On and off

solar whale
#

hmm simple blink test now works -- but not full code

tidal kiln
#

@solar whale make sure you're not just sitting at one of the 2 minute sleeps

solar whale
#

no -- the dotstar is flashing an error code

haughty bobcat
#

the dotstar will go green or red during a sleep

#

thats how I programed it

solar whale
#

when I copy the full code to the board as code.py -- it starts OK -- solid red Dotstar --- but when I reset the board I get teh falshing error code.

raven canopy
#

@haughty bobcat that error may be occuring when there is no serial connection. maybe try and isolate it:

while True:
    try:
        humidity = dht.humidity
    except RuntimeError:
        led.value = True # indicate we've failed
        time.sleep(2) # wait 2 seconds before another read
        continue # return to the top of the while loop
    led.value = False # all good, turn D13 off
haughty bobcat
#

do I add that on top of my if statements?

raven canopy
#

yeah.

tidal kiln
#

long YELLOW, 2 x short YELLOW, 6 x short BLUE

#

^^ i'm getting that

solar whale
#

@raven canopy good idea, but it did not help -- @tidal kiln I htink I now get 8 blues

tidal kiln
#

same behavior with mu and screen - works with serial connected

haughty bobcat
#

I'm getting a red d13 LED after adding @raven canopy 's code

raven canopy
#

forgot to mention, remove any other LED D13 code...just to make sure.

haughty bobcat
#

ok yeah no D13 led at all

solar whale
#

ah --- just a sec -- found something

raven canopy
#

hmmm...it may be JLink time. errr...maybe not?

solar whale
#

IF I am in the REPL and run do ControlD the code runs fine -- When I hit controlC ot goes tot he Press any Key to enter REPL and blinks the same pattern

#

sorry not same pattern

#

ugh

haughty bobcat
#

I can't even tell the pattern

solar whale
#

now I just get 4 yellows

#

but it also happens at control C .

haughty bobcat
#

Maybe Iโ€™ll just give up on this

#

No solution in sight

raven canopy
#

well, according to the error blinks, line 24 or 28 point to ir.send. YELLOW = Other Error doesn't help much though...

haughty bobcat
#

I always use the serial console to see errors because looking at a series of blinks is an awful way to troubleshoot. Only problem is the code works fine when connected to a serial console!

#

Iโ€™m going to put this project in a drawer for now.

umbral dagger
#

@haughty bobcat Fails on battery but works on USB? Is your battery charged/full?

solar whale
#

hmm - try adding a few second delay at the start -- firs executalbe line time.sleep(5}

haughty bobcat
#

Trinket M0 only has usb port

#

no battery

solar whale
#

now it works for me -- added delay after all the imports

#

maybe pulseio needs some time before starting up ...

haughty bobcat
#

YES

#

It's working

solar whale
#

working code ```
import time
import board
import pulseio
import array
import adafruit_dht
import adafruit_dotstar as dotstar
from digitalio import DigitalInOut, Direction, Pull
time.sleep(5)
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
ir_led = pulseio.PWMOut(board.D0, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
switch = DigitalInOut(board.D2)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
dht = adafruit_dht.DHT22(board.D1)
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.3)

trig_command = array.array('H', [9027, 4457, 594, 585, 576, 578, 573, 582, 568, 585, 576, 578, 573, 581, 569, 585, 576, 578, 572, 1654, 573, 1653, 575, 1652, 575, 1653, 575, 1652, 575, 1653, 575, 579, 571, 1630, 598, 1629, 598, 583, 578, 576, 574, 580, 571, 583, 578, 576, 574, 580, 570, 584, 577, 577, 573, 1654, 574, 1653, 575, 1652, 575, 1652, 575, 1652, 576, 1651, 576, 1652, 575, 40320, 9038, 2200, 603])
dot[0] = (0, 0, 255)
while True:
try:
humidity = dht.humidity
if (humidity > 86):
dot[0] = (0, 255, 0)
ir_send.send(trig_command)
time.sleep(120)
if (humidity < 74):
dot[0] = (255, 0, 0)
ir_send.send(trig_command)
time.sleep(120)
if 74 <= humidity <= 86:
dot[0] = (0, 0, 255)
led.value = not led.value
time.sleep(2) # debounce delay
except RuntimeError:
led.value = True # indicate we've failed
time.sleep(2) # wait 2 seconds before another read
continue # return to the top of the while loop

#

@raven canopy @tidal kiln could it just be taht a delay is needed after reset for pulseio -- or sometthing else

haughty bobcat
#

still doesn't explain why MU affects it

solar whale
#

does mu still cause problems?

haughty bobcat
#

No

#

It works fine with the delay after imports

raven canopy
#

@solar whale it shouldn't need any delay. there are blocking while loops while the required clocks sync... i'm pretty sure. checking

solar whale
#

mu was never the problem -- just caugt in the crossfire

raven canopy
solar whale
#

@raven canopy agreed - delay should not be needed, but it works ๐Ÿ˜‰

raven canopy
#

haha. if it works..it works. ๐Ÿ˜„

indigo wedge
#

D'oh, if you're gonna use GPIO 9 and 10 on your nRF board, make sure to define CONFIG_NFCT_PINS_AS_GPIOS or you'll have a bad time ๐Ÿ˜‰

raven canopy
#

๐Ÿ‘‹ @indigo wedge.

indigo wedge
#

hey @raven canopy, what's up

tidal kiln
#

i've gotten it down to these two that go from working to not working.
working = works through REPL (screen) and with reset after disconnecting REPL
not working = works through REPL, but not after disconnecting and resetting

#

working:

import time
import board
import pulseio
import array
import adafruit_dht
import adafruit_dotstar as dotstar
from digitalio import DigitalInOut, Direction, Pull
 
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
ir_led = pulseio.PWMOut(board.D0, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
switch = DigitalInOut(board.D2)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
dht = adafruit_dht.DHT22(board.D1)
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.3)

#trig_command = array.array('H', [9027, 4457, 594, 585, 576, 578, 573, 582, 568, 585, 576, 578, 573, 581, 569, 585, 576, 578, 572, 1654, 573, 1653, 575, 1652, 575, 1653, 575, 1652, 575, 1653, 575, 579, 571, 1630, 598, 1629, 598, 583, 578, 576, 574, 580, 571, 583, 578, 576, 574, 580, 570, 584, 577, 577, 573, 1654, 574, 1653, 575, 1652, 575, 1652, 575, 1652, 576, 1651, 576, 1652, 575, 40320, 9038, 2200, 603])
trig_command = array.array('H', [902])
dot[0] = (255, 255, 255)
while True:
    humidity = dht.humidity
    led.value = not led.value
    time.sleep(2)  # debounce delay
solar whale
#

@tidal kiln with teh delay it works now

tidal kiln
#

not working:

import time
import board
import pulseio
import array
import adafruit_dht
import adafruit_dotstar as dotstar
from digitalio import DigitalInOut, Direction, Pull
 
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
ir_led = pulseio.PWMOut(board.D0, frequency=38000, duty_cycle=2**15)
ir_send = pulseio.PulseOut(ir_led)
switch = DigitalInOut(board.D2)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
dht = adafruit_dht.DHT22(board.D1)
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.3)

#trig_command = array.array('H', [9027, 4457, 594, 585, 576, 578, 573, 582, 568, 585, 576, 578, 573, 581, 569, 585, 576, 578, 572, 1654, 573, 1653, 575, 1652, 575, 1653, 575, 1652, 575, 1653, 575, 579, 571, 1630, 598, 1629, 598, 583, 578, 576, 574, 580, 571, 583, 578, 576, 574, 580, 570, 584, 577, 577, 573, 1654, 574, 1653, 575, 1652, 575, 1652, 575, 1652, 576, 1651, 576, 1652, 575, 40320, 9038, 2200, 603])
trig_command = array.array('H', [902])
dot[0] = (255, 255, 255)
while True:
    humidity = dht.humidity
    if (humidity > 86):
        dot[0] = (0, 255, 0)
    if (humidity < 74):
        dot[0] = (255, 0, 0)
    if 74 <= humidity <= 86:
        dot[0] = (0, 0, 255)
    led.value = not led.value
    time.sleep(2)  # debounce delay
raven canopy
#

@indigo wedge nada. just dev_tool working. taking a break from the C side beating me up. python is much more forgiving. ๐Ÿ˜„

solar whale
#

delay after imports

indigo wedge
#

true that, writing drivers in CP is a breeze

tidal kiln
#

ok, delay after import fixes above also

solar whale
#

no idea why

tidal kiln
#

i think that smells buggy enough to escalate

solar whale
#

as @raven canopy noted dht should always catch and handle error returns -- they do happen

tidal kiln
#

yep - that's definitely good practice. but i think something else is happening for this issue.

solar whale
#

@tidal kiln -- agreed -- d o you want me to create an issue --- probably should isolate it a bit more first

#

I can actually hook up an IR LED and test it -- I have to go out for a few hours but can work on it later or tomorrow. Feel free to open issue if you want to -- I can just add to it if I have more later.

#

@haughty bobcat what does that IR LED command do?

tidal kiln
#

@solar whale you can use my code above - it creates the issue without even using the IR led

#

and adding delay fixes it also

solar whale
#

OK -- I do wonder if it is related to setting up pulseio

tidal kiln
#

@solar whale if you can create the issue that'd be great. agree needs more testing / isolating. could maybe also bring it up in monday meeting weeds

solar whale
#

OK -- I'll create it when I get back -- Have to run now -- dog is pacing....

#

๐Ÿ‘‹

idle owl
manic glacierBOT
lone sandalBOT
lone sandalBOT
#

We're on it

On Sat, Oct 13, 2018, 2:07 PM ladyada notifications@github.com wrote:

@ladyada https://github.com/ladyada requested your review on: #4
https://github.com/adafruit/awesome-circuitpython/pull/4 Update
outdated coming soon items.

โ€”
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/awesome-circuitpython/pull/4#event-1902270795,
or mute the thread
<https://github.com/notifi...

manic glacierBOT
#

Thanks, yes. One thing I neglected to mention is that we already know Nordic recommends that some pins be used only at low-speed (< 10kHz) with standard drive fo RFI reasons. The '832 data sheet is clearer on this than the '840 one:

Radio performance parameters, such as sensitivity, may be affected by high frequency digital I/O with large sink/source current close to the Radio power supply and antenna pins.

Table 23: GPIO recommended usage on page 109 identifies some GPIO...
solar whale
#

@tidal kiln @raven canopy weird -- it is the if that causes the reset failure

#
import board
import adafruit_dht
dht = adafruit_dht.DHT22(board.D1)
while True:
    humidity = dht.humidity
    if humidity > 50. :
        pass
    time.sleep(2)  # delay
#

this fails

#

runs uder REPL or after first load, but fails on reset !!

raven canopy
#

hmm...

solar whale
#

doh! this fixes it ```import time
import board
import adafruit_dht
dht = adafruit_dht.DHT22(board.D1)
while True:
humidity = dht.humidity
if humidity != None and humidity > 50. :
pass
time.sleep(2) # delay

#

pre read or a faield dht read sets it to None -- cant check None against < .....

#

yup taht fixes the full code too. HAve to make sure DHT is not None before using it.

#

@tidal kiln @raven canopy found the root cause -- it is sort of delay related -- see https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/adafruit_dht.py#L141 if the reading is done before time.monotonic() is > .5 it will return None as the measured value -- no error -- so for DHT need to delay >.5 after boot before first reading OR check result for being None

#

I'll create an issue for DHT

raven canopy
#

yeah, i was [disctractedly] reading why we're returning None. that needs to change, since the user is going to expect a number..

#

LSU footbal disctracts me ๐Ÿˆ ๐Ÿ˜„

solar whale
#

THere is a reason for None -- lets you know there is no valid reading.

raven canopy
#

Right...but that isn't documented. Although, the documentation also doesn't say "will always return integer". ๐Ÿ˜‰

#

what about setting the inital value to -1? allows boolean check as well as < 0.

solar whale
#

I think we can just have it wait unti time.monotonioc() is > .5

#

-1 is OK for humidity, but not for temperature

raven canopy
#

good point.

tidal kiln
#

that looks like it's trying to rate limit the reads

#

so wouldn't the same thing happen if you tried to read too fast

solar whale
#

it is. kind of a kludge

#

no - reading to fast gives last value

raven canopy
#

what about:

if (time.monotonic()-self._last_called > delay_between_readings or
    self._humidity == None):
solar whale
#

why not just wait fot time.monotonic() > .5

tidal kiln
#

oh i see, this just initiates the measurement and set the class member

#

it doesn't actually return it

solar whale
#

right

tidal kiln
#

and they're init'd to None in constructor

solar whale
#

yes

tidal kiln
#

๐Ÿค”

solar whale
#

so it will always do a read if time.monotonic() > .5

#

or return last value

#

or throwan error if no valid readings

tidal kiln
#

for the problem before, it was like a first run issue

#

that got called early, before enough time had passed, so didn't even do the read

#

so they stayed None

solar whale
#

right -- so the if humidiy > somting failed

tidal kiln
#

so what was actually bombing code wise?

#

trying to use None in the if's ?

solar whale
#

right -- a vule can't be compared to None

raven canopy
#

the if statement eval'd to this if None > 50.

tidal kiln
#

back in code.py

solar whale
#

I first fixed it by just if humidity != None and humidity > 50. :

#

taht is OK

#

but hard to explain for the API

#

could throw a RunTIme Error if time.monotiic() <.5 - DHT users have to get used to Runtime Errors....

#

or maybe initialize _last_called to -1 ??

tidal kiln
#

cool. knowing that. can recreate issue with just this simple example:

import board
import adafruit_dht

dht = adafruit_dht.DHT22(board.D1)

if dht.humidity > 80:
    print(":(")
else:
    print(":)")
#

@solar whale isse for DHT = yep, i agree. the above code should be allowed to work as expected or fail gracefully or something. not bomb.

#

we shouldn't have to task the users with checking/protecting for a None type

solar whale
#

I am thinking that initting self._last_called = -1 will fix it -- I'll try it later

tidal kiln
#

probably various ways it could be "fixed". can have that discussion in the issue thread.

solar whale
#

yup -- I started it

#

I recall much discurrion about the use of None in general ....

tidal kiln
#

@raven canopy awesome sleuthing

raven canopy
#

that was @solar whale's sleuthing

tidal kiln
#

ah. thought he said you found it.

solar whale
#

group sleuthing

tidal kiln
#

woot! good job all.

errant grail
#

I'd be concerned that an if humid<80 statement would return an invalid test. I'd prefer None.

solar whale
#

@errant grail right -- just if the variable humid is a None you can't do a <

#

so have to test for None first

raven canopy
#

@errant grail guess you don't enjoy visiting the Southeastern US? โ˜€+๐Ÿ’ง

errant grail
#

None is such a groovy and valid Python value...

#

Ha! I live in the desert of WA state.

solar whale
#

The sesnor on my deck has been > 100 a lot thsi summer -- In New Hampshire!!

errant grail
#

-1% is a not so groovy but valid value in the summer.

#

๐Ÿ˜‰

solar whale
#

at least it makes ESD much less of a problem....

tidal kiln
#

good arguments for None. but i can also see the CP target audience wanting to be able to just run that simple code above. trade offs. keeping it simple without exposing too much complexity.

errant grail
#

None is essential for ToF sensors, too.

#

An alternative would be to wait during instantiation, I guess.

solar whale
#

agreed - but DHT users have to expect bad readings - they are a fact of life. Ususally it throws a Runtime error -- but in the case of reading too fast, it just retursn the last value read. Maybei it should not do that.

#

I think the reason it was don was so you could read temperature then humidiyt right away. Either one will initiate new reading of both if enought time has passed

errant grail
#

Or return a tuple, some value and a "reliability" value that includes None that could be ignored if you don't care.

solar whale
#

Please comment in the issue -- I htink this will need some discussion ....

tidal kiln
#

maybe measure could return a bool to indicate a good measurement took place.

solar whale
#

good time to rethink the DHT API ...

tidal kiln
#

but as you said, probably best to move discussion to issue thread.

errant grail
#

... and it's a general case for many sensors and transactional I/O.

tidal kiln
#

gotta run. thanks again for figuring it out!

raven canopy
#

DHT/AMxxx...always such fun. ๐Ÿ˜„

errant grail
#

yeah, great troubleshooting!

solar whale
#

Thanls -- It was a good puzzle .... I have to run as well -- later all

sudden coral
#

Okee doke, I'm working on a (hopefully) contribution to CircuitPython that's requiring me to revive some mostly-abandoned-in-CPY MicroPython module code (read: uzlib). My C is very rusty (I write Python and JavaScript and devops infrastructure for a living...), so I'm getting stuck on some weird warnings and errors compiling MicroPython's uzlib for samd51. Any C geniuses in the house today?

../../extmod/moduzlib.c: In function 'read_src_stream':
../../extmod/moduzlib.c:57:31: error: cast increases required alignment of target type [-Werror=cast-align]
     mp_obj_decompio_t *self = (mp_obj_decompio_t*)p;

Okay, cool, I can just force the definition of mp_obj_decompio_t to pack (according to StackOverflow, at least)... except that opens a whole new can of worms:

typedef struct __attribute__ ((packed, aligned(8))) {
    mp_obj_base_t base;
    mp_obj_t src_stream;
    TINF_DATA decomp;
    bool eof;
} mp_obj_decompio_t;
../../extmod/moduzlib.c:48:19: error: packed attribute causes inefficient alignment for 'base' [-Werror=attributes]
     mp_obj_base_t base;
# ( more of that error for all the props of the struct )
../../extmod/moduzlib.c: In function 'read_src_stream':
../../extmod/moduzlib.c:57:31: error: cast increases required alignment of target type [-Werror=cast-align]
     mp_obj_decompio_t *self = (mp_obj_decompio_t*)p;
#

I somehow very much doubt it matters, but gcc version 8.2.1 20180831

manic glacierBOT
#

@uhrheber Lovely, thanks for sharing!

Try to cache the ptr32(0x50000508) calls (save them to a local variable), it can offer a nice performance gain. I'd also try to do it with the uint(0x80000000) constant.

You can probably try a similar optimization for the assembly loop - instead of loading the addresses into r1 every time, you can preload them to r0 and r1 and then just keep the str instructions inside the loop (you can also use a single base address and then just chan...

sudden coral
#

Fixed my above issues with #pragma GCC diagnostic ignored "-Wcast-align", which I don't feel too bad about because I see it elsewhere in the atmel-samd port tree ๐Ÿ˜ƒ

#
>>> uzlib.decompress(b'x\x9c\xcbH\xcd\xc9\xc9\x07\x00\x06,\x02\x15')
bytearray(b'hello')

sweeeeeet

manic glacierBOT
solar atlas
#

Has it been worked out so that you can load CP from a android phone?

#

Over a micro USB to micro USB adapter. Wondering if I can use my phone to change my Hallowing while I'm on the go?

haughty bobcat
#

@solar atlas pretty sure you can

#

Itโ€™s just a flash drive

solar atlas
#

Cool. But can u tell me how @haughty bobcat?

haughty bobcat
#

In a few minutes

#

@solar atlas Just see if you can locate a Python environment for convincience, if you canโ€™t find that use a simple text editor. Just load data off the Hallowing like a flash drive.

#

Maybe this?

#

I canโ€™t guarantee itโ€™ll work so do some research

sudden coral
#

It's worth ensuring your Android phone actually supports MSC flash drives. Not all do, usually due to bizarre kernel configs.

#

if the microusb to microusb adapter itself doesn't do the trick, you may need to do a bizarre hackaround with a MicroUSB to USB-A OTG adapter, then use a USB-A to MicroUSB cable to the CircuitPy device. Sounds crazy but OTG stuff is really finnicky and the adapters are even moreso.

haughty bobcat
#

Iโ€™ll check droidedit on my Fire tablet

solar atlas
#

Sweet! Thanks @haughty bobcat

haughty bobcat
#

Not looking good

manic glacierBOT
raven canopy
#

thanks for the review @tidal kiln! going through and responding to some of your suggestions now. will work the others tomorrow. ๐Ÿ˜‰

#

interesting note: github gives me "Add single comment" and "Start a review" options. ๐Ÿ˜†

upbeat plover
#

any plans for other format other then bitmaps for displayio? i was wanting to layer transparent images.

manic glacierBOT
#

I'm thinking of forking https://github.com/NordicSemiconductor/nrfx. (Actually I did already: https://github.com/adafruit/nrfx, but it's not used yet).

The motivation is to add/vary some functionality. First issue up is https://github.com/NordicSemiconductor/nrfx/issues/43. I'd track upstream very closely.

We did sort of the same thing with ASF3 and ASF4, to fix bugs, and with ASF4, to actually have the code in a repo instead of just from Atmel START.

This is related to #1266, which ...

raven canopy
#

@tidal kiln you got time to discuss FRAM review? was about to discuss in the review, but you're green. also fine with discussing in the review anyway..

tidal kiln
#

@raven canopy sure.

raven canopy
#

k.

#

for the __setitem__ (https://github.com/adafruit/Adafruit_CircuitPython_FRAM/pull/1#discussion_r224976638) suggestions, there are a couple things that i think will need to happen.

  1. i'll need to combine _write_single and _write_page; no way to have both of them pointed as __setitem__.

  2. i'll have to move _write_page(wraparound) to its own property, right?

  3. wouldn't it be best to also change the read() functions to __getitem__ so that behavior is standard? if so, this forces a drop in the length argument; can we handle slices in CircuitPython's __getitem__ (i just haven't tried yet)?

tidal kiln
#
  1. think of those as private helper funcs that you can do whatever you want with, whatever makes things easy for you internally. then call them as you need from __setitem__.
  2. seems like a good idea, have wraparound be a property vs. a parameter passed to the func. - is that what you're saying?
  3. totally...i thought i commented on that..weird...not seeing it? but, yes use __getitem__, so you can do like this: print(fram[0])
#

and further on 1..... have you ever used __setitem__ before?

raven canopy
#

__setitems_, yes i've used it some. it kind of just clicked that i'm sure you can add arguments to it...

tidal kiln
#

not really. it's a very simple mechanism.

#

foo[key] = value

#

that simply calls __setitem__ and passes in key and value

#

up to you to use key and value correctly

raven canopy
#

yeah...it was a gaslighted thought. the simplicity is what triggered the initial thoughts on wraparound. ๐Ÿ˜„

#

moar โ˜• required.

tidal kiln
#
>>> class Foo():
...     def __setitem__(self, key, val):
...         print(type(key))
...         print(type(val))
... 
>>> f = Foo()
>>> f[23] = 42
<class 'int'>
<class 'int'>
>>> f[23:42] = "hello world"
<class 'slice'>
<class 'str'>
>>> f[23:42] = [1,2,3]
<class 'slice'>
<class 'list'>
>>> 
#

it's very general purpose

#

so, for example, to have it do what write and write_sequence do, you'll want to add conditionals to check the type of key

raven canopy
#

on 1, i have already juggled the thought of combining them. I2C sequential write didn't work out how I wanted due to I2CDevice limitations. having a write_single really just drops the requirement of passing in an iterable argument.

tidal kiln
#

int implies a single write, slice implies a write_sequence

#

oops. edited ^^

raven canopy
#

k. i'm following on that.

tidal kiln
#

but you'd do something similar in __getitem__ possibly

raven canopy
#

yeah, was thinking that too. isinstance is my friend. ๐Ÿ˜„

tidal kiln
#

weird. where's that comment in the review? must've nav'd away and not hit the submit button.

raven canopy
#

that's happened to me a few times...

tidal kiln
#

i remember writing this code block to demonstrate:

value = fram[0]
values = fram[23:42]
#

__getitem__ is similarly very general purpose:

>>> class Foo():
...     def __getitem__(self, key):
...         print(type(key))
... 
>>> f = Foo()
>>> f[23]
<class 'int'>
>>> f[23:42]
<class 'slice'>
>>> 
solar whale
#

@tidal kiln found a simple fix for the DHT -- jus check if seff._last_called ==0 - if it is then we know no reading have ever been done and we should do one regardlesss of time.monotonic() - this eliminates any chance of a None without a Runtime Error. Testing now -- seems to work.

#

I think I'll just submit a PR and we can discuss if that is the way to go. -- unless you want me to hold off until after tomorrows meeing.

tidal kiln
#

@solar whale up to you - i've got a note to bring this up in the weeds during meeting. but in a more general way. basically - what should we do for sensor bad readings? None? Exception? -1? depends? etc...

solar whale
#

Agreed - we should have a general discussion about None -- this fixes a particular issue with the DHT that was not handled properly.

tidal kiln
#

line 41 or 141?

solar whale
#

oops -- 141

#
diff --git a/adafruit_dht.py b/adafruit_dht.py
index e7e8595..e7759a3 100644
--- a/adafruit_dht.py
+++ b/adafruit_dht.py
@@ -138,7 +138,7 @@ class DHTBase:
         delay_between_readings = 0.5
         if self._dht11:
             delay_between_readings = 1.0
-        if time.monotonic()-self._last_called > delay_between_readings:
+        if (self._last_called == 0) or (time.monotonic()-self._last_called > delay_between_readings):
             self._last_called = time.monotonic()
 
             pulses = self._get_pulses()
tidal kiln
#

and then temp/humid would either get set to something or an exception would be thrown, right?

solar whale
#

right

#

It should never have failed "silently"

tidal kiln
#

yah, seems like an easy fix

solar whale
#

I think so -- PR going in- folks can comment to it.

tidal kiln
#

if (self._last_called < delay_between_readings) or (time.monotonic()-self._last_called > delay_between_readings):

#

?

solar whale
#

could be - but 0 is a special case at init.

tidal kiln
#

yah. just thinking. but nvm. should discuss over in thread...

solar whale
#

It can never be < delay_between_settings and not == 0

#

said that wrong == I think we only need to force it if it is ==0 -- any other value means a reading has been made

#

grrr - line 141 is now 1 byte too long! travis not happy

raven canopy
#

@tidal kiln for __getitem__/__setitem__, should i worry about handling slice.step? have it working for now, just not sure it's worth extending.

>>> fram[0:4:2]
registers: [0, 2]
reading register: 0
reading register: 2
bytearray(b'\x14\x1e')
>>> fram[0:4:1]
registers: [0, 1, 2, 3]
reading register: 0
reading register: 1
reading register: 2
reading register: 3
bytearray(b'\x14\x1e\x1el')
prime tree
#

hey all, we were ateempting to do this project https://learn.adafruit.com/perk-up-ears/code and when we had it all set up and the latest libraries included we're getting that simpleio doesn't have the attribute Servo. Was this removed? we looked at the code and it doesn't appear that simpleio has this attribute anymore, so if it has been removed, what's the expected way to control analog servos?

Servo actuated ears that perk up when there's a loud noise.

raven canopy
lone sandalBOT
tidal kiln
#

@raven canopy if you've got it working, i guess leave it in

prime tree
#

thanks for pointing us to that, now have it working with adafruit_motor.servo

umbral dagger
#

@prime tree Sorry... I didn't see this until now.

#

Glad you got it working!

#

@raven canopy I'll get the guide updated asap.

lone sandalBOT
manic glacierBOT
modest atlas
#

I pip Installed adafruit-ampy and was as successful but still cant use the ampy --help command

#

Very new to cmd lines

raven canopy
#

@tidal kiln yeah, might as well, right? ๐Ÿ˜œ
@umbral dagger thanks!

umbral dagger
#

@raven canopy PR includes the head-tilt-ears code as well. Same thing.

raven canopy
#

nice catch. i completely forgot about the tilt ears guide.

dusty plinth
#

can anyone help me with Circuit Playground Express? I can't get the CIRCUITPY drive to show up. I can with Gemma and Hallowing

umbral dagger
#

@dusty plinth My first question is whether it has CircuitPytion on it.

dusty plinth
#

I just got done with reinstalling the drivers and wiping and reinstalling Circuit Python on the CPX and still can only get the CPLAYBOOT

umbral dagger
#

You're on windows as I recall?

dusty plinth
#

Win7 64

umbral dagger
#

(since you had to install drivers, I guess yes)

#

That's an extra wrinkle I'm afraid I can't help with.

dusty plinth
#

and the Gemma and Hallowing don't give me this problem

umbral dagger
#

That strikes me as odd

dusty plinth
#

starting to wonder if there's a single bit error somewhere in hardware that only affects Python

umbral dagger
#

Hmm.. The gema has an E18, but the HalloWing has the G18 which is the same as the CPX.. so that rules out chip difference

#

The HalloWing is working fine?

dusty plinth
#

as faras Ican tell. it does give me CIRCUITPY. I just haven't loaded any .py scripts on it yet.

#

I could probably adapt the script I want to the Gemma but I want to use the CPX

raven canopy
#

any associated yellow triangles in Device Manager?

dusty plinth
#

no

#

I do get sound telling me something connected

#

and I do see a disk drive show up in device manager

raven canopy
#

but it doesn't show up in File Explorer?

dusty plinth
#

no

raven canopy
#

that is odd. I don't have a Win7 machine anymore, so i can't replicate. I don't see any open issues on the driver repo. let me check a couple other places. it may be best to put the issue up on the forum...

dusty plinth
#

I could try on another but have to install everything (drivers, Mu, etc) first. that one will also be 32bit

dusty plinth
sudden coral
#

Is the unix port supposed to be supported at all? I'm hacking on a C module and figured I'd give the unix port a whirl rather than constantly flashing my M4 Express, but alas,

(gravity) unix  ยป topic-zipped-modules * ยป make
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
In file included from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:37:
../../lib/axtls/ssl/tls1.h:43:10: fatal error: version.h: No such file or directory
 #include "version.h"
          ^~~~~~~~~~~
compilation terminated.
make: *** [../../py/mkrules.mk:82: build/genhdr/qstr.i.last] Error 123
make: *** Deleting file 'build/genhdr/qstr.i.last'

maybe this is a @tulip sleet / @slender iron question?

marble hornet
#

i'm curious about the cp epaper driver, can I ask some lut question? ("will you lut me ask the questions ? ๐Ÿ˜‰")

slender iron
#

@sudden coral I never run it directly but travis runs tests on it

#

I think you need to build axtls first, check the travis config

#

@upbeat plover I can help with displayio. you can pick a color to make transparent in the bitmap

marble hornet
#

i see that there are ww,bw,wb, and bb luts but no nuts for red or anything else. i'm curious how one would adjust these luts and red luts

dusty plinth
#

Trying the above morse script on Gemma instead, I am getting blinks but not in the morse pattern of the message I entered in place of "SOS". Instead, I'm getting 1, 2 and 3 'dot' blinks in 3 different colors. Between this .py script and the MakeCode, I'm getting disappointed with the quality of published scripts. I'll have to look through it to see if I can figure out why it's not working (still getting used to object oriented programming)

#

(also reduced the pixel string length from 10 for the CPX to 1 for Gemma)

tulip sleet
#

@dusty plinth re your CPX CIRCUITPY problem. Two questions: 1. do you have Arduino installed, including the M0 board support packages. 2. Can you connect to the REPL on the CPX using Mu or Putty or Tera Term? If so, we can try to reset the filesystem.

dusty plinth
#

I already reset that earlier today

#

yes, Arduino is installed but I haven't written any sketches to these 3 devices

#

took me a while trying before I got a prompt in REPL

tulip sleet
#

so you did import storage; storage.erase_filesystem() in the REPL?

#

what version of CircuitPython is on the CPX, compared with the other boards? Are you using Kaspersky anti-virus?

dusty plinth
#

yes

#

I downloaded the latest CP v3 for all 3

tulip sleet
#

make sure the circuit_playground_express version is the .uf2 that's loaded on that board

#

you can tell from the initial prompt in the repl (type ctrl-D to soft-restart if necessary)

#

and just to double-check, are you using Kasperksy?

dusty plinth
#

says v3.0.3

tulip sleet
#

yes, but the board name is also in that prompt, just check that

dusty plinth
#

no, Comodo

#

stupid thing won't copy to clipboard. ๐Ÿ˜›

tulip sleet
#

you maybe can right-click and choose Copy

#

what terminal program are you using?

dusty plinth
#

Adafruit CircuitPlayground Express sith samd21g18

#

using Mu

#

Adafruit CircuitPython 3.0.3 on 2018-10-10; Adafruit CircuitPlayground Express with samd21g18

tulip sleet
#

ok, that's fine. So you say a disk drive appears in Device Manager but CIRCUITPY (D:) or whatever does not appear in Explorer. Could you try disabling Comodo temporarily and press reset and see if it appears?

dusty plinth
#

AV disabled, reset CPX, still no CIRCUITPY

#

and as someone stated earlier, that shouldn't affect just one of 3 very close boards anyway

tulip sleet
#

no, it shouldn't, but if for some reason the AV marked it as, say, suspicious for some reason, -maybe- it as supressing it

#

the board has a unique id which is passed to the host computer

dusty plinth
#

unique ID: 'Iamaviris'

#

hehe

tulip sleet
#

๐Ÿ˜ƒ do you have any other computers in the house you could try it on, esp a Mac or something non-Windows, or a Windows machine without Arduino installed?

dusty plinth
#

no Mac, other Win7,and one with Raspbian-skinned linux

tulip sleet
#

the rasbpian would be a good test; if you're busy with the other stuff it doesn't have to be now; feel free to start a forum thread

#

maybe do the erase_filesystem() one more time, without bothering to reload CPy

dusty plinth
#

found another Win7 I forgot about, booting and waiting for updates

dusty plinth
#

ok, it's working on that one, so I guess I need to see about reinstalling the drivers again on the first machine

#

and the .py script is working on the CPX while it isn't (correctly) on Gemma

#

now I can look at altering the script (have 2 messages dependent on the switch position)

manic glacierBOT
#

Hi Dan,

tinyusb use nrfx mostly in its bultin example. The usb core doesn't use it much, except for those register definition and bitmask. Thus there shouldn't be any duplicated symbols or functions.

Since nrfx serves as the thin hal layer, if we use any 3rd party middle/higher ware that use nrfx, we will possibly run into this as well. I don't know which is the best way to resolve it as well.

dusty plinth
#

CPX reinstalled and reading as CIRCUITPY now

tidal kiln
#

on your original machine where it wasn't showing up?

dusty plinth
#

yes

#

all 3 reading both ways now

#

after watching the install process, maybe I had changed reset modes before all was done installing

raven canopy
#

@dusty plinth glad you got it working! ๐ŸŽ‰

dusty plinth
#

now I can start working on my changes in the next 2 weeks for a local hamfest

#

no point in trying before it works

tidal kiln
#

cool. glad it's all working now. that was a weird one, so not really sure how it got to be like that.

raven canopy
#

@tidal kiln is there any reason to document __getitem__/__setitem__, beyond the usage examples? i'm looking for other examples in the bundle...but coming up empty.

tidal kiln
#

hmm. good question.

#

let me look at the ones i've done and what i did...

#

looks like all the ones i've done are a little different

#

you get back an instance and then use a property of that

#

and the property has a docstring

dusty plinth
#

other than number of units and what pin neopixels are on, can you think of a reason for a python script blinking lights to work on a CPX but differently or not at all on a Gemma M0?

raven canopy
#

@tidal kiln right...a property clearly gets a docstring. but, special members only get rendered if you force it in the autodoc; which is not turned on in the cookiecutter. also, the design guide doesn't mention this case specifically. i'm vacilitating between going with only usage example, docstring the getter/setter in the class' docstring, or docstring in the getter/setter.

tidal kiln
#

guess i don't know. can ask tomorrow.

dusty plinth
#

I saw nothing in the script specifying what pin the pixel was on

tidal kiln
#

@dusty plinth what script?

dusty plinth
#

the one I posted above

tidal kiln
#

here's where the pin and number of pixels are specified:

pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False)
#

it's toward the bottom of the script

#

board.NEOPIXEL refers to the pin that control the on board neopixel(s)

#

the on board RGB LED for the Gemma M0 is actually a dotstar, not a neopixel

#

what are the neopixels you are trying to use with the Gemma M0?

dusty plinth
#

oh, so I'd have to change neopixel in there to dotstar?

#

I was just trying to use the onboard

tidal kiln
#

are you wanting to use the single RGB LED on the Gemma?

dusty plinth
#

LED

#

at this time that's what I was trying to do

tidal kiln
#

ok. hold on. i can give you a basic blink example...

#
import time
import board
import adafruit_dotstar

ds = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1)

while True:
    ds.fill((255,255,255))
    time.sleep(0.5)
    ds.fill((0,0,0))
    time.sleep(0.5)
dusty plinth
#

another application (perhaps using a Trinket) I'd be adding neopixxels

#

getting some from my sis at Digikey later this week

#

employee discount ๐Ÿ˜‰

tidal kiln
#

i bet, for the Gemma, you can just replace that line with this:

pixels = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, auto_write=False)
#

and then it will just work

dusty plinth
#

and change the import nepixel

tidal kiln
#

yep

#

like in the simple blink example above

#

@raven canopy i also plan to ask how you could do that weird MID/PID I2C transaction through I2CDevice, if at all

raven canopy
#

i'm 98% positive you can't. without changes to I2CDevice...

tidal kiln
#

i looked at it and tried and 98% agree

raven canopy
#

๐Ÿ˜†

tidal kiln
#

so i'm curious what's the best solution for that scenario

raven canopy
#

well, i'll be on my cell at work, so interaction will be minimal. i trust you'll be able to explain it all better than i anyway. ๐Ÿ˜„

dusty plinth
#

@tidal kiln dotstar working now

tidal kiln
#

yeah! blinking SOS?

dusty plinth
#

no, N0UKF

tidal kiln
#

oh, hopefully that's because you have message = 'N0UKF'

dusty plinth
#

with a couple spaces. the end to beginning time was too short

#

like 2 sentences with no period between them

#

on the CPX I'll add a line to look at the slide switch and change the message or something else based on its position

#

maybe one of the buttons will make a tone with the light as long as it's pressed

manic glacierBOT
#

This on its own is likely of only marginal use (though I'm sure someone will find a use for it). My real motivation for this PR lies in https://github.com/KMKfw/kmk_firmware/issues/52#issuecomment-429679164, where I'd eventually like to be able to both import a single gzipped Python module (this one is arguably less useful, but again, I'm sure some advanced user would find use for it - this functionality is not part of this pull request), and eventually import modules from a ZIP folder. Sin...

raven canopy
#

@tidal kiln FRAM fixes pushed. now to figure out how to cleanly apply them to the SPI branch... ๐Ÿ˜„

#

blargh! pylint strikes again...

raven canopy
#

Travis is now happy, so I'm calling it... ๐Ÿ˜ด

slender iron
manic glacierBOT
#

@urish Thanks for the info! What happens when something like a with is used within a native statement? How does it error out?

Your argument for native makes a lot of sense. I'm worried about viper because we want to be a subset of CPython since our libraries also run in C python. That is my worry the assembly version as well. It won't be portable. I'm ok adding the latter two as long as they error in a friendly way on raspberry pi in CPython and don't take too much code space.

When meas...

slender iron
#

<@&356864093652516868> Here are the meeting notes for tomorrow: https://docs.google.com/document/d/1Rj7udTnvLpvVs5_2xjy2xoknwEJUo0ol6FhqlK3CCPw/edit?usp=sharing Talk with you all soon! ๐Ÿ’ค

manic glacierBOT
turbid radish
#

Weekly check - would you like to receive Adafruit's Weekly Python on Microcontrollers Newsletter? If, so, check out below. No spam, ad-free, leave anytime, data never sold and can be wiped. https://blog.adafruit.com/2018/10/15/python-on-microcontrollers-newsletter-sign-ups-open-python-circuitpython-microcontrollers/

Adafruit Industries - Makers, hackers, artists, designers and engineers!

Follow all the news concerning Python on Microcontrollers via the Adafruit Weekly Newsletter! Catch theย weekly news on Python for Microcontrollersย withย adafruitdaily.com.ย Thisย ad-free, spam-freeย weโ€ฆ

gusty kiln
solar whale
#

@gusty kiln IIRC it does work on RPi but you have run it as "sudo"

idle owl
#

@gusty kiln It requires neopixel_write. Which isn't in Blinka.

#

So I wasn't so sure about it working. Basically if I have to automock something in Sphinx to get Travis to pass with the PyPi setup, it often doesn't work.

gusty kiln
#

ah, gotcha.

idle owl
#

I could be wrong though if Jerry thinks it works

solar whale
#

@gusty kiln just confirmed -- it does work as "sudo"

idle owl
#

interesting.

solar whale
#

make sure you have latest version

gusty kiln
#

we should probably point them at the newer lib, i guess. i'll write something up.

idle owl
#

Yah. Worth it for now anyway.

gusty kiln
#

i'll test while i'm at it, just so i know of what i speak.

idle owl
#

Excellent, then we can update the spreadsheet.

gusty kiln
#

@solar whale are you powering them from the pi, or some other power source and just doing control from the pi?

solar whale
#

for my "jewel (7 neopixels) I just power it from the RPi 3.3V

#

bigger strings will prob need exteranl power -- 5V and levelshifiting.

idle owl
#

Evidently levelshifting isn't always required. As per the significant number of DotStars being run off of an RPi0W here. And also the reason why I didn't know about levelshifting even being a thing until much later. ๐Ÿ˜„

solar whale
#

It is not needed until it is ๐Ÿ˜‰

idle owl
#

I wanted to convert the project to CP. So I hooked them up to an Itsy with, I want to say, clock hooked up to the level shifted pin and data on a hardware SPI pairing with it. Wanted to do up a guide for it, but I'm not certain that it isn't a fluke that it works. And whether it'll work again on someone else's board.

#

I'll have someone test it when I get back to it again. Kind of set it aside with everything going on.

solar whale
#

I don't have any dotstar strings -- so have not worked with them. for Neopixels -- if I use an external 5V supply, then I level shift. If I can get away with the MCU 3.3 then I do that.

idle owl
#

Well NeoPixels only require one pin, so the already-level-shifted pin on the Itsy will do it for you.

#

DotStars require two.

#

And there are no white NeoPixels, this project uses white DotStars

#

No white worth using for anything you really need white for anyway...

solar whale
#

what about RGBW neopixels?

idle owl
#

I was in the process of adding to it so I could document it this time and have photos for a potential guide (I didn't document the original build, figures)

#

Not bright enough

#

The white DotStars are built like RGB but each LED is white

#

so it's 3x as bright as a white neopixel.

#

Plus DotStars being a bit brighter anyway it seems like.

#

It's for a table top lightbox photo studio.

solar whale
#

ah -- I am usually blinded by my neopixels -- run at .3 ๐Ÿ˜‰

idle owl
#

1.5m of 60/meter DotStars isn't bright enough sometimes. So I'm adding another set of strips. Pro tip: don't try to solder 90/m density LED strips.

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

I managed to get one set soldered kind of ok, like they mostly work.... but oi. Soldering to a pad that's the size of a dot, and you cut it in half so it's half that dot........

#

I have a friend who can do it, but he hasn't been able to come out in a while so the project sits. Because it took me entirely longer than it should have to get the square I made put together and there are two more squares to do.

tidal kiln
solar whale
#

sounds like a great project, but good luck with the soldering. My soldering confidence took a big hit last time I tried to solder an SWD header to a board...what a mess

idle owl
#

Oi.... I tried to do that once too

#

@slender iron Should my Tellis M4 show up as CIRCUITPY? Or is there an issue with the version of the SPI flash that's on it? And regardless of the issue, is there a build that works for this version?

#

I can connect to the serial console and get the REPL, but no drive.

gusty kiln
#

@tidal kiln that "file is not a zip file" thing is a pretty common bug with a pile of our older libraries - i forget the specifics but it's an ancient version of setuptools or something where a URL redirects now and things break.

#

but i figure we should probably just direct people to the supported libraries rather than fixing those issues, unless a ton of people are hitting them and can't easily switch libraries.

tidal kiln
#

@gusty kiln the guide instructions worked for me just now, fwiw. i was starting with a fairly fresh raspbian and ran all commands shown.

gusty kiln
#

cool, good to know.

tidal kiln
#

yep

gusty kiln
#

right on, thanks.

tidal kiln
#

note that the forum poster references the "README" and they are trying to execute setup.py build instead of setup.py install per the guide

#

but both of those also worked for me

#

so i think that guide might still work as shown, even if we're going to move to a new approach

solar whale
idle owl
#

Oh. Well there you go ๐Ÿ˜„

#

That explains why it works. August 31 was after I deployed it to PyPi and after I left the country, so I missed it.

slender iron
idle owl
#

@slender iron Hmm.... I did try one earlier than that. I thought of that. I guess it needs troubleshooting then.

slender iron
#

whats the chip labelled?

idle owl
#

winbond 25Q128JVSQ 1818

#

Of course now it works.

#

I grabbed 9 October's build.

slender iron
#

๐Ÿ˜›

idle owl
#

I tried three other builds before that though last night and got nothing.

#

does it use Adafruit_CircuitPython_NeoTrellis to interact with the buttons?

slender iron
#

I used MatrixKeypad

idle owl
#

Huh. Fair enough.

#

@slender iron May I have your code.py to work from? I made the example run, but it doesn't do anything and I'm not sure where to start.

slender iron
#

sure, gotta find it

idle owl
#

Thanks!

slender iron
idle owl
#

Oooh

#

I was wondering how the LEDs worked with MatrixKeypad. They don't, you have fancy extras. ๐Ÿ˜„

#

Thank you!

slender iron
#

๐Ÿ˜ƒ

idle owl
#

Ok this makes a lot more sense now that I see it. I did dir(board) and did not find anything that made using the LEDs obvious.

#

They're an array. ๐Ÿ˜„

exotic pumice
#

@slender iron, I applied your suggested change to my PR

slender iron
#

k will look later or tomorrow morning

idle owl
#

<@&356864093652516868> CircuitPython Weekly starts in about 6 minutes! Everyone's welcome!

exotic pumice
#

thanks, take your time

#

I'd love to join you for circuitpython weekly but I'm in class lol

solar whale
#

๐Ÿ‘‹

slender iron
#

@exotic pumice you can listen to it later!

exotic pumice
#

yeah I've done that previously

sudden coral
#

where do the recordings end up? I'd love to listen in but my work's standup is also at 11am PT on Mondays.... ๐Ÿ˜†

raven canopy
#

๐Ÿ‘‹

exotic pumice
#

@sudden coral adafruit's youtube channel

sudden coral
#

sweet, thanks!

idle owl
#

@raven canopy Put it alphabetical in the notes if you get a chance. ๐Ÿ˜„ I don't want to move it while you're typing ๐Ÿ˜†

raven canopy
#

oops! sowwy!

#

at home, but text only...

gusty kiln
#

i'm lurking / mic outta commission

raven canopy
#

๐Ÿ˜„ i'll get a sweet mic setup one of these days.

gusty kiln
#

yep

idle owl
candid stump
#

lurker

idle owl
#

@candid stump Thanks for letting us know and thanks for joining!

gusty kiln
#

mine: thanks to @raven canopy and @slender iron for review of trellis PR, and kattni for ongoing stewardship of library project.