#circuitpython-dev

1 messages · Page 294 of 1

timber mango
#

I am very interested in low power systems.

#

Robots have to conserve every mW of power they can.

main meteor
#

I've built some systems powered by energy harvesting, became quite fond of TI's MSP430FR line, which is quite power efficient and has non-volatile RAM available.

ionic elk
#

@slender iron how low are you aiming with sleep? In comparison to the Pyboard-micropython sleep stats of 300uA stop and 30uA standby?

manic glacierBOT
slender iron
#

@ionic elk first pass just idling the cpu

fallen anvil
#

Doing proper low power is going to be hard work without some os-type abstractions...which doesn't mean we shouldn't do it, just w me shouldn't underestimate it.

#

(I have my nrf52 up now, but distracted into solidifying the blackmagic probe support for it just at the moment)

slender iron
#

@fallen anvil what do you mean by proper

fallen anvil
#

Clock speed manipulation, clock feed switching to perhiperals, switchable pull-ups, power on/off to individual perhiperals etc.

#

It's most easily done with a sane set of abstractions that we can plug into.

#

Switching off lumps of ram and/or flash.

#

You can get really obsessive about this stuff, and it's great fun hunting for that last 10uA :-)

onyx hinge
#

I can't remember the name of the blog now (and he since stopped doing it) but there was a fellow who was doing things like getting his AVR-based sensor nodes to run for a year on single cell batteries. Pretty amazing stuff to me.

#

oh nice, looks like he's blogging again even

ionic elk
#

I mean, all I really need is a WFI state for circuitpython, that puts the MCU in Standby mode. It's easily the module I've been most asked about by other people I know using Circuitpython too, though that's anecdotal of course.

#

Right now people have to do it by including an external hardware reset system, and lose all their RAM. Whereas if you use Arduino or Mbed or Zephyr or whatever, you just call "sleep()" and that's it, you can run for 6 months without needing a battery change.

idle owl
#

Been a while.

slender iron
#

@fallen anvil I don't want to turn any ram off because I want to remember where we are. We're pretty good about clock gating though.

#

@ionic elk I'm skeptical about 6 months for what I'm looking at

#

@idle owl I removed todo from the list because I add them for later

idle owl
#

@slender iron ok.

prime flower
#

@solar whale Does it hang if you're in debug mode, too?

solar whale
#

yes - here ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-127-g22b7050c4 on 2019-10-03; Adafruit Feather M4 Express with samd51j19

import old

  • Initializing DHCP
    *** Get socket
    Allocated socket #0:68
    *** Connecting: Socket# 0, conn_mode: 2
    *** Opening socket 0
    w5k socket begin, protocol=2, port=67
  • socket_available called with protocol 2
    Bytes avail. on sock: 308
    * Processing 8 bytes of data
  • UDP Bytes Remaining: 300
    Bytes avail. on sock: 300
    * Processing 300 bytes of data
  • socket_available called with protocol 2
  • socket_available called with protocol 2
  • socket_available called with protocol 2
    Bytes avail. on sock: 308
    * Processing 8 bytes of data
  • UDP Bytes Remaining: 300
    Bytes avail. on sock: 300
    * Processing 300 bytes of data
    *** Closing socket #0
  • Found DHCP server - setting configuration...
    DHCP Assigned IP: 192.168.2.32
  • Get host by name
    *** Get socket
    Allocated socket #0:17176
    *** Connecting: Socket# 0, conn_mode: 2
    *** Opening socket 0
    w5k socket begin, protocol=2, port=53
prime flower
#

That's from the latest PR?

solar whale
#

no -- that is current master

#

I'll do latest PR now

#

ooh -- debug onlatest pr works!!!

prime flower
#

I separated a lot of the lower-level socket driver on latest PR after seeing your output

solar whale
#

ah -- it is working now.... even without debug

#

I must have goofed on first try of the latest PR

#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-127-g22b7050c4 on 2019-10-03; Adafruit Feather M4 Express with samd51j19
>>> 
>>> 
>>> import nodebug
Wiznet5k WebClient Test
Chip Version: w5500
MAC Address: ['0xde', '0xad', '0xbe', '0xef', '0xfe', '0xed']
My IP address is: 192.168.2.32
IP lookup adafruit.com: 104.20.39.240
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)

----------------------------------------

Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Mar 5, 2020 21:48:00 UTC', 'updatedISO': '2020-03-05T21:48:00+00:00', 'updateduk': 'Mar 5, 2020 at 21:48 GMT'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 9125.52, 'rate': '9,125.5233'}}}
----------------------------------------
Done!
prime flower
#

whoo

solar whale
#

yay -- works on the nrf52840 as well

#

ship it -- I have to run -- nice work!

tulip sleet
#

@solar whale I don't know why your tags aren't up to date (alpha.4)

solar whale
#

Not sure what happened. All good now after re-cloning.

#

Ooh just saw that. Will need to recheck . That may be an build before reclone... thanks for noticing @tulip sleet I’m AFK for the evening. Will investigate tomorrow.

#

Ah those say 2019-10-03. I’ll update tomorrow

timber mango
#

If I had extra sensors, I would be very tempted to solder my sensors to a proto-board. I am very tired of having stuff not work that I know works.

main meteor
#

Dodgy connections can really make things less fun. There are some nice temporary connectors out there that work well.

timber mango
onyx hinge
#

all the wiznets are de:ad:be:ef:fe:ed MAC addresses? That's .. not great. Having more than one on a single network would cause interesting problems.

#

can circuitpython generate a MAC address from the 2^47 LAAs and its own unique ID?

manic glacierBOT
#

I still don't want multiple versions for a single board. Multiple versions are a long term support burden that I'm not willing to commit to. So, my preference would be to always freeze these two libraries and bus device in because both chips are on the board.

I agree, if we should have only one board it's the best fit

There is no need to freeze the binascii library in because the built in version can be enabled with MICROPY_PY_UBINASCII and will definitely be smaller and faster.
...

solar whale
#

@tulip sleet much better now - those were just older MCUs I had not updated ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-15-ge98991fd7 on 2020-03-03; Adafruit Feather nRF52840 Express with nRF52840

and Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-15-ge98991fd7 on 2020-03-03; Adafruit Feather M4 Express with samd51j19

tulip sleet
#

@solar whale great! I thought it was perhaps some weird github tag pulling issue.

solar whale
#

I'm still a bit confused, but I'll keep an eye on it -- since the dates were also old, I think those wer just boards I pulled out without updating.

onyx hinge
#

I think that unless you "git fetch --tags" you can miss getting tags. You can also control this with the gitconfig variable remotes.<name>.fetch. I think I understand the specific circumstance in which you can miss getting tags, but I'm not sure I can describe it accurately...

#
       also fetched; the effect is to fetch tags that point at branches that
       you are interested in. This default behavior can be changed by using
       the --tags or --no-tags options or by configuring remote.<name>.tagOpt.
       By using a refspec that fetches tags explicitly, you can fetch tags
       that do not point into branches you are interested in as well.

but basically I think that if revision AABBCCDD gets tagged after you fetched AABBCCDD into your local repository, you may not get the tag fetched

#

because then that revision is not "the [history] being fetched"

tulip sleet
#

i rarely fetch tags explicitly; they just show up. It does not seem to be a problem. But I am running the latest git from an Ubuntu PPA. I regularly do:

git fetch adafruit # upstream
git checkout master
git merge adafruit/master
git push
git pull --prune  # remove deleted PR branches

You probably do this too.

prime flower
#

@onyx hinge no, they have a sticker which comes with them w/their HMAC. that's a default

onyx hinge
lone sandalBOT
manic glacierBOT
timber mango
#

Has anyone had problems with a script not being able to get a lock on the I2C bus?

raven canopy
#

@tulip sleet Actions really doesn't like that PR. 😣

tulip sleet
#

i know, right 😦 i'm going to sleep on it

manic glacierBOT
manic glacierBOT
#

Looks like the adafruit_pypixelbuf.mpy available in the 5.x.x library downalod from circuitpython.org still requires re:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 4, in <module>
  File "/lib/pixelbuf_neopixel.py", line 38, in <module>
  File "adafruit_pypixelbuf.py", line 32, in <module>
ImportError: no module named 're'
manic glacierBOT
manic glacierBOT
#

Note also that checkout@v2 by default does a --depth 1 clone, which doesn't work for us, because we use the nearest tag for version information.

To do a full clone, you do:

with:
  fetch-depth: 0

Alternatively, to make sure all the tags are fetched, see https://github.com/actions/checkout/blob/master/README.md#fetch-all-tags. I think that might work and still avoid fetching some of the history.

I spent some time researching whether one could do a shallow clone and then ...

ionic elk
#

It really drives me nuts that often the pages that Google returns for circuitpython documentation are for some random old version like 2.x or 3.x. There's got to be some way of dealing with that, right? I figure this must be something that happens on a lot of documentation sites.

lapis hemlock
#

@onyx hinge Jeff, is it possible to locally (i.e., on my computer) test ulab against circuitpython? I have cloned from https://github.com/adafruit/circuitpython, but I couldn't find my code, so I presume, this won't work out of the box, right?

onyx hinge
#

@lapis hemlock yes it should be possible! the ulab code is in extmod/ulab and it may not be there until you run the "git submodule update --init" step. I know there is a guide about building circuitpython, let me see if I can find it.

lapis hemlock
#

@onyx hinge Thanks! I hadn't executed submodule update, so no wonder that I didn't find anything😊

lone axle
#

@ionic elk ive noticed that too. I don't know much about it, i wonder if robots.txt file could be used somehow to limit google to latest

tulip sleet
#

@lone axle @ionic elk readthedocs supports custom robots.txt and (I think) sitemap.xml files, so we could excluded unsupported versions

#

i tend to use the rtd search box, but it's slow

lone axle
#

Ooh nice

ionic elk
#

I wonder if that would impact search rankings... It'd be nice if a popular page from a previous version would still boost the pages of new versions

lone axle
#

Do the readthedocs pages get made from the docs folder in the repos? Or is that seperate?

tulip sleet
#

yes, rtd is made from the docs folder

simple pulsar
#

I left a CLUE running some code with a lot of printing to the USB. I just noticed the output froze on a terminal window. It did respond to a control-C but now is ignoring me. That CLUE still has 5.0.0-beta.5 on it. Has anything like this been seen? The drive over USB was still working, btw. I'll update it to 5.0.0 and see if I can make it do it again.

tulip sleet
#

@simple pulsar were you using the onboard devices (besides the screen)?

simple pulsar
#

It was plotting some values probably from a sensor, e.g. i2c

tulip sleet
#

we have seen one or more i2c devices hang up. the device pulls SDA low and stays there, which hangs the whole bus, and any I2C operation in progress. it needs a power cycle to clear. We have an issue and proposed fix: https://github.com/adafruit/circuitpython/issues/2635. This has happened on CPX as well, but it's much rarer. We didn't add the fix to 5.0.0 because we'll need to do thorough testing.

simple pulsar
#

The plotting was still running, just the USB output appeared to have stopped mid line on terminal window. If I saw something like that I'd normally suspect the terminal program as being just as likely the problem

#

But to my surprise it took control-c input

tulip sleet
#

ah, that is different, what host computer OS was this?

simple pulsar
#

In fact it still works

#

I've got unidirectional serial over USB

#

This is PuTTY on my trusty windows 8.1 desktop

tulip sleet
#

that doesn't ring a bell. did Windows go to sleep at some point?

simple pulsar
#

It would have screen saved (power). Nothing bad would happen on a proper o/s with that event...

#

I also can't type on REPL, I just can do control-C

#

But this is 5.0.0 beta 5. I can upgrade and see if I can reproduce.

#

Yeah, I can force a reload still by copying files onto the driver, and I can do control-c but not much else. It's a bit like messing up ones stty settings. All very odd.

slender iron
#

@ionic elk @tulip sleet I've updated RTD to default to version 5.0.x

ionic elk
#

@slender iron nice, ty!

tulip sleet
#

we could robots.txt out the anything earlier than 4.x (or even 5.0.x)

ionic elk
#

hmmm yeah top result for Circuitpython PulseIn on my machine (incognito) is still 2.x docs

ionic elk
#

might take time to propagate though

slender iron
#

this doc mentions a "hidden" state that would remove versions from a sitemap

simple pulsar
#

@tulip sleet It actually stopped output on the second text arg in a print statement - that's an indicator that the bug is less likely to be the terminal side of things. I'll update everything and stick it on a windows 10 machine and leave it running for a few hours later on to see what happens.

tulip sleet
#

tnx!

manic glacierBOT
#

There is no need to freeze the binascii library in because the built in version can be enabled with MICROPY_PY_UBINASCII and will definitely be smaller and faster.

I don't know about it, if it exists, is smaller and faster, why isn't it already enabled ?

Because it still takes up space. For builds that don't use it, it is smaller to omit it. In this case we should enable it instead of freezing in the Python version since we want it.

Rotaryio, usb_hid and usb_midi co...

fallen anvil
tulip sleet
#

@fallen anvil thanks, I will try! I'm debugging a SAMD51 problem at the moment 🙂

fallen anvil
#

No prob. It will probably change reasonably quickly as it solidifies but I'm seeing about 32K/sec of flash speed at the moment

manic glacierBOT
solar whale
#

FYI -- for my first try of an SPI device on a Teensy4.0 - running rfm69 radio-- no problems so far -- working very well.

old smelt
#

Hi All - this has the potential to be a an "in the weeds" kind of topic, but it's the right time to ask, I think.

We are getting ready to start customizing a CP build for our SAMD51+FPGA board, and part of what we need to do includes adding code that affects changes to the FPGA I/O and fabric as part of the standard things you'd do in your code like defining Digital In/Out, etc. We have this working for Arduino and I really want to see it supported with CircuitPython, as well, if possible.

We are using a secondary I2C between the SAMD and MAX 10 as the configuration bus. Can CircuitPython support this kind of architecture, as well?

@toxic pasture is our lead software developer on this and may chime in on this thread, as well. He's new to both CircuitPython as well as the CP community. But he's heard a lot about it from me over the last year+ 🙂

timber mango
#

I took over ownership of the micropython-adafruit-ht16k33 library from Adafruit , and am now the maintainer for it. How do I delete a branch from my local repo?

ivory yew
#

hmm bytearray doesn't have decode and can't be used with join.

tidal kiln
#

git branch -d

ivory yew
#

is there any way to transform it into a bytes or str?

#

ah bytes(some_bytearray) works.

tidal kiln
#

bytes( nvm.... that ^^

#

@timber mango local = on your local computer? or in your github account?

timber mango
#

@tidal kiln Yes, local on my computer.

tidal kiln
#

ok, the command line thing above then. but checkout that guide i linked. it also shows how to delete the branch in your github repo.

timber mango
#

Thank you!

#

I am reading that now.

#

I found out what has been causing at least some of the problems with my circuit. One side of my doubler is bad and I do not know if I can fix it.

meager fog
#

@indigo wedge @fallen anvil with ulab merged, y'all could add to imx builds - would be a good match i think 🙂

manic glacierBOT
simple pulsar
#

@tulip sleet 5.0.0 survived 70 minutes of spitting data down serial line on Win10, I'll leave it going for longer tomorrow just to give it a thorough test.

ivory yew
#

It also survived being left on Sol's prototype board all night without crashing.

#

part of my accidental burn in testing.

manic glacierBOT
timber mango
#

Is board.I2C() supposed to work?

slender iron
#

yes

onyx hinge
manic glacierBOT
onyx hinge
#

@slender iron ooh I will take a look. may be monday though.

slender iron
#

no problem @onyx hinge ! I'm done for the weekend too

#

I do have a test sensor going to see how much things improve

onyx hinge
#

what HW are you using for current measurement? Or are you just looking at operating time?

#

I gave the patch a scan and nothing bad jumps out at me.

slender iron
#

@onyx hinge I bought a https://www.joulescope.com/ . I'm doing operating time for a sensor I have going

Joulescope Store

Joulescope is the most affordable and easy-to-use precision DC energy analyzer. Joulescope measures current and voltage, then computes power and energy. Use Joulescope to optimize energy consumption and battery life during product development. Great for reducing microcontrolle...

solar whale
#

@tulip sleet Is there an equivalent to the "update-bootloader" for the nRF52840? or do all bootloader updates require a J-Link. In particular, I was wondering if i had to attach a J-Link to my Bluefruit_Sense.

tulip sleet
#

@solar whale The README implies that one can create a .uf2, which I tried, but it didn't seem to work. I need to ask Thach. However, you can use adafruit-nrfutil to do a DFU update: you don't need a J-Link. Using the downloaded zip, do:

adafruit-nrfutil --verbose dfu serial --package Downloads/feather_nrf52840_sense_bootloader-0.3.1_s140_6.1.1.zip -b 115200 --singlebank --touch 1200 -p /dev/ttyACM0

or if you have a clone of the repo:

make BOARD=feather_nrf52840_sense dfu-flash SERIAL=/dev/ttyACM0
solar whale
#

@tulip sleet thanks -- dfu-flash worked fine -- been too long since I did that! I now have a FTHRSNSBOOT! and a RED LED

tulip sleet
#

@solar whale I just asked Thach: he says it is not yet implemented

solar whale
#

Thanks -- I was not looking forward to tacking wires to the swd pads

#

I totally forgot about dfu-flash

tulip sleet
#

i had to rediscover it too, i went through the same process

solar whale
#

even though i saw it in the readme - just forgot how it worked!

tulip sleet
#

i extracted the first command above from the Makefile

onyx hinge
#

@slender iron looks like neat equipment

#

I won't ask for one if I can avoid it

manic glacierBOT
timber mango
#

In git, what does "rebase" mean? I am confused.

#

@gilded cradle Why? python if isinstance(bitmask, (tuple, list)): bitmask = bitmask[0] << 8 | bitmask[1]

main meteor
#

Looks like it assembles a list of bitmask pieces (presumably bytes) into a single (16-bit?) quantity?

raven canopy
#

@timber mango think of rebase as re-writing the history. it will make the target worktree reflect the exact history of commits as the base/source.

manic glacierBOT
#

I noticed one occasion where leaving an Adafruit CLUE running 5.0.0 beta 5 with some very verbose output to stdout for over an hour caused the terminal output to stop. I've just reproduced this with the same application/library code on 5.0.0 but it took approximately 130 minutes to do it.

  • 5.0.0 beta 5 with PuTTY 0.70 on Windows 8.1
  • 5.0.0 with PuTTY 0.73 on Windows 10

The application is reading analogue values from P0-P2 and graphing them. It does not have the serial console active ...

timber mango
#

@raven canopy OK. So, I should just do a git rebase in the repo then?

raven canopy
#

why are you rebasing? not being combative; just want to make sure its the right tool for the right job 😄

timber mango
#

@main meteor I understand what it does. 🙂 I just do not understand the reason for the change (in a PR).

#

@raven canopy It is a change requested to one of my PRs.

raven canopy
#

@timber mango link? rebasing is a drastic measure

crimson ferry
#

@prime flower I'd been regression testing the wiznet5k commits up to a point after it was working for me, but now I consistently get the ValueError: bytes out of range on the release. Should I open a new issue on the library with debug dump? update: nevermind (maybe?) It only happens when the Airlift is plugged in also, but the wiznet5k simpletest fails (no CP to init or use the Airlift - I do have the eth CS pin changed to board.A5) update2: yeah I think nevermind, I disconnected everything and did a full power cycle and now it's not happening, maybe the Airlift board was in a state.

timber mango
raven canopy
#

@timber mango i would ask for some clarification. i'm not seeing why a rebase would be needed. there are no conflicts, but it could just be asking to pull in merged changes that occurred after the PR was opened. a simple pull upstream master would fix that...

#

assumes your remotes were added as upstream

timber mango
#

@raven canopy If I remember correctly, I did add the remotes as upstream. That is how I was taught. 🙂

raven canopy
#

one of those "unwritten" standards, i presume. 😄

timber mango
#

I do not know. Maybe it is the way my mentor was taught and passed down.

#

I need to understand what something does and why I should use it before I go using it on something. 😉

#

@raven canopy If a mentor can not patiently answer all of my "How?," "What?," and "Why?" questions, then they are not the mentor for me. I ask a LOT of questions to get good understanding of something.

tulip sleet
#

if someone is asking for a change in your PR, there are usually two reasons:

  1. they are requesting a change in your code. Just make the change, commit and push again.
  2. Your PR has merge conflicts with upstream. In that case, fetch from upstream, merge from upstream into your PR branch, fix the merge conflicts, and then re-push.
#

we basically never use rebase, because it's too easy to make a mistake

#

you can use rebase in your local repo to mash together multiple commits into one, but i would basically say never rebase if you have pushed to a repo other than your own, or anyone has pulled/cloned your repo

raven canopy
#

and that is totally fair, when context and situations allow. 😉 i too am a why does this work person. my childhood was filled with broken gifts, because i was more interested in the what, how, why. hehe

#

yeah, i think the "rebase" in the context of that change request is more along "bring to current".

tulip sleet
#

that is the point of @raven canopy saying it rewrites history; if other people have the old history, then you will mess them up by rebasing

timber mango
#

@tulip sleet 1) I may ask questions about said code changes and possibly why it should be done, especially if this is something new to me. 2) I work to resolve such conflicts on my own first and then ask questions if I do not understand something. I asked about rebasing because it seemed like it was a major operation and I did not understand what it did and why. 😉

tulip sleet
#

can you point to the specific request?

timber mango
#

@tulip sleet Yes, now I understand rebasing much better because of @raven canopy's explanation.

#

I am an old dog, but I can learn new tricks. 😉

#

Now, where did I put my long shoe horn? 🤪 😎

tulip sleet
#

in that case, it is because there's an excessive number of commits. You can squash all those into one or a few, and then push -f to the PR. That will rewrite history but since it's only your PR that's affected, it's not going to mess someone else up.

timber mango
#

@tulip sleet I did have quite a few small commits. Now, I am starting to really understand this. I have not done a lot of these things before, so a lot of this is very new to me. I have never tried contributing to an Open Source project before, especially not one this major.

tulip sleet
#

some people like very "sanitary" commits and they go to great lengths to do that. Several commits is fine, but a lot may be worth squashing. I once went to a talk about git with a significant section on rebase, and the presenter managed to mess up a simple example, which just reinforced my inclination to avoid it in most cases.

timber mango
#

@tulip sleet By "sanitary," do you mean one commit handles just one thing and one thing only?

tulip sleet
#

no, just that some people like to minimize the number of commits

timber mango
#

Ah, OK.

tulip sleet
#

messy vs "clean"

timber mango
#

Got it. 😉

#

I am usually messy when I start out with something new, but I make great effort to graduate more towards clean.

#

I have done many different things in many different computer languages over the years, starting out when I was in 7th grade.

#

That includes APL, FORTRAN, BASIC (several dialects including DEC's Basic-Plus), Python, Pascal (including Apple USCD Pascal), C, and some C++. I have also dabbled in Go, Elixir, and other languages.

#

@tulip sleet @raven canopy Thank you for your great explanations. They have helped a LOT in my undertanding of rebasing as well as given me insights into how the "Circuitpython Gang" works. 😉 🙂

tulip sleet
#

you're welcome!

timber mango
#

😃 😉

gilded cradle
#

Exactly as @main meteor said. That way you can pass 2 8-bit masks instead of a giant 16 bit one. It just gives you options.

timber mango
#

If all bitmasks are 16-bit what effect will that have?

#

We can not assume that somebody wants to use 8-bit masks.

#

Just because some masks might be only 8-bit values, that does not mean it is an 8-bit mask.

#

The upper 8-bits might just happen to be all 0's.

manic glacierBOT
gilded cradle
#

@timber mango, is that preventing you from making some kind of change? If we were to remove it, that would be a potential code breaking change.

timber mango
#

I do not understand. I am just trying to accomplish a goal.

gilded cradle
#

You could pass either a 16-bit mask as an number or you can pass 2 8-bit masks inside a list or a tuple and either should work fine.

timber mango
#

@gilded cradle I do not understand how that applies to what I am doing with the 14-segment animations, which only reside within one demo script.

#

I am hesitant to mix 8-bit and 16-bit processing techniques.

gilded cradle
timber mango
#

Yes, this is what I started out asking questions about.

gilded cradle
#

Assuming you're not trying to modify set_digit_raw(), you should just be able to use 16-bit numbers and you should be fine.

#

Other users may prefer using 8-bit numbers and they have that option as well.

timber mango
#

I am not modifying any part of the library for this. My code only uses set_digit_raw() to do what it does.

gilded cradle
#

Just don't pass 2 16-bit numbers in a list or tuple to that function and you should be fine 😉

timber mango
#

Then they should use only 8-bit numbers all the way through. What do you mean by "two 16-bit numbers?"

gilded cradle
#

I mean don't pass something like [0xFFFF, 0xFFFF] or you may get unexpected results.

#

That may better answer your "why".

timber mango
#

My code uses only 16-bit bitmasks, and set_digit_raw() does not seem to mind at all.

gilded cradle
#

Correct, it just ignores that snippet of code if you pass in 16-bit.

timber mango
#

Ignores what snippet of code?

gilded cradle
#

If you happen to pass in 8-bit, it converts it to 16-bit and continues processing as normal.

#

This snippet:

        if isinstance(bitmask, (tuple, list)):
            bitmask = bitmask[0] << 8 | bitmask[1]
#

I guess I don't understand what problem you are having with it.

timber mango
#

An 8-bit value is also a 16-bit value, and a 32-bit value, and a 64-bit value. What happens if bitmask and bitmask[0] are both full 16-bit values (> 255)?

simple pulsar
#

"undefined behaviour" !

gilded cradle
#

Hmm, ok. Perhaps we should be adding & 0xFF and not assuming they are 8-bit.

#

That makes more sense @timber mango

timber mango
#

Are you not then just taking the lower 8-bits of a 16-bit value and ignoring the rest?

gilded cradle
#

correct

timber mango
#

This is not correct behavior then.

gilded cradle
#

Right, would you like to open an issue on github?

timber mango
#

For what?

gilded cradle
#

For pointing out that if you pass numbers > 255 then you get unexpected results.

simple pulsar
#

Isn't there a type difference here, e.g. the user passes 123 (an int) or (0,123) (a tuple)

gilded cradle
#

Yes, but if they pass a tuple or list with ints > 255 then it doesn't work right.

timber mango
#

@gilded cradle There is no unexpected result with my code. All bitmasks are 16-bit.

gilded cradle
#

Right your code is fine.

#

I'm just saying the code inside of set_digit_raw could be improved.

timber mango
#

It is working perfectly with everything I have thrown at it.

gilded cradle
#

I'll make a small revision later, but it won't break or change anything that currently works.

timber mango
#

Revision to set_digit_raw()?

gilded cradle
#

yeah

#

so it always works as I intended

timber mango
#

We will have to wait and see what happens then. How exactly did you intend for it to work? Maybe it is working perfectly as is and requires no revision.

#

@gilded cradle As of now, I believe set_digit_raw() will work with any length of bitmask, including 8-bit, 16-bit, 32-bit and 64-bit, or above. Will this still be the case after you make your revison?

gilded cradle
#

It actually won't work correctly now in certain instances. Let's say fo instance you pass in 2 16-bit or 32-bit numbers. It would left shift the first number over by 8 bits (leaving a 24-bit or 40-bit number) and bit-wise OR everything with the result also being 24 or 40 bits. After that, everything is masked off, so the lower 8-bits would be fine, but the upper 8-bits would be the bitwise OR result of the lower 8 bits of the first number and the upper 8 bits of the second number, which is where you would see unexpected results. My revision would just mask things so that it only used the lower 8 bits of each number passed in a tuple or list. If you pass the number outside a tuple or list such as with your animation code, then you wouldn't see any change.

timber mango
#

set_digit_raw() needs to work equally well with all lengths of bitmasks. It has worked perfectly well with all the 16-bit bitmasks I have passed to it. If there are edge cases where this would not be true, then maybe it should be revised to work in ALL cases.

#

You can not throw away 8 or more bits of data and call it good.

#

My problem is here: "My revision would just mask things so that it only used the lower 8 bits of each number passed in a tuple or list."

gilded cradle
#

The thing is, that hardware only works with 1 16-bit number and so if you wanted to pass 32-bit numbers, it still has to do something with them to make it work on the hardware. I already have added the revision, which you can see here: https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/master/adafruit_ht16k33/segments.py#L271

timber mango
#

@gilded cradle hardware we currently have might work only with 16-bit values, but I assure you that future hardware will work with 32-bit and even 64-bit values. Then, your revision will just chop off the high 8 bits of my 16-bit bitmasks and throw it away.

timber mango
#

I just forked and renamed a copy of the Adafruit_Circuitpython_HT16K33 library for my own use under my main Github account.

gilded cradle
#

Hi, the only reason my change would break your code is if you were relying on erroneous behavior to get a specific set of results. However, the way you have described it, you weren't doing that, so your code should continue to run fine.

timber mango
#

@gilded cradle I will just have to disagree for now and leave it for later until I can do my own tests with both your version and mine.

gilded cradle
#

Sounds good. 🙂

timber mango
#

That reminds me, two of my PRs are still waiting for action. 🙂

gilded cradle
#

Yes, I commented on both earlier.

timber mango
#

One still says "Please rebase" and I did not see a comment on the other. I will look again.

#

We already talked about the rebase thing.

gilded cradle
#

You should be able to pull in any changes from the adafruit master and it will remove code that you submitted in another pr and was already merged.

timber mango
#

I have what I need in my own version of the library. I will wait for you to merge your revision before trying my stuff with it.

#

I already did all the pushing and pulling I needed to do. 😉

#

I have much interest in the HT16K33 library because I now own and maintain the micropython version of. 😉

main meteor
#

I've hacked up the Arduino version to add keypad support and two digits per slot.

gilded cradle
#

Hi @timber mango, my revision was already merged a little earlier, so you can test whenever you want.

timber mango
#

I noticed that. I just backed that revision out of my library copy. 😉

#

Why do I have to keep logging into Github to push something from my geekguy_wy (Adafruit stuff) account?

gilded cradle
main meteor
#

You can install an ssh key and configure your ssh client to use it to authenticate.

timber mango
#

I already have an ssh key and have set it into my github account.

#

I have two github accounts, one for just my stuff, and one for the stuff I do for Adafruit.

#

Can different github accounts have different ssh configurations on the same computer?

#

Also two separate users on my computer.

#

I have never had to use any of those methods for my main github account.

gilded cradle
#

Good question. I've only ever used 1 github account per computer. Maybe look into enabling multiple credentials.

timber mango
#

I need to keep everything separated and isolated from each other due to um, issues.

gilded cradle
#

Maybe 2 different git clients or something like a virtual environment perhaps?

timber mango
#

Something is messed up with my geekguy_wy account because I can not authenticate so I can push now. 😦 I just set a brand new ssh key to my geekguy_wy github account.

#

Anyway my head is really wonky and I need my walker just to stay standing now, and my asthma is kicking up thanks to inconsiderate smokers throwing their butts all over. I am going to lay down for awhile.

main meteor
#

Yes, you can have different github setups.

#

Here are some example stanzas from my ~/.ssh/config file: ```
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-tst
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_tst
IdentitiesOnly yes

#

They're both at github.com, but I refer to the github-tst one when I want to use my tst identity there.

#

Smokers can strongly impact my ability to think usefully too.

tulip sleet
manic glacierBOT
#

nested.py:

l = [[]]
l0 = l[0]

print("l[0]", id(l[0]))
print(l0, id(l0))
Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit Metro M0 Express with samd21g18
>>> from nested import *
l[0] 536876704
[] 536876704
>>> id(l[0])
536876704
>>> id(l0)
536896144   # should not be different from id(l[0])
>>> 

In CircuitPython 2.x, MicroPython, and CPython the id() values are the same in the REPL. My guess is that this has to do with making an object long-live...

tough flax
onyx hinge
#

.. calls sd_softdevice_disable() and also resets USB for some reason.

#

hathach did it so I'm sure it's right and needed, but something to be aware of!

tough flax
#

Ok, it's a good place to start - thanks

tulip sleet
#

@tough flax The softdevice doesn't get enabled unless you import _bleio, and it won't use the radio spontaneously. It used to advertise its file editing service, but we turned that off. That is a recent fix, so use 5.0.0.

tough flax
#

Ok - sounds like a plan... Anyone have experience w/using both BLE and WiFi in a tight space? I wouldn't have worried, but recently had a BLE keyboard make my iPhone's WiFi go flaky

timber mango
#

@tulip sleet Why is it called _bleio instead of just bleio? Typically, things that start with an underscore are for internal use only and not to be called directly.

tidal kiln
timber mango
#

Now, I am getting fatal: unable to access 'https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git/': The requested URL returned error: 403 when I try to git push adafruit.

tidal kiln
#

looks like you are trying to push to the adafruit repo, you should push to your fork

#

then make a pull request to submit the changes back to the adafruit repo

timber mango
#

@gilded cradle I just pushed a commit to switch from int() to round() for PR #65 on HT16K33.

simple pulsar
#

@tough flax What make/model of keyboard is it? (I am unlikely to have any useful info. on this btw!)

tough flax
timber mango
#

@tidal kiln Thank you!

timber mango
#

Eeeek, my computer does not like my PyGamer at all. It reboots when I plug the PyGamer in. It will go into a boot loop with the PyGamer plugged in. This is not good.

onyx hinge
#

Get a 1024 x 768, color image of a raccoon face.

timber mango
onyx hinge
#

I wonder what would work best in ulab; or maybe Pillow is better inspiration for image operations? I think the first use case is scaling and resampling thermal camera images, 8x8 or 32x?? size and single component.

timber mango
#

@onyx hinge The GIMP has a nice image scaler.

tough flax
#

NRF52840 Express is the right build for the new NRF52 Sense?

#

Or would it be the Clue? I'm going to try the Express

solar whale
#

@tough flax there is a feather_bluefruit_sense build

tough flax
#

Just found it a bit ago... My code worked with both. And my project is frikkin working 🙂 BTW, thanks for trying on the Solar question.... still not sure of the right answer

half sedge
#

@onyx hinge If you find any easy CP way to let's say "double the resolution" of an image... I would love to get a nicer image from thermal sensor. Raw resolution is 32x24.

onyx hinge
#

<@&356864093652516868> note that most of the US switched to Daylight Saving Time today. This moves the meeting 1 hour earlier in UTC time, so be aware of this if your local time follows a different rule.

stuck elbow
#

oh no

analog valve
#

Im looking to do some signal analysis - like peak detection - on circuitPy - and looking at libraries like: https://github.com/zmzhang/libPeak - but often these require scipy or numpy. Im assuming there is no scipy on circuitpy but if anyone has any tuts or suggestions I'm all ears.

stuck elbow
#

@analog valve take a look a pulseio

#

also, there is some work ongoing for getting FFT libraries working

analog valve
stuck elbow
#

yes

analog valve
#

yes
@stuck elbow thanks 🙂

stuck elbow
analog valve
stuck elbow
#

note that this is new and ongoing work, so expect surprises

analog valve
#

for sure.

manic glacierBOT
onyx hinge
#

@stuck elbow yeah, the time change is another of these disruptive changes that us american types don't think of mentioning in advance. Hopefully we get a partially automated meeting calendar soon. My prototype calls out standard/daylight (winter/summer) time changes, but as we don't have that yet ideally we would have done it in the pinned mention last week.

timber mango
#

My Raspberry Pi 4 is having power issues. 😦 I can not plug my PyGamer in and work with it, because the Pi goes into a boot loop. 😦

manic glacierBOT
arctic violet
#

@timber mango USB-C prob?

lone axle
#

How many Amps is the adaptor that's powering it? Raspi4 is quite power hungry I think

crimson ferry
#

The official adapter is 3A, but on rpi website: "* A good quality 2.5A power supply can be used if downstream USB peripherals consume less than 500mA in total."

timber mango
#

I have my Raspberry Pi 4 powered from an Adafruit 5V@4A power brick. I am still getting under voltage warnings and I do not know why.

lone axle
#

If you have a powered hub maybe that could allow you to plug in the PyGamer and not have it steal enough power to make the Pi sad.

timber mango
#

Yes, that would probably work. I do not have a USB hub though.

#

Has there been any changes to the VL53L0X library within the last two months or so?

lone axle
#

Yes.

timber mango
#

There are a LOT of libraries missing from the 0307 bundle... There are just 28 libraries in this bundle.

lone axle
#

I downloaded a copy earlier today and I'm seeing 220 items in the lib dir

timber mango
#

There are 29 in the bundle I downloaded today.

#

Oh, wait, never mind, my mistake. I was looking at the wrong lib directory.

#

At any rate, my three sensors will not read beyond about 350mm no matter what I do.

#

I have no idea what I am doing wrong.

lone axle
#

What kind of surface is it pointed at? When I was messing with those a bit I noticed that some surfaces were much better at reflecting and were able to get further distances read more consistently.

main meteor
#

What timeout are you using?

timber mango
#

200000

#

I mean 200ms.

#

I am using all different kinds of surfaces.

#
if (USE_VL53L0X):
    vl53l0x = adafruit_vl53l0x.VL53L0X(tca9548a[1])
    vl53l0x.measurement_timing_budget = 200000```
#

I have used these a lot and never had them act this way. I have always been able to get distance readings up to around 1200mm.

lone axle
#

I assume not, but just in case are you 100% certain the breakout you have is not the VL6180X? That one's got a shorter max distance.

timber mango
#

I know. These are all VL53l0X.

simple pulsar
#

Is anyone aware of a fast way of clearing a displayio Bitmap? I'd like to set it all to 0 which is my transparent colour but it's very slow to set all pixels in CP to this. I tried slices of 0 but got a NotImplementedError: Slices not supported

lone axle
#

depending on what you are trying to do sometimes you can use this trick to speed it up a bit: Instead of having a full size bmp changing all pixels one at a time, make a much smaller bmp and then add it to a Group with a scaling factor big enough to make it fit full size. Then when you go to change it there are way fewer pixels to change so visually it appears faster.

simple pulsar
#

I've got a 200x201 bitmap for plotting data and in some cases want to clear it and others clear it to redraw data as a method of scrolling.

#

I might end up "undrawing the data"

lone axle
#

Ah, if you need single pixel resolution to draw other things I don't think the scaling trick can work, though it's still very new to me DavidGlaude taught me how to use it a few days ago.

#

Erasing only the pixels that have been drawn on does sound like a good way to improve drawing speed to me.

simple pulsar
#

Yeah, python is taking 2.3 seconds to clear that Bitmap pixel by pixel so I think I'll try out the undraw.

crimson ferry
#

Why not delete the bitmap and re-create a new one?

#

n/m, silly suggestion, I see what you're wanting

#

if you have idle time in your loop, maybe create a new layer in idle time, before needing it, then slide it in when you're ready to draw new elements? Or use a TileGrid that gets repeated over the bitmap?

simple pulsar
#

@crimson ferry Already tried that. It ran out of memory. It's also a bit messy to re-insert it into the group.

#

It felt like the CLUE had loads of memory but turns out I'm now near the limit unfortunately! I'll look through my code later to see if I can clean it up wrt memory usage but I doubt I can claw much back.

manic glacierBOT
#

I've been using a 200x201 size Bitmap in CP 5.0.0. At the moment this can only be manipulated by setting individual pixels. This is taking 2.3 seconds on an Adafruit CLUE to assign 0 (the transparent colour from my pallete) to each pixel.

I thought I'd try assigning a full size zero array.array but I ran out of memory. I then tried a row by row approach using slices and got NotImplementedError: Slices not supported.

I could do with a fill() method (implemented in C) a bit like the n...

simple pulsar
#

50k disppears when I bring in the clue mega-object ```Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840

import gc
gc.collect() ; print(gc.mem_free())
144736
from adafruit_clue import clue
gc.collect() ; print(gc.mem_free())
92224

stuck elbow
#

that's what you get with those all-singing-all-dancing libraries

#

you can always make your own that only has the things you use

spice bolt
#

Hi! Did someone manage to connect CLUE and micro:bit? I know that micro:bit's radio isn't implemented in Circuitpython. I tried to establish Bluetooth UART connection by using available examples but I was unsuccessful. Code for micro:bit was OK, I tested it with nRF Connect. I'm new to Circuitpython so I'm probably doing something wrong. If you have working code can you share it? Thanks.

manic glacierBOT
#

@arturo182:

Oh! I am back, I have got to the grip with it at last. Managed to flash my board with various firmware using:
1.) NXP MCUXxpressoStudio
2.) Keil ULINK2
3.) JTAG (bought on eBay from China)

Also managed to build those firmware on my Ubuntu Linux box.
I had work on it with MicroPython+Zephyr-OS (Problems with RAM ==> 128kb) but I am thinkering with the 128 Mb QSPI Flash to get it to work with this. I will do Thread-OS and openMV later.

Alas the EVK board is now $39.50 ...

manic glacierBOT
#

If I inspect a huge array in REPL with the serial console output active on the LCD but control-C the output half way through then the serial console over USB continues to work fine as expected but the LCD screen freezes and no longer updates.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>>
>>>
>>> bigarray = [12345] * 10000
>>> bigarray   # press control-c after a second ...
raven canopy
#

PSA: another round of library patches is starting, to update .pylintrc. again, open PR conflicts should be minimal.

raven canopy
#

patches complete...

slender iron
#

@spice bolt uart should be possible. radio won't work because circuitpython uses ble to implement the radio module while micro:bit takes over the whole radio

ivory yew
#

anyone know off the top of their heads if its possible to turn off circuitpython's serial port echoing?

manic glacierBOT
manic glacierBOT
#
timber mango
#

@ivory yew To USB or other?

timber mango
#

@ivory yew Usually it is the application or script that handles whether characters are echoed down a UART (serial port). If you are using a script you got somewhere else, look in it for lines that are sending received characters back down the port. Comment those out and you have turned off serial echoing. 🙂

manic glacierBOT
slender iron
#

@ivory yew do you just want to turn off the echo or the whole thing?

simple pulsar
#

On a vaguely-related topic, is there any difference between print() and print to stderr in CP, e.g. print("Boo!", file=sys.stderr)

timber mango
#

She just wants to turn off the echo.

#

@ivory yew Usually it is the application or script that handles whether characters are echoed down a UART (serial port). If you are using a script you got somewhere else, look in it for lines that are sending received characters back down the port. Comment those lines out and you have turned off serial echoing. 🙂

#

@slender iron I forgot to ask if she was using a script or an application.

#

I wish I had better lighting here. Then maybe I could see my solder joints better.

ivory yew
#

Script. It's mine. I'm talking to it from Web serial and from pyserial. Both echo back the message I send.

slender iron
#

there is a repl mode that doesn't echo

timber mango
#

@ivory yew Are you sure pyserial is echoing?

slender iron
#

it's circuitpython that is echoing I think

timber mango
#

Ahhhhhh.

#

@slender iron In my opinion, Circuitpython should not be doing stuff like echoing.

slender iron
#

if it didn't echo you wouldn't know you are typing things in

timber mango
#

That is different. I am talking about in scripts.

slender iron
#

that is how input() works in cpython for the same reason

timber mango
#

input() is designed to talke user input though, so it should echo.

slender iron
#

right, when is it echoing and shouldn't?

timber mango
#

That is a question for @ivory yew.

#

I have never had any problems with echoing when writing scripts that use the serial port (pyserial).

#

I do not know about the UART stuff though because I have not used that yet.

#

It is probably a setting in WebSerial.

ivory yew
#

I'm using input (), afaik that's the only way to get data from USB serial.

slender iron
#

you can also read from sys.stdin but it'll still echo

ivory yew
#

I figured as much

slender iron
#

we have an issue to create a second serial port over usb

#

for user data only

ivory yew
#

It's not that big of a deal- I can ignore the echo in my scripts, but it's just annoying enough to ask about. 🙂

slender iron
#

it is dependent on dynamic usb descriptors (which would be really nice)

ivory yew
#

I would love dynamic USB descriptors

slender iron
#

need a link to the issue?

ivory yew
#

Nah

slender iron
#

kk

simple pulsar
#

@slender iron Does sys.stdin read allow 8bit, e.g. ignores control-C as an interrupt?

timber mango
#

@ivory yew I open the port as a file and use file.readline() or file.read().

#

No echoes there. 😉

slender iron
#

@simple pulsar it still respects control-c

#

which is why a second cdc connection would be nice

simple pulsar
#

If I control-c time.sleep() on 5.0.0 on a CLUE then subsequent time.sleep() return immediately regardless of value. Is that a known bug?

timber mango
#

@ivory yew ```python
SERIAL_PORT = "/dev/ttyACM0"
feather = serial.Serial(SERIAL_PORT)
print()
print("Using port {0}".format(feather.name))

decLine = ""

try:
line = feather.readline()
decLine = line.decode("ASCII")

while (decLine != "\n"):
    print(decLine.strip())

    if ('Started' in decLine):
        st.write(decLine)
    elif decLine[0] == '"':
        if decLine.find('"C"'):
            chc.write(decLine)
        else:
            csv.write(decLine)
    elif (decLine[0] == '{'):
        if decLine.find('"C"'):
            chj.write(decLine)
        else:
            json.write(decLine)

    line = feather.readline()
    decLine = line.decode("ASCII")

finally:
closeFiles()```

wraith tiger
#

Where can I find the repo of the learn guide texts? I noticed a typo and wanted to create a pull request to fix it but I only see a repo for the example code, not the text itself.

timber mango
#

That is code I use to split a data file into several different files based on content.

idle owl
#

Oh

#

Reread what you said. There isn't a repo.

#

It's an internal system that hosts the Learn guides. They're not on GitHub.

#

The only thing to do is submit feedback through the form link on the guide page or email support@adafruit.com

timber mango
#

Maybe there could be a #feedback-on-guides channel or something similar.

#

A #help-with-guides maybe?

lone axle
#

I would think we'd want them to go into one of the existing #help-with channels that matches what they are working on most closely.

timber mango
#

Not necessarily.

wraith tiger
#

@idle owl OK, thanks.

idle owl
#

<@&356864093652516868> Meeting in ~15 minutes. Here's the notes doc - please put your Hug Reports and Status updates in even if you'll be attending, it's super helpful! Thanks! https://docs.google.com/document/d/1kB6iS2NCVJH3PPK1s7JlGY7L57boeBb2KYHyZr4-aaY/edit#

timber mango
#

There should be a common place Adafruit people can go to in order to get feedback on learn guides.

idle owl
#

@timber mango We already have a system in place to deal with feedback. Adding another place to look would add a lot of work to everyone involved with guides.

timber mango
#

Sending email or using the forums?

idle owl
#

Sending email or using the feedback link located in the lower left corner of every guide page.

ivory yew
#

Will probably miss the meeting again. Group hug to all. 💜

idle owl
#

@ivory yew Added to the notes 🙂

simple pulsar
#

@timber mango The feedback thing on the page has some logging and reporting, those two aspects aren't obvious to the user.

serene warren
#

Online Meeting - check, avoiding others (reduce the chance spreading disease) - Check. Typical day in the life of an ISTJ 🙂 hey y'll.

simple pulsar
modern wing
#

Hello all you awesome folks -- happily lurking today 🙂

serene warren
#

Lurking

timber mango
#

Just lurking today. I am not well.

modern wing
#

Loud and clear Jeff

onyx hinge
#

loud? or too loud?

serene warren
#

Sounded good and clear.

modern wing
#

What @serene warren said 🙂

raven canopy
#

🎉

serene warren
#

Yes

modern wing
#

There goes our chance at a CircuitPython Chipmunk music album.

manic glacierBOT
#

time.sleep() seems to misbehave if it is control-c'd in REPL:

Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>> import board, time
>>> board.DISPLAY.auto_refresh = False  # can affect timing
>>> time.sleep(3)
>>> time.sleep(3)
>>> time.sleep(10)  # control-c after a few seconds
>>> time.sleep(1)
>>> time.sleep(10)
>>> time.sleep(100) # last three returned immediately
>>> t1=time.monotonic() ; time.sleep(100) ; print(time....
timber mango
#

@modern wing Maybe we could go for a Circuitpython Chiptunes album.

wraith tiger
#

Lurking while eating lunch. 🍔

timber mango
#

lurking today

serene warren
#

Being first isn't always being best, like in pancakes.

timber mango
#

Or spaghetti. It is often better the second day.

tiny oriole
#

in my experience, the skillet always gets too hot after a while so they all start burning. haha

serene warren
#

SOME people can apply rational to anything 🙂

tidal kiln
#

lurking

wraith tiger
#

I have a big griddle for pancakes - it goes across two burners.

stuck elbow
#

lurkitty lurkitty lurk

simple pulsar
#

lurking some of the time

river quest
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

CircuitPython is empowering makers to make businesses. Arturo has a successful Tindie store, selling over 400+ CircuitPython powered Serpentes. Serpente is a tiny CircuitPython development board, p…

turbid radish
#

lurking

river quest
#

Find your way home a CircuitPython GPS Locator - The CLUE finder
https://back7.co/home/weekend-project-find-your-way-home-with-this-circuit-python-gps-locator

#

IoT Design Week with Microchip's "Wizard of Make" Bob Martin and Adafruit. We'll be on 6pm to 7pm ET on Tuesday March 10th, 2020 (video). Expect to see a lot of CircuitPython!
https://youtu.be/fu37Uf-CXNE

Day 2 - Machine Learning and Artificial Intelligence – Afternoon with Guests from Adafruit

Register for IoT Design Week at www.microchip.com/IoT-Design-Week

Join us for a special afternoon session to talk about artificial intelligence with Adafruit.

Cloud
https://io.adaf...

▶ Play video
#

We are kicking off "EYE on NPI" with the Espressif ESP32-S2 SoC (video). What is EYE on NPI? The acronym NPI stands for New Product Introduction and sometimes you'll also see NPD (New Product Development). EYE on NPI will showcase, spotlight, and discuss the latest new product...

▶ Play video
#

thanks everyone for building a solid and stable community and company like adafruit, there is a lot of uncertainty ahead however, we'll get through this together (we'll be keeping everyone updated as things evolve)

serene warren
#

Rock on Adafruit!

tulip sleet
#

@slender iron I closed the zero-issue 4.x and 5.0.0 milestones just now; thanks for noticing!

slender iron
#

thanks!

gilded cradle
#

no

lone axle
#

I don't hear

cursive condor
#

sorry

serene warren
#

nope

cursive condor
#

so like I wrote

#

collective hug for 5.0.0

turbid radish
#

Group hug to you all today for all your work & support

swift arrow
#

group hug for 5.0.0!!

turbid radish
#

Any time @onyx hinge

slender iron
#

@onyx hinge doesn't need to be thorough. just want to make sure I'm going the right direction

#

@solar whale any idea if the nrf24l01 will talk to the micro:bit?

#

@solar whale sounds like a good plan 🙂

stuck elbow
#

@slender iron I tried to make it work, I failed miserably

#

in theory the protocol is supposed to be the same, in practice it was either bad quality of the Chinese modules I had, or some subtle difference in the modulation

slender iron
#

kk, good to know

solar whale
#

not sure about the microbit -- sound unlikely given @stuck elbow comment, but I'll look as well

slender iron
#

not worth too much time

stuck elbow
#

I didn't have an SDR at the time to see what's wrong, but it basically only received one in 10 000 messages, and that was mangled

wraith tiger
#

I wonder if something like an SDR would be helpful to sniff the traffic of two microbits talking to each other...

stuck elbow
#

someone who knows what they are doing and has an SDR could probably figure it out in 10 minutes

#

@wraith tiger totally, but it's 2.4GHz

lapis hemlock
#

I didn't know about the daytime saving, so I am late, therefore, only lurking.

slender iron
#

I don't know radio well enough

stuck elbow
#

@wraith tiger the cheap SDRs don't go that high

slender iron
#

@lapis hemlock sorry about that! we're in status updates if you want to jump in

lapis hemlock
#

I have been working on internals, so not too much to report.

slender iron
#

kk

#

we should chat about 5.1 release plan in the weeds

lapis hemlock
#

OK. I am listening.

onyx hinge
#

@cursive condor do you want to try your mic again or shall I read your notes?

slender iron
#

cool, thanks!

cursive condor
timber mango
#

I do not see anything else I can work on right now outside of the HT16K33 library.

onyx hinge
#

@lapis hemlock do you want to give any status updates?

lapis hemlock
#

Hm, I don't know.

serene warren
#

I was on submarines for the better part of 12 years. Cabin fever is a way of life for me. 🙂 stay healthy Scott.

ionic elk
#

I'd be down if I'm out in the boonies

#

which I might be this month

slender iron
#

I did the tutorials for Offworld Trading Company (free on Epic Games) this weekend and the current oil pricing situation reminded me of it. 🙂

timber mango
#

I need to put something a little beefier than a piezo buzzer on my robot for sound. There is not much room to add new stuff though.

slender iron
#

good idea (clue + cricket) @tiny oriole

tiny oriole
wraith tiger
timber mango
#

@slender iron Can CLUE use the existing CRICKIT for micro:bit?

slender iron
#

should be able but I'm not sure how much it's been tested

fierce girder
#

Oh!

#

Daylight savings

timber mango
#

DST should be slapped in oblivion!

fierce girder
#

We are still normal time in Germany

gilded cradle
#

I've done that before

slender iron
#

ya, they moved it for some reason

wraith tiger
#

Yeah, the US goes on Daylight saving two weeks earlier and off two weeks later.

slender iron
#

more time to get lower power for the badge 🙂

simple pulsar
#

I think DST change was an energy saving measure too!

fierce girder
modern wing
#

It's unfortunate the in-person conference had to be changed, but it's a smart decision given the situation, and we all support you for it.

Let us know how we can help -- other than enjoying the conference in any form it might take oshw

fierce girder
#

"All attendees who purchased a ticket will receive a full schwag bag who wants one! If you would like a complimentary schwag bag as a sponsor please complete this form by March 16"

timber mango
#

@slender iron The Raspberry Pi 8.0 MP Camera would be a great first camera for machine vision, etc. That is what I am using on my Jetson Nano. 😉

fierce girder
#

belated hug report to @pastel panther for joing our OHSummit wrist badge team and helping with CircuitPython apps, and hug to Nate and team at SparkFun for finishing production and testing the badges
(I'll add to notes)

modern wing
#

@fierce girder I've been following events here on the discord and the website, but I didn't get any email notification.

For those not closely following social media, are you able to send an update via Eventbrite to those who purchased a ticket?

pastel panther
#

thanks Drew 🙂 Glad to help

fierce girder
#

I'll check. We decided on a call about this time yesterday to cancel the physical event, we just sent out more information to the sponsors, we should hopefully be getting more information out today

wraith tiger
stuck elbow
#

cool

simple pulsar
#

I'm not following all of this but if it's not obvious the first F in FFT is for fast so a fast FFT might be confusing.

tulip sleet
#

faster fast fourier transform

wraith tiger
#

faster^2

slender iron
#

extra. fast fourier transform

wraith tiger
#

ludicrous speed!

simple pulsar
#

fast and furious fourier transform (but get the legal dept. ready for that one)

wraith tiger
#

We've gone to plaid!

ionic elk
#

Freakin' Fast Thingamajigger

raven canopy
#

Late phone keyboard example. 😄

def foo (
    bar,
    baz=foobar
):
slender iron
#

👍

onyx hinge
#

at least they didn't put the comma in the wrong spot

wraith tiger
#

Europe catches up in two weeks...

onyx hinge
#
    bar
  , baz=foobar
):
serene warren
#

Thanks to all for the participation.

turbid radish
#

Thank you all!

solar whale
#

👋

wraith tiger
#

👋

onyx hinge
#

@slender iron silly me, of course I have a teensy!!

idle owl
#

Dropping off. Thanks all!

gilded cradle
#

I'm gonna drop off too

tiny oriole
#

dropping off as well

gilded cradle
#

thanks everyone

raven canopy
#

Once we get to re-entrant....it gets real difficult.

solar whale
#

uh oh -- dog has given an ultimatum -- time for a walk -- Have a great week all! 🦮

simple pulsar
#

Maybe the API dumps memory to flash for the suspend?

onyx hinge
#

🐱

#

signing off

simple pulsar
slender iron
#

stm32l15x and stm32l16x have up to 80k ram

manic glacierBOT
slender iron
#

stm32l4x tops out at 320k ram

ionic elk
#

is that enough?

#

The L4s and L5s have a lot more than I thought

slender iron
#

it wouldn't be super fun but could be good for small things

#

l4+ is 640 kbytes ram

ionic elk
#

right

slender iron
#

l5 is 256k

#

price is the other consideration

ionic elk
#

L5 seems security focused

slender iron
#

ya

ionic elk
#

do we have any security ambitions long term?

slender iron
#

I don't think we'd do the work directly

#

but if folks PR it then I'd merge it

ionic elk
#

Makes sense. I just ask because security seems to be a parallel feature for a lot of ST stuff.

#

Usually they have an extra mirror version of the chip with hash/crypto

lapis hemlock
#

@onyx hinge Jeff, a lot of modules declare functions (MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN), but some don't. Are these remnants of older code, or does CP require them? If so, why is this requirement not universal?

onyx hinge
#

@lapis hemlock I don't know!

slender iron
#

I'd only expect the declaration if the functions are used elsewhere

#

micropython leaves assembling the module itself to a port usually so it'd need to be declared then

lapis hemlock
#

@slender iron @narrow dirge But functions are parts of modules, and in this sense, local. (I am talking about functions that are python-facing, and not internal.)

#

I think I was mistaken: all functions are declared, so that would confirm Scott's reasoning.

onyx hinge
#
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
lapis hemlock
#

Does linalg work? I think it doesn't, and the reason for that is the missing declaration.

#
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0

@onyx hinge You have one more port to test, right?

onyx hinge
#

@lapis hemlock yes I can't find the stm32 feather board. It's vexing me.

#

I found an unopened one but I know I have one with headers soldered already

lapis hemlock
#

I have tested it on the pyboard. I don't know, whether that counts.

#

I'll fix the linalg stuff.

fierce girder
#

re: my status update, I posted over in #ohsummit20 , but you were registered for the event, you get an email by end of today and a form to fill out to get the goodie bag shipped to you.

lapis hemlock
#

@onyx hinge do people need det. Someone has told me that the determinant always pops up in proofs, but no-one actually uses (computes) it.

onyx hinge
#

in what way would linalg "not work"? Missing declarations is usually a compile time error, and the software does build last I checked

lapis hemlock
#

in what way would linalg "not work"? Missing declarations is usually a compile time error, and the software does build last I checked
@onyx hinge I couldn't call functions from the module. However, in the meantime, I have patched it, and pushed the code to the spectrum branch. You can merge it, if you think it is OK.

#

On the other hand, if I comment out the declarations now, and compile the firmware, the module works as expected. Perhaps, we don't need the declarations after all. Go figure!

#

I ran make clean before compiling, by the way😀

onyx hinge
#

hm spresense port is not pleased. arm-none-eabi-ld: build-spresense/libmpy.a(objmodule.o):(.rodata.mp_builtin_module_table+0xe4): undefined reference to `ulab_user_cmodule'

lapis hemlock
#

I am going to log off for today.👋

onyx hinge
#

see you

#
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
#
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
#

okay I think that's the lot

manic glacierBOT
tulip sleet
#

@onyx hinge which PR would make sense to merge first? Does it matter?

onyx hinge
#

@tulip sleet I think they're independent

tulip sleet
#

i will wait for the multiboard one first, because it's less likely to cause issues for forks later. So I'll wait for that one before merging.

#

i'm just thinking about the issues we had with some tinyusb updates with sub-submodules, which may not be an issue here, but...

manic glacierBOT
onyx hinge
#

yeah this will need "submodule sync" or may even make some existing clones not work right without individual attention. frustrating, and maybe enough reason to keep our own fork of ulab(?)

#

huh puzzled by this test failure on the f-strings PR I revived. can't make it happen here.

simple pulsar
#

For displayio is there any reason why refresh(minimum_frames_per_second=0) would not refresh the screen? I've got a bug somewhere where bitmaps don't update. Trivial code works but the real code doesn't 😦 Does that code attempt to check that a refresh is actually needed based on changed data?

manic glacierBOT
onyx hinge
#

I may pop back in to look at the PR status but stepping away for now

indigo wedge
#

is there a recording of today's meeting? 🙂

tulip sleet
#

SMALL_BUILD vs FULL_BUILD may not be enough. I was thinking of 192kb_build, 256kb_build, full_build

timber mango
#

What are they asking for with "Enter a valid origin, including the https, http, or chrome-extension prefix?" I am signing up to try WebSerial.

raven canopy
#

@tulip sleet i was wondering if any movement has been made on that. been on the lookout for the PR. with the STMs out in the wild, i'd like to get the support matrix updated. 😄

simple pulsar
#

My "no updates" issue with displayio refresh goes away if I do a refresh(target_frames_per_second=1, minimum_frames_per_second=0) - the default rate of 60 appears to stop this manual refresh from ever working with what I'm doing.

manic glacierBOT
tulip sleet
#

@raven canopy if @onyx hinge doesn't need to do it, I can still do it separately. But it's because STM32 doesn't use those _BUILD options, right?

onyx hinge
#

I don't know how my PR will affect the feature matrix. @raven canopy leave me more information on the PR if I should do something.

manic glacierBOT
#

I have been trying to do a manual refesh and cannot find a combination that works on 5.0.0. I've got some code that takes between 10-30ms roughly to do some stuff and update the Bitmap/etc and I'd then like to update LCD. There's no point updating it at 60Hz (16.667ms) as that'll end up drawing half an update some of the time.

If I just run self._output.refresh(minimum_frames_per_second=0) then the first one returns True and updates the screen and nothing after that updates the screen ...

crimson ferry
#

I used Teensy Loader to load the CP .hex and that worked just fine. There's also a .UF2 on circuitpython.org ...is there a workflow for that?

#

Also, in the intro video, ladyada has a Teensy-to-Feather adapter... is that custom, or does the one in the shop work with 4.0? (pinouts look similar, at least on the long sides)

manic glacierBOT
#

I think the correct thing would be to have the later id of l[0] be 536896144. I don't mind that the ids themselves change after import but we should create two separate objects.

I do agree that this is a long lived issue because we assume that only one reference of module variable exist. (We recurse from the module dict down and don't look elsewhere for references.)

I don't think this is urgent and would argue for it to be "Long Term" because there is a simple and easy workaround: Jus...

timber mango
#

What do I enter for "Web origin" (Error: Enter a valid origin, including the https, http, or chrome-extension prefix.)

manic glacierBOT
#

@kevinjwalters I don't think we need to reopen this. It sounds like you want target_frames_per_second=30 when your frames take up to 30ms to compute.

To reiterate how it works:

  • minimum_frames_per_second dictates when refresh will raise an exception for being called too infrequently. 0 turns it off entirely. It doesn't impact whether a refresh actually occurs.
  • target_frames_per_second dictates two things:
    1. If the time between the last refresh call and this one was greater...
manic glacierBOT
slender iron
#

@crimson ferry I don't think the UF2 bootloader for imx rt is as mature as CircuitPython is. You can find it here though: https://github.com/arturo182/tinyuf2

crimson ferry
#

Thanks!

manic glacierBOT
#

@tannewt Assuming you mean 1000/30=33.3333ms? I can't exactly predict the time between frames so I'm not sure if that will always work, e.g. I think I'm back to no refreshes if it takes 35ms? As discussed previously, CP isn't predictable on timing. This seems like a needless risk?

Also, I'd like to do some useful processing in the application rather than have refresh() pause until a fixed time duration before returning.

Yes, correct. You'll be fine if it's only over the frame rate...

tough flax
#

Frustrating power problem (separate from the solar stuff)...

#

When my battery dies down, my NRF52840 Sense goes into safe mode

#

When power is applied, it doesn't reset

#

I have a measurement on VBAT, so I can tell when it's low... but I can't figure out what to do at that point....

#

I would prefer it just die

#

Is there a recommended approach here?

timber mango
#

@tough flax So, you want the nrf52840 Sense board to turn itself off, right?

tough flax
#

Until power is restored

timber mango
#

Yes, I know. Hmmmm.

tough flax
#

And then I want it to start up 🙂

#

If the battery dies completely I'm fine

#

but it doesn't... once in safe mode, it doesn't drain fast enough to kill the battery

timber mango
#

If it shuts itself off, there would not be any way for it to turn itself back on.

tough flax
#

So, I didn't want to get into the solar part, but it's kind of key - the sun will come up!

#

If the battery doesn't make it through the night, I'd still like it to resurrect in the morning

timber mango
#

Oh, yes, there is that. How about if it just goes into a very low power mode until it is charged up again?

tulip sleet
#

@tough flax Could you file an issue? We could probably make the brownout detector not go into safe mode, optionally.

tough flax
#

Sure

timber mango
#

@tulip sleet Why do we even have a safe mode? It has only managed to irritate me.

tulip sleet
#

i'm not sure if it's going into safe mode on power down or power up. Is that happening when you apply power again with USB or a fresh battery, or is it with the solar cell rechargingthe battery.

#

so bad things won't happen like scrambling your files

timber mango
#

It looks like his device is going into safe mode when the battery voltage goes too low.

#

I hate safe mode. It is always causing me irritation and stress.

manic glacierBOT
#

While I'm not to trying to solve a solar-specific problem here, I have hit a problem on a solar project that seems like it would be an issue in other settings.

When my nrf52840 Sense feather's battery drains down, CP goes into Safe Mode. In that mode it doesn't draw much power, so the battery never completely dies (I mean it will but very slowly).

While in this mode, if the power is restored (i.e. the sun comes up & starts charging the battery), the feather never resets... even though ...

tough flax
#

Yes it is going into safe mode on the way down... that said, it might have flickered and try to restart - no way for me to tell really

tulip sleet
#

Perhaps it browns out due to higher current draw due to radio transmission, goes into safe mode, and then the radio is off (because code.py is not running). So it never powers down completely. If the battery were completely drained it would do a hard power-on reset and would not be in safe mode. We don't remember safe mode in flash or anything like that.

timber mango
#

@tulip sleet When I have to deal with safe mode, it seems to be when I have pulled the USB cable out without ejecting the board properly. That really annoys me because it will not come out of safe mode gracefully after that.

tough flax
#

Right @tulip sleet - that's what I wrote up in the issue 🙂

timber mango
#

It seems to be responding to a sudden loss of power in my case and low power in @tough flax's case.

tough flax
#

I liked the solution I suggested - but I don't know if we actually have code running in safe mode that could check for power restoration

tulip sleet
#

nope, nothing is running in safe mode that would do that. We do have microprocessor.voltage, which measures the core voltage. You could check that periodically and if it's noticeably lower than 3.3v, stop what you're doing. The brownout voltage is 2.7-2.8v. But that doesn't solve the problem of hitting the brownout voltage. So I'm thinking about what to do in that case. Safe mode could check in the background about whether the voltage is back up to close to 3.3v, and that point do a hard reset.

#

there are several uses for safe mode. One is when there's an unexpected system error, another is brownout. All the reasons:

  BROWNOUT,
  HARD_CRASH,
  USER_SAFE_MODE,
  HEAP_OVERWRITTEN,
  MANUAL_SAFE_MODE,
  MICROPY_NLR_JUMP_FAIL,
  MICROPY_FATAL_ERROR,
  GC_ALLOC_OUTSIDE_VM,
  PROGRAMMATIC_SAFE_MODE,
  NORDIC_SOFT_DEVICE_ASSERT,
  FLASH_WRITE_FAIL,
  MEM_MANAGE,
#

most of these are "something really bad happened in the code", only brownout and user-requested safe mode are really not a code error

manic glacierBOT
#

Thinking about this, perhaps we can add some hysteresis to the process, and not go into safe mode on a brownout. Instead, if we get a brownout interrupt, we should wait for some period of time and check the voltage again. If the voltage is normal (3.3v) we can pretend that it was like a hard reset. If the voltage is still low, then we can loop and check again after some period of time. Eventually either the battery will drain completely, or the power will be restored to normal.

This mode m...

onyx hinge
#

frustrating: https://github.com/actions/checkout/issues/23 checkout v1 is buggy and won't be fixed, checkout v2 doesn't support submodules https://github.com/actions/checkout/issues/81 -- catch 22.

tulip sleet
onyx hinge
#

that would be nice

tulip sleet
#

it sounds like it might be soon. There are other issues as i mentioned: we have to override the shallow checkout they do by default

hazy fractal
#

yes very nice

#

how are you today

raven canopy
tulip sleet
#

@raven canopy well, it makes sense to have a more board-family category for medium-sized boards, so we don't have to mark every M0 board as not being capable of ulab (assuming that's necessary), so good idea to bring it up

raven canopy
#

agree, 100%.

lone axle
#

Anyone else happen to be around and doing anything with GitHub getting super slow speeds?

#

Trying to clone and getting ~30KiB/s or less. Everything else on the internet seems normal speed

main meteor
#

I was cloning the RASA examples and it took forever, and they aren't that big.

lone axle
#

Ah, this repo is 30mb, just noticed some photos in the docs folder. But even for that the current speed seems like snails pace.

timber mango
#

@lone axle I have been using Github, but I would not notice if it was slow or fast. I have to depend on my phone for internet access. 😦

#

My configurable script has grown to 959 lines, with 31 lines of comments at the very beginning and few other comments.

#

There are probably more blank lines than most people would use though. 😉 🙂

manic glacierBOT
timber mango
#

Greetings!

mellow turret
#

good morning!

timber mango
#

I have my configurable sensor script running. The current temperature is 72.2°F (22.3°C), with a relative humidity of 46.3%.

stuck elbow
#

finally the PewPew M4 is on sale

plucky flint
#

congrats @stuck elbow

cursive condor
#

so ulab is available in S3 builds ?

tulip sleet
#

as soon as the PR builds finish

onyx hinge
#

This extends it to stm32, sprsense, and imxrt

#

It has been in samd51 and nrf builds for some time

tulip sleet
#

doesn't fit on M0 builds, so not on M0

onyx hinge
#

And there may be non-express builds that disabled it to.

#

M0 doesn't have fpu anyway, I think

cursive condor
#

I downloaded yesterday's build for monster M4sk (samd51j19) and it was not available... or did I make a mistake somewhere ?

#

I did a mistake I guess

#

yeah nevermind, i didn't copy the latest downloaded .uf2 file.

tulip sleet
#

np, there are a ton of files. My Downloads folder is filled with various builds 🙂

cursive condor
#

so I will try to speedup my last fractal drawing

#

naive implementation : 51 s

#

optimised without ulab : 25.8 s

#

and another question : is float single precision or double ? in the doc they said it depends... how can I check that ?

tulip sleet
#

it's single precision

#

I just confirmed this

#

the M4 boards have hw single precision. We use an encoded version that is only 30 bits, so it has 2 bits less mantissa precision than single-precision fp

#

the lower two bits distinguish pointers, ints and floats

#

(actually ints are 31 bits, and then if not int, 2 bits are used to distinguish the others)

cursive condor
#

thanks a lot. It's an arduino limitation, or is it a circuitpython choice ? (BTW I understand it's memory savy)

tulip sleet
#

It's a circuitpython choice. MicroPython provides a number of choices for object representation. We could have encoded floats, 32 or 64-bit boxed floats (requires memory allocation), and single vs double precision. We chose the most memory efficient

The hw only supports single. If we had double, it would have to be software fp, which is slower

onyx hinge
#

@cursive condor maybe code like this can be adapted to ulab?

tulip sleet
#

and also requires the double fp library to be included, which is quite large. We went to some effort to remove all inadvertant double precision operations from the code, which saved several thousand bytes (we had some by accident due to implicit conversions).

cursive condor
#

@onyx hinge yes, I've read about optimising mandelbrots, but it seems numpy is not faster than naive implementation

#

I'll give it a try, it take a few minutes to draw 240x240 ... but the main limitation I saw with that was the single precision float that limit the XRADIUS value

#

but today I have another fractal to play with : quasicristal : for each pixel it compute a square root, + a for loop with a cos() and a sin() in it.

slender iron
#

I hate safe mode. It is always causing me irritation and stress.
@timber mango Please be aware that some of us worked on features you hate. Safe mode is there for a very good reason. It's there so that if the user code causes something very bad to happen, you can still access your code to change it (by not running the very bad user code.) If you are accidentally in safe mode simply hit reset and you'll start up normally.

cursive condor
#

@tulip sleet thank you very much for the explanations. I'm diving deeper and loving that 🙂

timber mango
#

@slender iron I understand why safe mode is there, and it should be there. I was just expressing some frustration I have when my boards go into safe mode. In quite a few cases, just resetting the board does not bring the board up normally. Sometimes, I have to blitz the file system and reload the board (after I back it up), and even then the board will not come up properly. This all happens when I have not even changed the code and it was just running perfectly before going into safe mode.

slender iron
#

Those sound like bugs. If you can reproduce them please file issues about it. But please beware of the words you use to describe your frustration. Words like "hate" kill the desire to work on something open source for me and others.

timber mango
#

@slender iron I apologize for using the word hate when describing my frustration. That was not appropriate. 🙂 😉

slender iron
#

Thanks! I appreciate you using CircuitPython and letting us know what it isn't working well.

timber mango
#

I love Circuitpython and I only want to help make it better. That is why I am here. I just wish I could work on more stuff, but I do not have many of the necessary sensors and boards to test my work. I refuse to work on something that I can not test. 😉

idle owl
#

@slender iron Here's an odd one. https://learn.adafruit.com/zelda-master-sword/software is running on CircuitPython 5.0.0. I can't figure out why. It should be requiring audiocore but I'm print debugging it and it's getting past audioio.WaveFile. I still haven't dug up a speaker so I'm not sure if it's playing the audio or not, but the code sure thinks it is. Is there something in place to deal with backwards compatibility that I don't know about? Or is this as odd as it seems.

Adafruit Learning System

Make a light up master with sound effects and glowing light beams!

slender iron
#

looks

#

it should be changed for the future when we turn audioio_compat off

idle owl
#

Fair enough. That's mildly confusing. I'll update it then.

slender iron
#

Ya, I agree but some folks want backwards compatibility for a bit.

manic glacierBOT
#

I've run into this before too. Would be nice to have.

Just curious - how are you currently doing your fill? It's slightly more efficient to set via straight index vs. (x, y) tuple. But neither of these totaled up to 2.3 secs.

TEST CODE

import time
import displayio

WIDTH = 200
HEIGHT = 201
COLORS = 255

bitmap = displayio.Bitmap(WIDTH, HEIGHT, COLORS)

start = time.monotonic()
for p in range(WIDTH*HEIGHT):
    bitmap[p] = 0
delta1 = time.monotonic() - start
...
idle owl
#

Thanks for looking into it for me

slender iron
#

np 🙂

idle owl
#

Also makes it difficult to test to ensure that you're using audiocore properly. I understand needing the compatibility though.

slender iron
#

I agree. It'll make it easier when we release a 6.x pre-release and turn it off

idle owl
#

Noted. Thanks.

slender iron
#

(so don't worry too much until then)

idle owl
#

Right.

timber mango
#

@indigo wedge I have been thinking about Serpente. It seems like this would be an ideal board to use in creating custom HID keyboards and controllers. It could be used to remap controller buttons into anything you want to send to a computer. If it had wireless, such as Bluetooth, any Bluetooth compatible controller could be paired with it and remapped. Actually, any Bluetooth compatible keyboard could also be paired and remapped. 🙂 😉

indigo wedge
timber mango
#

@indigo wedge That is too bad. I have one of the Bluefruit SPI Friends here. Maybe I can connect that to one of my M0 or M4 boards and try some of this stuff out. The ItsyBitsy M4 would be ideal for this if I can make it work.

ionic elk
#

@indigo wedge what kind of monitor is that

indigo wedge
#

my laptop monitor

ionic elk
#

gotcha looks kinda transflective or reflective in your gif so I thought it might have been something unusual.

arctic violet
#

What micro are people using for custom keyboards?

tiny oriole
#

there is a "make your own keyboard" example out there somewhere based on the Atmega32u4.

stuck elbow
#

samd21 recently

#

I made 2 with atmega32u4 as well

#

I want to try samd11 or samd9 one of these days

tiny oriole
#

i have yet to make a full keyboard that functions as a keyboard though. everything ive made thus far is more of a controller device for android that happens to send its messages as keyboard keystrokes.

stuck elbow
#

it even runs circuitpython

#

(though I did make a custom build to make the capslock work)

timber mango
#

I am going to have to use my tablet for awhile so my Raspberry Pi 4 can cool down. Even with it being in the heat sink case, it can not run 24/7 without overheating. I will have to start shutting it down when I am done using it for at least 30 minutes. Unfortunately, this does not happen often.

arctic violet
#

TIM issue?

#

@stuck elbow cool thank you

onyx hinge
#

@arctic violet I used kmk and an nrf52840 itsy bitsy in my custom keyboard https://github.com/KMKfw/kmk_firmware/ https://www.thingiverse.com/thing:4129809

#

kmk is perhaps over-engineered but it works great

timber mango
#

I just connected my Bluefruit BLE SPI Friend to a Feather M0 RFM69 board. There is also am LSM303DLHC breakout and a NXP FXAS/FXOS IMU connected. All I need now is a WiFi FeatherWing...

manic glacierBOT
timber mango
#

So far, I am not able to load CircuitPython on to either of my Feather M0 RFM69HCW boards. The command I am using is: bossac -p /dev/TTYACM0 -e -W -v --offset 0x2000 -R adafruit-circuitpython-feather_m0_rfm69-en_US-5.0.0.bin. Help please.

idle owl
#

@tulip sleet The Feather Sense bootloaders are getting updated correct?

tulip sleet
#

@idle owl limor knows to update the testers

idle owl
#

@tulip sleet What will the bootloader be called?

tulip sleet
#

@timber mango it's -e -W -v etc. Not sure about the extra spaces you have there

idle owl
#

Trying to do the guide for it. I can rename the bootloader for screenshots but I need to know what to name it to.

tulip sleet
#

FTHRSNSBOOT

idle owl
#

thanks

tulip sleet
#

you can update the bootloader yourself if you have adafruit-nrfutil installed

idle owl
#

I don't know if I do. Probably don't. What does that gain me other than the proper name?

tulip sleet
#

the red led will work in the bootloader

idle owl
#

oh right

onyx hinge
#

yay thanks for the PR merges @tulip sleet @slender iron

tulip sleet
#

pip3 install adafruit-nrfutil

#

then...

timber mango
#

@tulip sleet Please look again. I have removed the annoying extra spaces. 🙂 😉 I do not know where they came from.

idle owl
#

Downloaded.

tulip sleet
#

then

adafruit-nrfutil --verbose dfu serial --package Downloads/feather_nrf52840_sense_bootloader-0.3.1_s140_6.1.1.zip -b 115200 --singlebank --touch 1200 -p /dev/ttyACM0
#

except change /dev/ttyACM0 to the right MacOS device

#

@timber mango what's the error

tidal kiln
#

@timber mango /dev/TTYACM0 should be/dev/ttyACM0 maybe?

timber mango
#

@tulip sleet It says No device found on /dev/ttyACM0 The port is correct. I am on a Raspberry Pi 4 running Raspbian Buster.

tidal kiln
#

what does dmesg show after putting the board in bootloader mode?

onyx hinge
#

@slender iron Looking at protomatter, it has the following structure that I need to fill out: ```typedef struct {
volatile uint32_t *setReg; // GPIO bit set register
volatile uint32_t *clearReg; // GPIO bit clear register
uint32_t bit; // GPIO bitmask
uint8_t pin; // Some identifier, e.g. Arduino pin #
} _PM_pin;

Is there something like this in the HAL already, or is it a whole new way of thinking about pins that circuitpy didn't do yet?
slender iron
#

@onyx hinge I think neopixel in some places uses the set/clear pattern

onyx hinge
#

@slender iron good thinking, I'll check that!

slender iron
#

bit and pin are probably like the parallel bus

onyx hinge
#

but that's in architecture-dependent code, there's not a "common neopixel implementation" is there?

slender iron
#

I'm thinking of samd

#

basically the first two are the addresses for the set and clear registers. their location is usually derived from the over pin number

onyx hinge
#

yeah, this is samd only to start with

slender iron
#

pin number % 32 -> port number

#

port number implies PORT address offset

timber mango
#

@tulip sleet Drats! I did not put it into bootloader mode before I ran bossac. 🙃 😎

onyx hinge
#

I was entertaining the idea that maybe mp_hal_pin_xxx could get a new sibling function to return this information

#

i.e., the platform dependent part would just be "fill this structure", oh and timers 😕

slender iron
#

sounds like you may be getting ahead of yourself a bit. I'd suggest just hacking it up for samd

onyx hinge
#

will do, thanks

cursive condor
#

lol ... using ulab, my first test working well take 10 sec. (for the record naive = 50 sec, optimised without ulab : 26 sec)

#

and that's for a not so complex pattern. with ulab, it's always around 10 sec, whatever the complexity of the pattern. impressing.

manic glacierBOT
#

I don't know enough about Safe Mode... is there any code running? Is there a chance to put a config setting where if SafeMode is activated by a brownout (vs. other issues) it continue to watch for power to come back to a reasonable level and if so reset the board? In that scenario one of two things would happen:

Safe mode runs all of the CircuitPython supervisor to give USB access to the filesystem but it doesn't run boot.py or code.py because it assumes something in the user code is fat...

timber mango
#

Drats again! There is not enough storage on the Feather M0 RFM69HCW board to load all the libraries I need. 😦 On to Plan B! I will exchange my ItsyBitsy M4 Express for the RFM69 board and add an RFM69 breakout board. 😉 🙂

idle owl
#

Apparently the Radio library was never moved to Actions?

idle owl
#

Issue filed.

#

@tulip sleet I'm not sure why the Radio library wasn't failing before. I don't know how to fix that error. It's not a typical Sphinx error, it's related to struct apparently?

tulip sleet
#

i think it thinks _ADAFRUIT_COMPANY_ID is not an integer

idle owl
#

@tulip sleet Replacing it with its const value makes it pass.

#

Do that?

tulip sleet
#

is the mock for micropython.const not working right?

idle owl
#

I didn't do micropython.const in the mock, only micropython

#

i'll try that

#

That did not work. Same failure

#

The mock for micropython is working because it fails on finding micropython without it.

lapis hemlock
idle owl
#

@tulip sleet There used to be an issue in MicroPython with const() not working with struct because it wasn't maintaining the const value, but it was REPL related and appears to have been resolved. So I don't think that's it.... I'm not sure what to do here.

onyx hinge
#

@lapis hemlock so far I've learned it's beyond my shaky memory of math in university

lapis hemlock
#

@onyx hinge I am pretty sure the implementation is OK, the question was really about structuring. But it reminds me, I should probably provide a test function. I will try to pull that off today.

#

I have tested it with a couple of odd-looking matrices, and all returned the results that I got in numpy. Hence my confidence🙂

#

You can also merge the re-location of the spectrum function. Re-naming is still on the table, if you want to.

#

Besides, implementation of isolated functions is relatively safe: if it is wrong, it won't mess up the rest of the code, and someone will complain sooner or later. I don't mean to say that I want to put faulty code out there, but we shouldn't lose too much hair over the issue.

tulip sleet
#

@idle owl working on this

idle owl
#

@tulip sleet Ok.

onyx hinge
#

ok, rename is what we agreed on in the meeting so merged that too

#

taking a break, concentration's running low 💤

lapis hemlock
#

I meant, if you want to name the function spectrogram, or whatever it was in scipy.signal.

onyx hinge
#

oh that part .. if it's compatible-ish with spectrogram then that's probably preferable?

lapis hemlock
#

It's fine with me. I can fix that.

onyx hinge
#

thanks!

tulip sleet
#

@idle owl suppose you just add Adafruit-Blinka to requirements.txt

idle owl
#

@tulip sleet Same error.

#

Not sure Sphinx is even using requirements.txt

tulip sleet
#

and remove micropython from autodoc_mock_imports

idle owl
#

hmm ok

#

Fails on No module named 'micropython'

slender iron
#

blinka should provide micropython

idle owl
#
No module named 'micropython'```
tulip sleet
#

@slender iron is it transitive, if adafruit-circuitpython-ble is in requirements.txt, would that pull in adafruit-blinka (which is in adafruit-circuitpython-ble's requirements.txt)

#

so then micropython should not be in mock_imports

slender iron
#

adafruit-blinka isn't in adafruit-circuitpython-ble's requirements iirc

#

ah, nvm

#

looks like it is

tulip sleet
#

yah

slender iron
#

I don't believe requirements.txt is transitive

idle owl
#

It wasn't in mock imports until I renamed the library. And it was working.

#

apparently.

slender iron
#

@idle owl can you link me to the build failure please?

idle owl
slender iron
#

thanks

idle owl
#

Failing locally the same way, even with Adafruit-Blinka in requirements.txt

#

or rather

#

if micropython is automocked.

#

it fails that way.

#

otherwise it fails on micropython.

slender iron
#

right. did you install adafruit-blinka locally?

tulip sleet
#

this is working for me:

halbert@salmonx:~/repos/kattni/Adafruit_CircuitPython_Radio$ sphinx-build docs ~/temp
Running Sphinx v2.4.4
loading intersphinx inventory from https://docs.python.org/3.4/objects.inv...
loading intersphinx inventory from https://circuitpython.readthedocs.io/en/latest/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] index                                                                                      
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                       
generating indices...  genindex py-modindexdone
writing additional pages...  searchdone
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in ../../../temp.
halbert@salmonx:~/repos/kattni/Adafruit_CircuitPython_Radio$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
idle owl
#

hmm ok.

#

I'll push the changes.

slender iron
#

sphinx-build doesn't automatically install the packages for requirements.txt. the build does it separately

tulip sleet
#

no wait, it's not your PR branch

idle owl
#

@slender iron fair enough.

tulip sleet
#

ok, i get the error in your branch

idle owl
#

Passes.

#

@tulip sleet Can you merge it, please?

tulip sleet
#

I removed 'micropython' from autodoc_mock_imports and it works for me

#

can you remove that and push again?

idle owl
#

I thought I did?

#

ugh.

tulip sleet
#

i had an old pull

idle owl
#

I did..

#

Thanks

#

I'll rename the repo

#

and add it to the bundle.

slender iron
#

👍 thanks!

#

unrelated: is it useful for me to use compare functionality in a timer for pulsein rather than just reading the timer value in an interrupt?

#

using compare requires tracking how many slots are being used

ionic elk
#

@slender iron got a sec to chat about half duplex uart? I've been working with a friend to get a certain brand of servos we really like, the Dynamixels, supported in Circuitpython. He was talking to the host company today and they might be interested in assisting.

slender iron
#

sure

ionic elk
#

It's a one line protocol so it would make the most sense to use the native half-duplex uart driver on STM32. I've got an example implementation already but I was wondering if that's also something that's supported on NRF/Atmel etc?

slender iron
#

by half-duplex you mean transmit only right?

ionic elk
#

No, both transmit and receive on the same line.

slender iron
#

ah, hrm

ionic elk
#

It'd require a change to the API to make one of the pins optional and the other used as both transmit and receive.

slender iron
#

I have no idea

#

the other way would be to supply the same pin to both

ionic elk
#

As in the user manually attaches both pins to one line?

slender iron
#

no, as in you pass in the same pin object to both tx and rx parameters

ionic elk
#

Oh that makes sense.

#

That'd be cleaner for sure

#

Here's the family of motors btw: http://www.robotis.us/dynamixel/

slender iron
#

I don't believe it is support anywhere else

stuck elbow
#

there is that guy on the micropython irc channel who uses those servos with his micropython boards

#

he provided the patches for micropython for the half-duplex uart, if I remember correctly

ionic elk
#

Would it be OK if I still support it on STM32? Half duplex uart is a native peripheral feature for me.

stuck elbow
#

(or maybe he's just writing to the registers directly to configure the UART, I don't remember)

#

there is also a trick with connecting both pins with some resistors or transistors, but that's fugly

ionic elk
#

Looks like on the NRF52 and SAMD51 you need a physical component with a diode

#

They don't support it out of the box

slender iron
#

@ionic elk I'm ok having it in the port but I'm not sure it's worth doing on Adafruit time.

stuck elbow
#

Dave Hylands was the guy

slender iron
#

ah, dave is awesome!

stuck elbow
ionic elk
#

@slender iron would be sponsored by Robotis if it happens 🙂

slender iron
#

@ionic elk perfect! I'd love to see others sponsoring circuitpython dev

stuck elbow
#

"A special half-duplex mode on the STM32F4 processor is utilized to allow bi-directional communications."

ionic elk
#

Or I'd just do it with my buddy, the AX-12 series is awesome and I really, really want there to be more exposure for it

slender iron
#

🙂

#

I think for me H7/F7 is more important do to wider board support that comes with it

ionic elk
#

@stuck elbow yeah half duplex is a native part of the peripheral, there's no hacks needed for stm32

#

@slender iron yeah it's up next! wrapping up PulseIn right now, almost done. Been putting together the pin profile for the H743 in the meantime as well

stuck elbow
timber mango
#

Another Frankencircuit from yours truly! This one stars a Bluetooth BLE SPI Friend breakout and an RFM69HCW Radiofruit breakout. Supporting cast is an LSM303 and a Precision NXP Fxas/Fxos 9-DOF IMU. Now that I have the circuit, it is time to hack up some Frankensoftware to go with it! 🙂 😉

manic glacierBOT
arctic violet
#

@timber mango what all is that going to do

timber mango
#

@arctic violet It is, after I get software written for it, going to be a node in an RFM69 MESH radio network that also has Bluetooth BLE for fun remote control stuff.

manic glacierBOT
#

I've got more groups and stuff although I wasn't updating any other stuff. Do you know how displayio should work in that case, does it only send what's changed to the screen? At some point I also had a same size Bitmap underneath it the 200x201.

I did some tests away from Bitmap and noted that for elem in a looked faster than for elem_idx in range(len(a)) but I'd already moved onto an undrawing approach in code so didn't bother timing that for Bitmap as I wanted something ideally...

timber mango
#

OK, I have a very important question...Do all of the Adafruit BLE libraries work ONLY with the nRF52840 boards?? You really want to say NO to this, right?? 🙂 OK, now give me the REAL answer, even if I might not like it.. 😉

tulip sleet
stuck elbow
#

it's possible it will work with other chips in the future

#

when other ble chips are supported

timber mango
#

@tulip sleet To get all the newest BLE goodness I have been reading about, I will have to swap my ItsyBitsy M4 Express and Bluefruit LE SPI Friend for a Feather nRF52840 Sense, Feather nRF52840 Express, or an ItsyBitsy nRF52840 Express - Bluetooth LE. I will just do what I can with what I have.

timber mango
#

I believe I have successfully created my first BluefruitSPI device. Well, I did not get any errors on my instantiations.

#

@lone axle Ha ha! 😛 Now, I have to do something with the device I just created. That is a project for tomorrow.

manic glacierBOT
manic glacierBOT
#

@tannewt I agree it should be ling term. I think very few people will find this bug and the temporary fix is quite easy.

It could be that I am miss-interpreting "the correct thing would be to have the later id of l[0] be 536896144" but I think that the object shouldn't be made into a separate copy after import. I think that would be perfectly acceptable for immutable objects like ints, strs, tuples, etc but mutable objects should not be duplicated. I think when the list is edited in ...

fathom trellis
#

Hi folks! The interns at Microsoft are working on VS Code extensions around CircuitPython and MicroPython. If you're interested and could take a few moments to fill out their very brief survey they'd really appreciate it.

Link and more details at: https://twitter.com/nnja/status/1237483172872372224

Are you interested in Python on microcontrollers & embedded devices?

Please help the interns at @MSFTGarage with research by taking a brief survey!

👉https://t.co/Z8NjTLBtlz👈 https://t.co/3bgp4nYL9o

cursive condor
#

@lapis hemlock : I'm experimenting with ulab since yesterday... it's amazing. I have a few questions (maybe someone else can answer too)
I can't find atan2() function so I use atan = ulab.array([math.atan2(y, row[i]) for i in range(width)]) with row being a ulab.array and y an int. is there a faster way to do it ?

#

and what is the better way to convert a float array to an int array ?

onyx hinge
#

I don't think there's atan2() and I don't know about conversion to integer. In the fft example in the guide, I did this when setting bitmap elements from a float array: for x in range(min(bitmap.width, len(data))): bitmap[x+offset, y] = int(data[x])

#

v923z has been receptive to ideas, if you are on github you can file issues on https://github.com/v923z/micropython-ulab/ about things you perceive as missing features.

cursive condor
#

yup it's my current solution. and yes I'll post there for a few things when I sort out everything in my head 🙂

onyx hinge
#

Thanks!

cursive condor
#

this is quite faster : atan = ulab.array([math.atan2(y, i) for i in row]) for example...

manic glacierBOT
cursive condor
#

but maybe there is a more efficient way to apply a function to every members of an array...

simple pulsar
#

@cursive condor Do you mean in general or ulab.array specific?

cursive condor
#

ulab.array

cursive condor
#

this last one take around 0.00524089 secs. to compare z = z + ulab.vector.cos(ulab.vector.sin(atan + (i * rot)) * dist) take only 0.00272972 secs (with z, atan, rot and dist being ulab.array, and i being an int)

timber mango
#

It also talks about a MODE Switch and a MODE Pin. I do not see either of these on my Bluefruit SPI Friend. Should I be seeing these?

solar whale
#

@timber mango they are on the UART Friend not the SPI Friend -- you should not need them. The software handles it.

timber mango
#

The guide does not specify this anywhere. At least, I did not see it anywhere in the guide.

solar whale
#

But it also does not refer to them in any of the instructions for the SPI friend -- apparently some of it is used for both.